diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8edd9c22..32dbe0e2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.74.0" + ".": "5.0.0" } diff --git a/.stats.yml b/.stats.yml index 1265d475..645b4c0b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 115 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d513be954ba2cb57489bd048f93790cabb13849f0f04d328a5a15694c99550df.yml -openapi_spec_hash: 0d42694f412abf65defc3f88646a809c -config_hash: 1e2186b09e57d7d27b6ab5c8e6410b31 +configured_endpoints: 116 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c2a4808c828c8288c5c8dfe2fdfa51d4d7c1bcc33cacc6b859d0cf4b35ce95cc.yml +openapi_spec_hash: a2b5a1bfabbd03dd1b411791576eb502 +config_hash: 3c3524be9607afb24d2139ce26ce5389 diff --git a/CHANGELOG.md b/CHANGELOG.md index fa25db07..a3021d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 5.0.0 (2025-06-09) + +Full Changelog: [v4.74.0...v5.0.0](https://github.com/orbcorp/orb-node/compare/v4.74.0...v5.0.0) + +### ⚠ BREAKING CHANGES + +* **client:** breaking change to re-use types + +### Features + +* **api:** api update ([f568653](https://github.com/orbcorp/orb-node/commit/f5686531660890c996aed2bcd3fbfdbf6ba71013)) +* **api:** api update ([4c28249](https://github.com/orbcorp/orb-node/commit/4c28249f71e8a9aa3d75ac9a448ebb6f70301af2)) +* **api:** api update ([9dc5bb3](https://github.com/orbcorp/orb-node/commit/9dc5bb3e4d0e2005691b3a886591a317bd84a60a)) +* **api:** api update ([9328fae](https://github.com/orbcorp/orb-node/commit/9328faed43114dfe9f4fead3e6da314f6e626d33)) +* **api:** api update ([44e9c35](https://github.com/orbcorp/orb-node/commit/44e9c35fb3b805cccb264647d7686fa00dd2a71b)) +* **api:** manual updates ([8cc1c0b](https://github.com/orbcorp/orb-node/commit/8cc1c0bfb17d0ec2537e9470340a7926df177a28)) +* **client:** breaking change to re-use types ([17a06ae](https://github.com/orbcorp/orb-node/commit/17a06aea5f1edb125fb033156a8eb76c6510cd76)) + + +### Chores + +* **internal:** codegen related update ([89ce8ec](https://github.com/orbcorp/orb-node/commit/89ce8ecf96b39394f17eb8b7735cc710d0e50cc4)) + ## 4.74.0 (2025-06-03) Full Changelog: [v4.73.0...v4.74.0](https://github.com/orbcorp/orb-node/compare/v4.73.0...v4.74.0) diff --git a/api.md b/api.md index 3fb22988..e293b0dc 100644 --- a/api.md +++ b/api.md @@ -2,15 +2,148 @@ Types: +- Address +- AdjustmentInterval +- AggregatedCost +- Allocation - AmountDiscount +- AmountDiscountInterval +- BillableMetricTiny +- BillingCycleAnchorConfiguration +- BillingCycleConfiguration - BillingCycleRelativeDate +- BPSConfig +- BPSTier +- BulkBPSConfig +- BulkBPSTier +- BulkConfig +- BulkTier +- ChangedSubscriptionResources +- ConversionRateTier +- ConversionRateTieredConfig +- ConversionRateUnitConfig +- CouponRedemption +- CreditNote +- CreditNoteTiny +- CustomExpiration +- CustomerMinified +- CustomerTaxID +- DimensionalPriceConfiguration - Discount +- FixedFeeQuantityScheduleEntry +- FixedFeeQuantityTransition +- Invoice - InvoiceLevelDiscount +- InvoiceTiny +- ItemSlim +- MatrixConfig +- MatrixSubLineItem +- MatrixValue +- MatrixWithAllocationConfig +- Maximum +- MaximumInterval +- Minimum +- MinimumInterval +- MonetaryAmountDiscountAdjustment +- MonetaryMaximumAdjustment +- MonetaryMinimumAdjustment +- MonetaryPercentageDiscountAdjustment +- MonetaryUsageDiscountAdjustment +- NewAllocationPrice +- NewAmountDiscount +- NewBillingCycleConfiguration +- NewDimensionalPriceConfiguration +- NewFloatingBPSPrice +- NewFloatingBulkBPSPrice +- NewFloatingBulkPrice +- NewFloatingBulkWithProrationPrice +- NewFloatingCumulativeGroupedBulkPrice +- NewFloatingGroupedAllocationPrice +- NewFloatingGroupedTieredPackagePrice +- NewFloatingGroupedTieredPrice +- NewFloatingGroupedWithMeteredMinimumPrice +- NewFloatingGroupedWithProratedMinimumPrice +- NewFloatingMatrixPrice +- NewFloatingMatrixWithAllocationPrice +- NewFloatingMatrixWithDisplayNamePrice +- NewFloatingMaxGroupTieredPackagePrice +- NewFloatingPackagePrice +- NewFloatingPackageWithAllocationPrice +- NewFloatingScalableMatrixWithTieredPricingPrice +- NewFloatingScalableMatrixWithUnitPricingPrice +- NewFloatingThresholdTotalAmountPrice +- NewFloatingTieredBPSPrice +- NewFloatingTieredPackagePrice +- NewFloatingTieredPackageWithMinimumPrice +- NewFloatingTieredPrice +- NewFloatingTieredWithMinimumPrice +- NewFloatingTieredWithProrationPrice +- NewFloatingUnitPrice +- NewFloatingUnitWithPercentPrice +- NewFloatingUnitWithProrationPrice +- NewMaximum +- NewMinimum +- NewPercentageDiscount +- NewPlanBPSPrice +- NewPlanBulkBPSPrice +- NewPlanBulkPrice +- NewPlanBulkWithProrationPrice +- NewPlanCumulativeGroupedBulkPrice +- NewPlanGroupedAllocationPrice +- NewPlanGroupedTieredPackagePrice +- NewPlanGroupedTieredPrice +- NewPlanGroupedWithMeteredMinimumPrice +- NewPlanGroupedWithProratedMinimumPrice +- NewPlanMatrixPrice +- NewPlanMatrixWithAllocationPrice +- NewPlanMatrixWithDisplayNamePrice +- NewPlanMaxGroupTieredPackagePrice +- NewPlanPackagePrice +- NewPlanPackageWithAllocationPrice +- NewPlanScalableMatrixWithTieredPricingPrice +- NewPlanScalableMatrixWithUnitPricingPrice +- NewPlanThresholdTotalAmountPrice +- NewPlanTierWithProrationPrice +- NewPlanTieredBPSPrice +- NewPlanTieredPackagePrice +- NewPlanTieredPackageWithMinimumPrice +- NewPlanTieredPrice +- NewPlanTieredWithMinimumPrice +- NewPlanUnitPrice +- NewPlanUnitWithPercentPrice +- NewPlanUnitWithProrationPrice +- NewUsageDiscount +- OtherSubLineItem +- PackageConfig - PaginationMetadata +- PerPriceCost - PercentageDiscount +- PercentageDiscountInterval +- PlanPhaseAmountDiscountAdjustment +- PlanPhaseMaximumAdjustment +- PlanPhaseMinimumAdjustment +- PlanPhasePercentageDiscountAdjustment +- PlanPhaseUsageDiscountAdjustment +- Price +- PriceInterval +- SubLineItemGrouping +- SubLineItemMatrixConfig +- SubscriptionChangeMinified +- SubscriptionMinified +- SubscriptionTrialInfo +- TaxAmount +- Tier +- TierConfig +- TierSubLineItem +- TieredBPSConfig +- TieredConfig +- TieredConversionRateConfig +- TransformPriceFilter - TrialDiscount +- UnitConfig +- UnitConversionRateConfig - UsageDiscount - +- UsageDiscountInterval # TopLevel @@ -64,10 +197,6 @@ Methods: # CreditNotes -Types: - -- CreditNote - Methods: - client.creditNotes.create({ ...params }) -> CreditNote @@ -78,7 +207,15 @@ Methods: Types: +- AccountingProviderConfig +- AddressInput - Customer +- CustomerHierarchyConfig +- NewAccountingSyncConfiguration +- NewAvalaraTaxConfiguration +- NewReportingConfiguration +- NewSphereConfiguration +- NewTaxJarConfiguration Methods: @@ -120,6 +257,14 @@ Methods: Types: +- AffectedBlock +- AmendmentLedgerEntry +- CreditBlockExpiryLedgerEntry +- DecrementLedgerEntry +- ExpirationChangeLedgerEntry +- IncrementLedgerEntry +- VoidInitiatedLedgerEntry +- VoidLedgerEntry - LedgerListResponse - LedgerCreateEntryResponse - LedgerCreateEntryByExternalIDResponse @@ -136,6 +281,7 @@ Methods: Types: +- TopUpInvoiceSettings - TopUpCreateResponse - TopUpListResponse - TopUpCreateByExternalIDResponse @@ -220,7 +366,6 @@ Methods: Types: -- Invoice - InvoiceFetchUpcomingResponse Methods: @@ -287,9 +432,9 @@ Methods: Types: - EvaluatePriceGroup -- Price - PriceEvaluateResponse - PriceEvaluateMultipleResponse +- PriceEvaluatePreviewEventsResponse Methods: @@ -298,6 +443,7 @@ Methods: - client.prices.list({ ...params }) -> PricesPage - client.prices.evaluate(priceId, { ...params }) -> PriceEvaluateResponse - client.prices.evaluateMultiple({ ...params }) -> PriceEvaluateMultipleResponse +- client.prices.evaluatePreviewEvents({ ...params }) -> PriceEvaluatePreviewEventsResponse - client.prices.fetch(priceId) -> Price ## ExternalPriceID @@ -311,48 +457,67 @@ Methods: Types: +- DiscountOverride +- NewSubscriptionBPSPrice +- NewSubscriptionBulkBPSPrice +- NewSubscriptionBulkPrice +- NewSubscriptionBulkWithProrationPrice +- NewSubscriptionCumulativeGroupedBulkPrice +- NewSubscriptionGroupedAllocationPrice +- NewSubscriptionGroupedTieredPackagePrice +- NewSubscriptionGroupedTieredPrice +- NewSubscriptionGroupedWithMeteredMinimumPrice +- NewSubscriptionGroupedWithProratedMinimumPrice +- NewSubscriptionMatrixPrice +- NewSubscriptionMatrixWithAllocationPrice +- NewSubscriptionMatrixWithDisplayNamePrice +- NewSubscriptionMaxGroupTieredPackagePrice +- NewSubscriptionPackagePrice +- NewSubscriptionPackageWithAllocationPrice +- NewSubscriptionScalableMatrixWithTieredPricingPrice +- NewSubscriptionScalableMatrixWithUnitPricingPrice +- NewSubscriptionThresholdTotalAmountPrice +- NewSubscriptionTierWithProrationPrice +- NewSubscriptionTieredBPSPrice +- NewSubscriptionTieredPackagePrice +- NewSubscriptionTieredPackageWithMinimumPrice +- NewSubscriptionTieredPrice +- NewSubscriptionTieredWithMinimumPrice +- NewSubscriptionUnitPrice +- NewSubscriptionUnitWithPercentPrice +- NewSubscriptionUnitWithProrationPrice - Subscription - SubscriptionUsage - Subscriptions -- SubscriptionCreateResponse -- SubscriptionCancelResponse - SubscriptionFetchCostsResponse - SubscriptionFetchScheduleResponse -- SubscriptionPriceIntervalsResponse -- SubscriptionRedeemCouponResponse -- SubscriptionSchedulePlanChangeResponse -- SubscriptionTriggerPhaseResponse -- SubscriptionUnscheduleCancellationResponse -- SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse -- SubscriptionUnschedulePendingPlanChangesResponse -- SubscriptionUpdateFixedFeeQuantityResponse -- SubscriptionUpdateTrialResponse Methods: -- client.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.subscriptions.create({ ...params }) -> MutatedSubscription - client.subscriptions.update(subscriptionId, { ...params }) -> Subscription - client.subscriptions.list({ ...params }) -> SubscriptionsPage -- client.subscriptions.cancel(subscriptionId, { ...params }) -> SubscriptionCancelResponse +- client.subscriptions.cancel(subscriptionId, { ...params }) -> MutatedSubscription - client.subscriptions.fetch(subscriptionId) -> Subscription - client.subscriptions.fetchCosts(subscriptionId, { ...params }) -> SubscriptionFetchCostsResponse - client.subscriptions.fetchSchedule(subscriptionId, { ...params }) -> SubscriptionFetchScheduleResponsesPage - client.subscriptions.fetchUsage(subscriptionId, { ...params }) -> SubscriptionUsage -- client.subscriptions.priceIntervals(subscriptionId, { ...params }) -> SubscriptionPriceIntervalsResponse -- client.subscriptions.redeemCoupon(subscriptionId, { ...params }) -> SubscriptionRedeemCouponResponse -- client.subscriptions.schedulePlanChange(subscriptionId, { ...params }) -> SubscriptionSchedulePlanChangeResponse -- client.subscriptions.triggerPhase(subscriptionId, { ...params }) -> SubscriptionTriggerPhaseResponse -- client.subscriptions.unscheduleCancellation(subscriptionId) -> SubscriptionUnscheduleCancellationResponse -- client.subscriptions.unscheduleFixedFeeQuantityUpdates(subscriptionId, { ...params }) -> SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse -- client.subscriptions.unschedulePendingPlanChanges(subscriptionId) -> SubscriptionUnschedulePendingPlanChangesResponse -- client.subscriptions.updateFixedFeeQuantity(subscriptionId, { ...params }) -> SubscriptionUpdateFixedFeeQuantityResponse -- client.subscriptions.updateTrial(subscriptionId, { ...params }) -> SubscriptionUpdateTrialResponse +- client.subscriptions.priceIntervals(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.redeemCoupon(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.schedulePlanChange(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.triggerPhase(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.unscheduleCancellation(subscriptionId) -> MutatedSubscription +- client.subscriptions.unscheduleFixedFeeQuantityUpdates(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.unschedulePendingPlanChanges(subscriptionId) -> MutatedSubscription +- client.subscriptions.updateFixedFeeQuantity(subscriptionId, { ...params }) -> MutatedSubscription +- client.subscriptions.updateTrial(subscriptionId, { ...params }) -> MutatedSubscription # Alerts Types: - Alert +- Threshold Methods: @@ -388,6 +553,7 @@ Methods: Types: +- MutatedSubscription - SubscriptionChangeRetrieveResponse - SubscriptionChangeApplyResponse - SubscriptionChangeCancelResponse diff --git a/package.json b/package.json index 4f2e7738..8ba0ddf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.74.0", + "version": "5.0.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 76cff6be..493e394a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,21 +19,15 @@ import { AlertUpdateParams, Alerts, AlertsPage, + Threshold, } from './resources/alerts'; -import { - CreditNote, - CreditNoteCreateParams, - CreditNoteListParams, - CreditNotes, - CreditNotesPage, -} from './resources/credit-notes'; +import { CreditNoteCreateParams, CreditNoteListParams, CreditNotes } from './resources/credit-notes'; import { InvoiceLineItemCreateParams, InvoiceLineItemCreateResponse, InvoiceLineItems, } from './resources/invoice-line-items'; import { - Invoice, InvoiceCreateParams, InvoiceFetchUpcomingParams, InvoiceFetchUpcomingResponse, @@ -42,7 +36,6 @@ import { InvoiceMarkPaidParams, InvoiceUpdateParams, Invoices, - InvoicesPage, } from './resources/invoices'; import { Item, @@ -61,6 +54,7 @@ import { Metrics, } from './resources/metrics'; import { + MutatedSubscription, SubscriptionChangeApplyParams, SubscriptionChangeApplyResponse, SubscriptionChangeCancelResponse, @@ -68,11 +62,38 @@ import { SubscriptionChanges, } from './resources/subscription-changes'; import { + DiscountOverride, + NewSubscriptionBPSPrice, + NewSubscriptionBulkBPSPrice, + NewSubscriptionBulkPrice, + NewSubscriptionBulkWithProrationPrice, + NewSubscriptionCumulativeGroupedBulkPrice, + NewSubscriptionGroupedAllocationPrice, + NewSubscriptionGroupedTieredPackagePrice, + NewSubscriptionGroupedTieredPrice, + NewSubscriptionGroupedWithMeteredMinimumPrice, + NewSubscriptionGroupedWithProratedMinimumPrice, + NewSubscriptionMatrixPrice, + NewSubscriptionMatrixWithAllocationPrice, + NewSubscriptionMatrixWithDisplayNamePrice, + NewSubscriptionMaxGroupTieredPackagePrice, + NewSubscriptionPackagePrice, + NewSubscriptionPackageWithAllocationPrice, + NewSubscriptionScalableMatrixWithTieredPricingPrice, + NewSubscriptionScalableMatrixWithUnitPricingPrice, + NewSubscriptionThresholdTotalAmountPrice, + NewSubscriptionTierWithProrationPrice, + NewSubscriptionTieredBPSPrice, + NewSubscriptionTieredPackagePrice, + NewSubscriptionTieredPackageWithMinimumPrice, + NewSubscriptionTieredPrice, + NewSubscriptionTieredWithMinimumPrice, + NewSubscriptionUnitPrice, + NewSubscriptionUnitWithPercentPrice, + NewSubscriptionUnitWithProrationPrice, Subscription, SubscriptionCancelParams, - SubscriptionCancelResponse, SubscriptionCreateParams, - SubscriptionCreateResponse, SubscriptionFetchCostsParams, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleParams, @@ -81,22 +102,13 @@ import { SubscriptionFetchUsageParams, SubscriptionListParams, SubscriptionPriceIntervalsParams, - SubscriptionPriceIntervalsResponse, SubscriptionRedeemCouponParams, - SubscriptionRedeemCouponResponse, SubscriptionSchedulePlanChangeParams, - SubscriptionSchedulePlanChangeResponse, SubscriptionTriggerPhaseParams, - SubscriptionTriggerPhaseResponse, - SubscriptionUnscheduleCancellationResponse, SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, - SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, - SubscriptionUnschedulePendingPlanChangesResponse, SubscriptionUpdateFixedFeeQuantityParams, - SubscriptionUpdateFixedFeeQuantityResponse, SubscriptionUpdateParams, SubscriptionUpdateTrialParams, - SubscriptionUpdateTrialResponse, SubscriptionUsage, Subscriptions, SubscriptionsPage, @@ -117,13 +129,21 @@ import { CouponsPage, } from './resources/coupons/coupons'; import { + AccountingProviderConfig, + AddressInput, Customer, CustomerCreateParams, + CustomerHierarchyConfig, CustomerListParams, CustomerUpdateByExternalIDParams, CustomerUpdateParams, Customers, CustomersPage, + NewAccountingSyncConfiguration, + NewAvalaraTaxConfiguration, + NewReportingConfiguration, + NewSphereConfiguration, + NewTaxJarConfiguration, } from './resources/customers/customers'; import { DimensionalPriceGroup, @@ -152,16 +172,16 @@ import { } from './resources/plans/plans'; import { EvaluatePriceGroup, - Price, PriceCreateParams, PriceEvaluateMultipleParams, PriceEvaluateMultipleResponse, PriceEvaluateParams, + PriceEvaluatePreviewEventsParams, + PriceEvaluatePreviewEventsResponse, PriceEvaluateResponse, PriceListParams, PriceUpdateParams, Prices, - PricesPage, } from './resources/prices/prices'; export interface ClientOptions { @@ -363,13 +383,11 @@ Orb.Beta = Beta; Orb.Coupons = Coupons; Orb.CouponsPage = CouponsPage; Orb.CreditNotes = CreditNotes; -Orb.CreditNotesPage = CreditNotesPage; Orb.Customers = Customers; Orb.CustomersPage = CustomersPage; Orb.Events = Events; Orb.InvoiceLineItems = InvoiceLineItems; Orb.Invoices = Invoices; -Orb.InvoicesPage = InvoicesPage; Orb.Items = Items; Orb.ItemsPage = ItemsPage; Orb.Metrics = Metrics; @@ -377,7 +395,6 @@ Orb.BillableMetricsPage = BillableMetricsPage; Orb.Plans = Plans; Orb.PlansPage = PlansPage; Orb.Prices = Prices; -Orb.PricesPage = PricesPage; Orb.SubscriptionsPage = SubscriptionsPage; Orb.SubscriptionFetchScheduleResponsesPage = SubscriptionFetchScheduleResponsesPage; Orb.Alerts = Alerts; @@ -410,15 +427,21 @@ export declare namespace Orb { export { CreditNotes as CreditNotes, - type CreditNote as CreditNote, - CreditNotesPage as CreditNotesPage, type CreditNoteCreateParams as CreditNoteCreateParams, type CreditNoteListParams as CreditNoteListParams, }; export { Customers as Customers, + type AccountingProviderConfig as AccountingProviderConfig, + type AddressInput as AddressInput, type Customer as Customer, + type CustomerHierarchyConfig as CustomerHierarchyConfig, + type NewAccountingSyncConfiguration as NewAccountingSyncConfiguration, + type NewAvalaraTaxConfiguration as NewAvalaraTaxConfiguration, + type NewReportingConfiguration as NewReportingConfiguration, + type NewSphereConfiguration as NewSphereConfiguration, + type NewTaxJarConfiguration as NewTaxJarConfiguration, CustomersPage as CustomersPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, @@ -445,9 +468,7 @@ export declare namespace Orb { export { Invoices as Invoices, - type Invoice as Invoice, type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, - InvoicesPage as InvoicesPage, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceUpdateParams as InvoiceUpdateParams, type InvoiceListParams as InvoiceListParams, @@ -486,34 +507,52 @@ export declare namespace Orb { export { Prices as Prices, type EvaluatePriceGroup as EvaluatePriceGroup, - type Price as Price, type PriceEvaluateResponse as PriceEvaluateResponse, type PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse, - PricesPage as PricesPage, + type PriceEvaluatePreviewEventsResponse as PriceEvaluatePreviewEventsResponse, type PriceCreateParams as PriceCreateParams, type PriceUpdateParams as PriceUpdateParams, type PriceListParams as PriceListParams, type PriceEvaluateParams as PriceEvaluateParams, type PriceEvaluateMultipleParams as PriceEvaluateMultipleParams, + type PriceEvaluatePreviewEventsParams as PriceEvaluatePreviewEventsParams, }; export { type Subscriptions as Subscriptions, + type DiscountOverride as DiscountOverride, + type NewSubscriptionBPSPrice as NewSubscriptionBPSPrice, + type NewSubscriptionBulkBPSPrice as NewSubscriptionBulkBPSPrice, + type NewSubscriptionBulkPrice as NewSubscriptionBulkPrice, + type NewSubscriptionBulkWithProrationPrice as NewSubscriptionBulkWithProrationPrice, + type NewSubscriptionCumulativeGroupedBulkPrice as NewSubscriptionCumulativeGroupedBulkPrice, + type NewSubscriptionGroupedAllocationPrice as NewSubscriptionGroupedAllocationPrice, + type NewSubscriptionGroupedTieredPackagePrice as NewSubscriptionGroupedTieredPackagePrice, + type NewSubscriptionGroupedTieredPrice as NewSubscriptionGroupedTieredPrice, + type NewSubscriptionGroupedWithMeteredMinimumPrice as NewSubscriptionGroupedWithMeteredMinimumPrice, + type NewSubscriptionGroupedWithProratedMinimumPrice as NewSubscriptionGroupedWithProratedMinimumPrice, + type NewSubscriptionMatrixPrice as NewSubscriptionMatrixPrice, + type NewSubscriptionMatrixWithAllocationPrice as NewSubscriptionMatrixWithAllocationPrice, + type NewSubscriptionMatrixWithDisplayNamePrice as NewSubscriptionMatrixWithDisplayNamePrice, + type NewSubscriptionMaxGroupTieredPackagePrice as NewSubscriptionMaxGroupTieredPackagePrice, + type NewSubscriptionPackagePrice as NewSubscriptionPackagePrice, + type NewSubscriptionPackageWithAllocationPrice as NewSubscriptionPackageWithAllocationPrice, + type NewSubscriptionScalableMatrixWithTieredPricingPrice as NewSubscriptionScalableMatrixWithTieredPricingPrice, + type NewSubscriptionScalableMatrixWithUnitPricingPrice as NewSubscriptionScalableMatrixWithUnitPricingPrice, + type NewSubscriptionThresholdTotalAmountPrice as NewSubscriptionThresholdTotalAmountPrice, + type NewSubscriptionTierWithProrationPrice as NewSubscriptionTierWithProrationPrice, + type NewSubscriptionTieredBPSPrice as NewSubscriptionTieredBPSPrice, + type NewSubscriptionTieredPackagePrice as NewSubscriptionTieredPackagePrice, + type NewSubscriptionTieredPackageWithMinimumPrice as NewSubscriptionTieredPackageWithMinimumPrice, + type NewSubscriptionTieredPrice as NewSubscriptionTieredPrice, + type NewSubscriptionTieredWithMinimumPrice as NewSubscriptionTieredWithMinimumPrice, + type NewSubscriptionUnitPrice as NewSubscriptionUnitPrice, + type NewSubscriptionUnitWithPercentPrice as NewSubscriptionUnitWithPercentPrice, + type NewSubscriptionUnitWithProrationPrice as NewSubscriptionUnitWithProrationPrice, type Subscription as Subscription, type SubscriptionUsage as SubscriptionUsage, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse, type SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse, - type SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse, - type SubscriptionRedeemCouponResponse as SubscriptionRedeemCouponResponse, - type SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse, - type SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse, - type SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse, - type SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse as SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, - type SubscriptionUnschedulePendingPlanChangesResponse as SubscriptionUnschedulePendingPlanChangesResponse, - type SubscriptionUpdateFixedFeeQuantityResponse as SubscriptionUpdateFixedFeeQuantityResponse, - type SubscriptionUpdateTrialResponse as SubscriptionUpdateTrialResponse, SubscriptionsPage as SubscriptionsPage, SubscriptionFetchScheduleResponsesPage as SubscriptionFetchScheduleResponsesPage, type SubscriptionCreateParams as SubscriptionCreateParams, @@ -535,6 +574,7 @@ export declare namespace Orb { export { Alerts as Alerts, type Alert as Alert, + type Threshold as Threshold, AlertsPage as AlertsPage, type AlertUpdateParams as AlertUpdateParams, type AlertListParams as AlertListParams, @@ -555,20 +595,157 @@ export declare namespace Orb { export { SubscriptionChanges as SubscriptionChanges, + type MutatedSubscription as MutatedSubscription, type SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse, type SubscriptionChangeApplyResponse as SubscriptionChangeApplyResponse, type SubscriptionChangeCancelResponse as SubscriptionChangeCancelResponse, type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams, }; + export type Address = API.Address; + export type AdjustmentInterval = API.AdjustmentInterval; + export type AggregatedCost = API.AggregatedCost; + export type Allocation = API.Allocation; export type AmountDiscount = API.AmountDiscount; + export type AmountDiscountInterval = API.AmountDiscountInterval; + export type BillableMetricTiny = API.BillableMetricTiny; + export type BillingCycleAnchorConfiguration = API.BillingCycleAnchorConfiguration; + export type BillingCycleConfiguration = API.BillingCycleConfiguration; export type BillingCycleRelativeDate = API.BillingCycleRelativeDate; + export type BPSConfig = API.BPSConfig; + export type BPSTier = API.BPSTier; + export type BulkBPSConfig = API.BulkBPSConfig; + export type BulkBPSTier = API.BulkBPSTier; + export type BulkConfig = API.BulkConfig; + export type BulkTier = API.BulkTier; + export type ChangedSubscriptionResources = API.ChangedSubscriptionResources; + export type ConversionRateTier = API.ConversionRateTier; + export type ConversionRateTieredConfig = API.ConversionRateTieredConfig; + export type ConversionRateUnitConfig = API.ConversionRateUnitConfig; + export type CouponRedemption = API.CouponRedemption; + export type CreditNote = API.CreditNote; + export type CreditNoteTiny = API.CreditNoteTiny; + export type CustomExpiration = API.CustomExpiration; + export type CustomerMinified = API.CustomerMinified; + export type CustomerTaxID = API.CustomerTaxID; + export type DimensionalPriceConfiguration = API.DimensionalPriceConfiguration; export type Discount = API.Discount; + export type FixedFeeQuantityScheduleEntry = API.FixedFeeQuantityScheduleEntry; + export type FixedFeeQuantityTransition = API.FixedFeeQuantityTransition; + export type Invoice = API.Invoice; export type InvoiceLevelDiscount = API.InvoiceLevelDiscount; + export type InvoiceTiny = API.InvoiceTiny; + export type ItemSlim = API.ItemSlim; + export type MatrixConfig = API.MatrixConfig; + export type MatrixSubLineItem = API.MatrixSubLineItem; + export type MatrixValue = API.MatrixValue; + export type MatrixWithAllocationConfig = API.MatrixWithAllocationConfig; + export type Maximum = API.Maximum; + export type MaximumInterval = API.MaximumInterval; + export type Minimum = API.Minimum; + export type MinimumInterval = API.MinimumInterval; + export type MonetaryAmountDiscountAdjustment = API.MonetaryAmountDiscountAdjustment; + export type MonetaryMaximumAdjustment = API.MonetaryMaximumAdjustment; + export type MonetaryMinimumAdjustment = API.MonetaryMinimumAdjustment; + export type MonetaryPercentageDiscountAdjustment = API.MonetaryPercentageDiscountAdjustment; + export type MonetaryUsageDiscountAdjustment = API.MonetaryUsageDiscountAdjustment; + export type NewAllocationPrice = API.NewAllocationPrice; + export type NewAmountDiscount = API.NewAmountDiscount; + export type NewBillingCycleConfiguration = API.NewBillingCycleConfiguration; + export type NewDimensionalPriceConfiguration = API.NewDimensionalPriceConfiguration; + export type NewFloatingBPSPrice = API.NewFloatingBPSPrice; + export type NewFloatingBulkBPSPrice = API.NewFloatingBulkBPSPrice; + export type NewFloatingBulkPrice = API.NewFloatingBulkPrice; + export type NewFloatingBulkWithProrationPrice = API.NewFloatingBulkWithProrationPrice; + export type NewFloatingCumulativeGroupedBulkPrice = API.NewFloatingCumulativeGroupedBulkPrice; + export type NewFloatingGroupedAllocationPrice = API.NewFloatingGroupedAllocationPrice; + export type NewFloatingGroupedTieredPackagePrice = API.NewFloatingGroupedTieredPackagePrice; + export type NewFloatingGroupedTieredPrice = API.NewFloatingGroupedTieredPrice; + export type NewFloatingGroupedWithMeteredMinimumPrice = API.NewFloatingGroupedWithMeteredMinimumPrice; + export type NewFloatingGroupedWithProratedMinimumPrice = API.NewFloatingGroupedWithProratedMinimumPrice; + export type NewFloatingMatrixPrice = API.NewFloatingMatrixPrice; + export type NewFloatingMatrixWithAllocationPrice = API.NewFloatingMatrixWithAllocationPrice; + export type NewFloatingMatrixWithDisplayNamePrice = API.NewFloatingMatrixWithDisplayNamePrice; + export type NewFloatingMaxGroupTieredPackagePrice = API.NewFloatingMaxGroupTieredPackagePrice; + export type NewFloatingPackagePrice = API.NewFloatingPackagePrice; + export type NewFloatingPackageWithAllocationPrice = API.NewFloatingPackageWithAllocationPrice; + export type NewFloatingScalableMatrixWithTieredPricingPrice = + API.NewFloatingScalableMatrixWithTieredPricingPrice; + export type NewFloatingScalableMatrixWithUnitPricingPrice = + API.NewFloatingScalableMatrixWithUnitPricingPrice; + export type NewFloatingThresholdTotalAmountPrice = API.NewFloatingThresholdTotalAmountPrice; + export type NewFloatingTieredBPSPrice = API.NewFloatingTieredBPSPrice; + export type NewFloatingTieredPackagePrice = API.NewFloatingTieredPackagePrice; + export type NewFloatingTieredPackageWithMinimumPrice = API.NewFloatingTieredPackageWithMinimumPrice; + export type NewFloatingTieredPrice = API.NewFloatingTieredPrice; + export type NewFloatingTieredWithMinimumPrice = API.NewFloatingTieredWithMinimumPrice; + export type NewFloatingTieredWithProrationPrice = API.NewFloatingTieredWithProrationPrice; + export type NewFloatingUnitPrice = API.NewFloatingUnitPrice; + export type NewFloatingUnitWithPercentPrice = API.NewFloatingUnitWithPercentPrice; + export type NewFloatingUnitWithProrationPrice = API.NewFloatingUnitWithProrationPrice; + export type NewMaximum = API.NewMaximum; + export type NewMinimum = API.NewMinimum; + export type NewPercentageDiscount = API.NewPercentageDiscount; + export type NewPlanBPSPrice = API.NewPlanBPSPrice; + export type NewPlanBulkBPSPrice = API.NewPlanBulkBPSPrice; + export type NewPlanBulkPrice = API.NewPlanBulkPrice; + export type NewPlanBulkWithProrationPrice = API.NewPlanBulkWithProrationPrice; + export type NewPlanCumulativeGroupedBulkPrice = API.NewPlanCumulativeGroupedBulkPrice; + export type NewPlanGroupedAllocationPrice = API.NewPlanGroupedAllocationPrice; + export type NewPlanGroupedTieredPackagePrice = API.NewPlanGroupedTieredPackagePrice; + export type NewPlanGroupedTieredPrice = API.NewPlanGroupedTieredPrice; + export type NewPlanGroupedWithMeteredMinimumPrice = API.NewPlanGroupedWithMeteredMinimumPrice; + export type NewPlanGroupedWithProratedMinimumPrice = API.NewPlanGroupedWithProratedMinimumPrice; + export type NewPlanMatrixPrice = API.NewPlanMatrixPrice; + export type NewPlanMatrixWithAllocationPrice = API.NewPlanMatrixWithAllocationPrice; + export type NewPlanMatrixWithDisplayNamePrice = API.NewPlanMatrixWithDisplayNamePrice; + export type NewPlanMaxGroupTieredPackagePrice = API.NewPlanMaxGroupTieredPackagePrice; + export type NewPlanPackagePrice = API.NewPlanPackagePrice; + export type NewPlanPackageWithAllocationPrice = API.NewPlanPackageWithAllocationPrice; + export type NewPlanScalableMatrixWithTieredPricingPrice = API.NewPlanScalableMatrixWithTieredPricingPrice; + export type NewPlanScalableMatrixWithUnitPricingPrice = API.NewPlanScalableMatrixWithUnitPricingPrice; + export type NewPlanThresholdTotalAmountPrice = API.NewPlanThresholdTotalAmountPrice; + export type NewPlanTierWithProrationPrice = API.NewPlanTierWithProrationPrice; + export type NewPlanTieredBPSPrice = API.NewPlanTieredBPSPrice; + export type NewPlanTieredPackagePrice = API.NewPlanTieredPackagePrice; + export type NewPlanTieredPackageWithMinimumPrice = API.NewPlanTieredPackageWithMinimumPrice; + export type NewPlanTieredPrice = API.NewPlanTieredPrice; + export type NewPlanTieredWithMinimumPrice = API.NewPlanTieredWithMinimumPrice; + export type NewPlanUnitPrice = API.NewPlanUnitPrice; + export type NewPlanUnitWithPercentPrice = API.NewPlanUnitWithPercentPrice; + export type NewPlanUnitWithProrationPrice = API.NewPlanUnitWithProrationPrice; + export type NewUsageDiscount = API.NewUsageDiscount; + export type OtherSubLineItem = API.OtherSubLineItem; + export type PackageConfig = API.PackageConfig; export type PaginationMetadata = API.PaginationMetadata; + export type PerPriceCost = API.PerPriceCost; export type PercentageDiscount = API.PercentageDiscount; + export type PercentageDiscountInterval = API.PercentageDiscountInterval; + export type PlanPhaseAmountDiscountAdjustment = API.PlanPhaseAmountDiscountAdjustment; + export type PlanPhaseMaximumAdjustment = API.PlanPhaseMaximumAdjustment; + export type PlanPhaseMinimumAdjustment = API.PlanPhaseMinimumAdjustment; + export type PlanPhasePercentageDiscountAdjustment = API.PlanPhasePercentageDiscountAdjustment; + export type PlanPhaseUsageDiscountAdjustment = API.PlanPhaseUsageDiscountAdjustment; + export type Price = API.Price; + export type PriceInterval = API.PriceInterval; + export type SubLineItemGrouping = API.SubLineItemGrouping; + export type SubLineItemMatrixConfig = API.SubLineItemMatrixConfig; + export type SubscriptionChangeMinified = API.SubscriptionChangeMinified; + export type SubscriptionMinified = API.SubscriptionMinified; + export type SubscriptionTrialInfo = API.SubscriptionTrialInfo; + export type TaxAmount = API.TaxAmount; + export type Tier = API.Tier; + export type TierConfig = API.TierConfig; + export type TierSubLineItem = API.TierSubLineItem; + export type TieredBPSConfig = API.TieredBPSConfig; + export type TieredConfig = API.TieredConfig; + export type TieredConversionRateConfig = API.TieredConversionRateConfig; + export type TransformPriceFilter = API.TransformPriceFilter; export type TrialDiscount = API.TrialDiscount; + export type UnitConfig = API.UnitConfig; + export type UnitConversionRateConfig = API.UnitConversionRateConfig; export type UsageDiscount = API.UsageDiscount; + export type UsageDiscountInterval = API.UsageDiscountInterval; } export { toFile, fileFromPath } from './uploads'; diff --git a/src/resources/alerts.ts b/src/resources/alerts.ts index c0df1076..20343056 100644 --- a/src/resources/alerts.ts +++ b/src/resources/alerts.ts @@ -3,6 +3,7 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; +import * as Shared from './shared'; import { Page, type PageParams } from '../pagination'; export class Alerts extends APIResource { @@ -187,7 +188,7 @@ export interface Alert { /** * The customer the alert applies to. */ - customer: Alert.Customer | null; + customer: Shared.CustomerMinified | null; /** * Whether the alert is enabled or disabled. @@ -207,13 +208,13 @@ export interface Alert { /** * The subscription the alert applies to. */ - subscription: Alert.Subscription | null; + subscription: Shared.SubscriptionMinified | null; /** * The thresholds that define the conditions under which the alert will be * triggered. */ - thresholds: Array | null; + thresholds: Array | null; /** * The type of alert. This must be a valid alert type. @@ -233,15 +234,6 @@ export interface Alert { } export namespace Alert { - /** - * The customer the alert applies to. - */ - export interface Customer { - id: string; - - external_customer_id: string | null; - } - /** * The metric the alert applies to. */ @@ -267,26 +259,6 @@ export namespace Alert { plan_version: string; } - /** - * The subscription the alert applies to. - */ - export interface Subscription { - id: string; - } - - /** - * Thresholds are used to define the conditions under which an alert will be - * triggered. - */ - export interface Threshold { - /** - * The value at which an alert will fire. For credit balance alerts, the alert will - * fire at or below this value. For usage and cost alerts, the alert will fire at - * or above this value. - */ - value: number; - } - /** * Alert status is used to determine if an alert is currently in-alert or not. */ @@ -303,26 +275,24 @@ export namespace Alert { } } -export interface AlertUpdateParams { +/** + * Thresholds are used to define the conditions under which an alert will be + * triggered. + */ +export interface Threshold { /** - * The thresholds that define the values at which the alert will be triggered. + * The value at which an alert will fire. For credit balance alerts, the alert will + * fire at or below this value. For usage and cost alerts, the alert will fire at + * or above this value. */ - thresholds: Array; + value: number; } -export namespace AlertUpdateParams { +export interface AlertUpdateParams { /** - * Thresholds are used to define the conditions under which an alert will be - * triggered. + * The thresholds that define the values at which the alert will be triggered. */ - export interface Threshold { - /** - * The value at which an alert will fire. For credit balance alerts, the alert will - * fire at or below this value. For usage and cost alerts, the alert will fire at - * or above this value. - */ - value: number; - } + thresholds: Array; } export interface AlertListParams extends PageParams { @@ -364,22 +334,7 @@ export interface AlertCreateForCustomerParams { /** * The thresholds that define the values at which the alert will be triggered. */ - thresholds?: Array | null; -} - -export namespace AlertCreateForCustomerParams { - /** - * Thresholds are used to define the conditions under which an alert will be - * triggered. - */ - export interface Threshold { - /** - * The value at which an alert will fire. For credit balance alerts, the alert will - * fire at or below this value. For usage and cost alerts, the alert will fire at - * or above this value. - */ - value: number; - } + thresholds?: Array | null; } export interface AlertCreateForExternalCustomerParams { @@ -396,29 +351,14 @@ export interface AlertCreateForExternalCustomerParams { /** * The thresholds that define the values at which the alert will be triggered. */ - thresholds?: Array | null; -} - -export namespace AlertCreateForExternalCustomerParams { - /** - * Thresholds are used to define the conditions under which an alert will be - * triggered. - */ - export interface Threshold { - /** - * The value at which an alert will fire. For credit balance alerts, the alert will - * fire at or below this value. For usage and cost alerts, the alert will fire at - * or above this value. - */ - value: number; - } + thresholds?: Array | null; } export interface AlertCreateForSubscriptionParams { /** * The thresholds that define the values at which the alert will be triggered. */ - thresholds: Array; + thresholds: Array; /** * The type of alert to create. This must be a valid alert type. @@ -431,21 +371,6 @@ export interface AlertCreateForSubscriptionParams { metric_id?: string | null; } -export namespace AlertCreateForSubscriptionParams { - /** - * Thresholds are used to define the conditions under which an alert will be - * triggered. - */ - export interface Threshold { - /** - * The value at which an alert will fire. For credit balance alerts, the alert will - * fire at or below this value. For usage and cost alerts, the alert will fire at - * or above this value. - */ - value: number; - } -} - export interface AlertDisableParams { /** * Used to update the status of a plan alert scoped to this subscription_id @@ -465,6 +390,7 @@ Alerts.AlertsPage = AlertsPage; export declare namespace Alerts { export { type Alert as Alert, + type Threshold as Threshold, AlertsPage as AlertsPage, type AlertUpdateParams as AlertUpdateParams, type AlertListParams as AlertListParams, diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 9d49fe4a..598b3cf8 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import * as Shared from '../shared'; import * as ExternalPlanIDAPI from './external-plan-id'; import { ExternalPlanID, @@ -9,7 +10,6 @@ import { ExternalPlanIDSetDefaultPlanVersionParams, } from './external-plan-id'; import * as PlansAPI from '../plans/plans'; -import * as PricesAPI from '../prices/prices'; export class Beta extends APIResource { externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client); @@ -68,11 +68,11 @@ export interface PlanVersion { * across all phases of the plan. */ adjustments: Array< - | PlanVersion.PlanPhaseUsageDiscountAdjustment - | PlanVersion.PlanPhaseAmountDiscountAdjustment - | PlanVersion.PlanPhasePercentageDiscountAdjustment - | PlanVersion.PlanPhaseMinimumAdjustment - | PlanVersion.PlanPhaseMaximumAdjustment + | Shared.PlanPhaseUsageDiscountAdjustment + | Shared.PlanPhaseAmountDiscountAdjustment + | Shared.PlanPhasePercentageDiscountAdjustment + | Shared.PlanPhaseMinimumAdjustment + | Shared.PlanPhaseMaximumAdjustment >; created_at: string; @@ -83,303 +83,11 @@ export interface PlanVersion { * Prices for this plan. If the plan has phases, this includes prices across all * phases of the plan. */ - prices: Array; + prices: Array; version: number; } -export namespace PlanVersion { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } -} - export interface PlanVersionPhase { id: string; @@ -449,11 +157,11 @@ export namespace BetaCreatePlanVersionParams { * The definition of a new adjustment to create and add to the plan. */ adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** * The phase to add this adjustment to. @@ -461,103 +169,11 @@ export namespace BetaCreatePlanVersionParams { plan_phase_order?: number | null; } - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - export interface AddPrice { /** * The allocation price to add to the plan. */ - allocation_price?: AddPrice.AllocationPrice | null; + allocation_price?: Shared.NewAllocationPrice | null; /** * The phase to add this price to. @@ -568,8516 +184,132 @@ export namespace BetaCreatePlanVersionParams { * The price to add to the plan */ price?: - | AddPrice.NewPlanUnitPrice - | AddPrice.NewPlanPackagePrice - | AddPrice.NewPlanMatrixPrice - | AddPrice.NewPlanTieredPrice - | AddPrice.NewPlanTieredBpsPrice - | AddPrice.NewPlanBpsPrice - | AddPrice.NewPlanBulkBpsPrice - | AddPrice.NewPlanBulkPrice - | AddPrice.NewPlanThresholdTotalAmountPrice - | AddPrice.NewPlanTieredPackagePrice - | AddPrice.NewPlanTieredWithMinimumPrice - | AddPrice.NewPlanUnitWithPercentPrice - | AddPrice.NewPlanPackageWithAllocationPrice - | AddPrice.NewPlanTierWithProrationPrice - | AddPrice.NewPlanUnitWithProrationPrice - | AddPrice.NewPlanGroupedAllocationPrice - | AddPrice.NewPlanGroupedWithProratedMinimumPrice - | AddPrice.NewPlanGroupedWithMeteredMinimumPrice - | AddPrice.NewPlanMatrixWithDisplayNamePrice - | AddPrice.NewPlanBulkWithProrationPrice - | AddPrice.NewPlanGroupedTieredPackagePrice - | AddPrice.NewPlanMaxGroupTieredPackagePrice - | AddPrice.NewPlanScalableMatrixWithUnitPricingPrice - | AddPrice.NewPlanScalableMatrixWithTieredPricingPrice - | AddPrice.NewPlanCumulativeGroupedBulkPrice - | AddPrice.NewPlanTieredPackageWithMinimumPrice - | AddPrice.NewPlanMatrixWithAllocationPrice - | AddPrice.NewPlanGroupedTieredPrice + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice | null; } - export namespace AddPrice { + export interface RemoveAdjustment { /** - * The allocation price to add to the plan. + * The id of the adjustment to remove from on the plan. */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewPlanUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewPlanPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewPlanMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; + adjustment_id: string; - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixPrice.BillingCycleConfiguration | null; + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: 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; - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } - /** - * An alias for the price. - */ - external_price_id?: string | null; + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; + /** + * The allocation price to add to the plan. + */ + allocation_price?: Shared.NewAllocationPrice | null; - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewPlanTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBpsPrice { - bps_config: NewPlanBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkBpsPrice { - bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkPrice { - bulk_config: NewPlanBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove from on the plan. - */ - adjustment_id: string; - - /** - * The phase to remove this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface RemovePrice { - /** - * The id of the price to remove from the plan. - */ - price_id: string; - - /** - * The phase to remove this price from. - */ - plan_phase_order?: number | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the plan. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the plan. - */ - replaces_adjustment_id: string; - - /** - * The phase to replace this adjustment from. - */ - plan_phase_order?: number | null; - } - - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the plan. - */ - replaces_price_id: string; - - /** - * The allocation price to add to the plan. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; - - /** - * The phase to replace this price from. - */ - plan_phase_order?: number | null; - - /** - * The price to add to the plan - */ - price?: - | ReplacePrice.NewPlanUnitPrice - | ReplacePrice.NewPlanPackagePrice - | ReplacePrice.NewPlanMatrixPrice - | ReplacePrice.NewPlanTieredPrice - | ReplacePrice.NewPlanTieredBpsPrice - | ReplacePrice.NewPlanBpsPrice - | ReplacePrice.NewPlanBulkBpsPrice - | ReplacePrice.NewPlanBulkPrice - | ReplacePrice.NewPlanThresholdTotalAmountPrice - | ReplacePrice.NewPlanTieredPackagePrice - | ReplacePrice.NewPlanTieredWithMinimumPrice - | ReplacePrice.NewPlanUnitWithPercentPrice - | ReplacePrice.NewPlanPackageWithAllocationPrice - | ReplacePrice.NewPlanTierWithProrationPrice - | ReplacePrice.NewPlanUnitWithProrationPrice - | ReplacePrice.NewPlanGroupedAllocationPrice - | ReplacePrice.NewPlanGroupedWithProratedMinimumPrice - | ReplacePrice.NewPlanGroupedWithMeteredMinimumPrice - | ReplacePrice.NewPlanMatrixWithDisplayNamePrice - | ReplacePrice.NewPlanBulkWithProrationPrice - | ReplacePrice.NewPlanGroupedTieredPackagePrice - | ReplacePrice.NewPlanMaxGroupTieredPackagePrice - | ReplacePrice.NewPlanScalableMatrixWithUnitPricingPrice - | ReplacePrice.NewPlanScalableMatrixWithTieredPricingPrice - | ReplacePrice.NewPlanCumulativeGroupedBulkPrice - | ReplacePrice.NewPlanTieredPackageWithMinimumPrice - | ReplacePrice.NewPlanMatrixWithAllocationPrice - | ReplacePrice.NewPlanGroupedTieredPrice - | null; - } - - export namespace ReplacePrice { - /** - * The allocation price to add to the plan. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewPlanUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewPlanPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewPlanMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewPlanTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBpsPrice { - bps_config: NewPlanBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkBpsPrice { - bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkPrice { - bulk_config: NewPlanBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } + /** + * The price to add to the plan + */ + price?: + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice + | null; } } diff --git a/src/resources/beta/external-plan-id.ts b/src/resources/beta/external-plan-id.ts index 9bd9e353..4eecbcec 100644 --- a/src/resources/beta/external-plan-id.ts +++ b/src/resources/beta/external-plan-id.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import * as Shared from '../shared'; import * as BetaAPI from './beta'; import * as PlansAPI from '../plans/plans'; @@ -101,11 +102,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { * The definition of a new adjustment to create and add to the plan. */ adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** * The phase to add this adjustment to. @@ -113,103 +114,11 @@ export namespace ExternalPlanIDCreatePlanVersionParams { plan_phase_order?: number | null; } - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - export interface AddPrice { /** * The allocation price to add to the plan. */ - allocation_price?: AddPrice.AllocationPrice | null; + allocation_price?: Shared.NewAllocationPrice | null; /** * The phase to add this price to. @@ -220,8516 +129,132 @@ export namespace ExternalPlanIDCreatePlanVersionParams { * The price to add to the plan */ price?: - | AddPrice.NewPlanUnitPrice - | AddPrice.NewPlanPackagePrice - | AddPrice.NewPlanMatrixPrice - | AddPrice.NewPlanTieredPrice - | AddPrice.NewPlanTieredBpsPrice - | AddPrice.NewPlanBpsPrice - | AddPrice.NewPlanBulkBpsPrice - | AddPrice.NewPlanBulkPrice - | AddPrice.NewPlanThresholdTotalAmountPrice - | AddPrice.NewPlanTieredPackagePrice - | AddPrice.NewPlanTieredWithMinimumPrice - | AddPrice.NewPlanUnitWithPercentPrice - | AddPrice.NewPlanPackageWithAllocationPrice - | AddPrice.NewPlanTierWithProrationPrice - | AddPrice.NewPlanUnitWithProrationPrice - | AddPrice.NewPlanGroupedAllocationPrice - | AddPrice.NewPlanGroupedWithProratedMinimumPrice - | AddPrice.NewPlanGroupedWithMeteredMinimumPrice - | AddPrice.NewPlanMatrixWithDisplayNamePrice - | AddPrice.NewPlanBulkWithProrationPrice - | AddPrice.NewPlanGroupedTieredPackagePrice - | AddPrice.NewPlanMaxGroupTieredPackagePrice - | AddPrice.NewPlanScalableMatrixWithUnitPricingPrice - | AddPrice.NewPlanScalableMatrixWithTieredPricingPrice - | AddPrice.NewPlanCumulativeGroupedBulkPrice - | AddPrice.NewPlanTieredPackageWithMinimumPrice - | AddPrice.NewPlanMatrixWithAllocationPrice - | AddPrice.NewPlanGroupedTieredPrice + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice | null; } - export namespace AddPrice { + export interface RemoveAdjustment { /** - * The allocation price to add to the plan. + * The id of the adjustment to remove from on the plan. */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewPlanUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewPlanPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewPlanMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewPlanTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBpsPrice { - bps_config: NewPlanBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkBpsPrice { - bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + adjustment_id: string; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } + /** + * The phase to remove this adjustment from. + */ + plan_phase_order?: number | null; + } - export interface NewPlanBulkPrice { - bulk_config: NewPlanBulkPrice.BulkConfig; + export interface RemovePrice { + /** + * The id of the price to remove from the plan. + */ + price_id: string; - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + /** + * The phase to remove this price from. + */ + plan_phase_order?: number | null; + } - /** - * The id of the item the price will be associated with. - */ - item_id: string; + 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; - model_type: 'bulk'; + /** + * The id of the adjustment on the plan to replace in the plan. + */ + replaces_adjustment_id: string; - /** - * The name of the price. - */ - name: string; + /** + * The phase to replace this adjustment from. + */ + plan_phase_order?: number | null; + } - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; + export interface ReplacePrice { + /** + * The id of the price on the plan to replace in the plan. + */ + replaces_price_id: string; - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; + /** + * The allocation price to add to the plan. + */ + allocation_price?: Shared.NewAllocationPrice | null; - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkPrice.BillingCycleConfiguration | null; + /** + * The phase to replace this price from. + */ + plan_phase_order?: number | null; - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove from on the plan. - */ - adjustment_id: string; - - /** - * The phase to remove this adjustment from. - */ - plan_phase_order?: number | null; - } - - export interface RemovePrice { - /** - * The id of the price to remove from the plan. - */ - price_id: string; - - /** - * The phase to remove this price from. - */ - plan_phase_order?: number | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the plan. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the plan. - */ - replaces_adjustment_id: string; - - /** - * The phase to replace this adjustment from. - */ - plan_phase_order?: number | null; - } - - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the plan. - */ - replaces_price_id: string; - - /** - * The allocation price to add to the plan. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; - - /** - * The phase to replace this price from. - */ - plan_phase_order?: number | null; - - /** - * The price to add to the plan - */ - price?: - | ReplacePrice.NewPlanUnitPrice - | ReplacePrice.NewPlanPackagePrice - | ReplacePrice.NewPlanMatrixPrice - | ReplacePrice.NewPlanTieredPrice - | ReplacePrice.NewPlanTieredBpsPrice - | ReplacePrice.NewPlanBpsPrice - | ReplacePrice.NewPlanBulkBpsPrice - | ReplacePrice.NewPlanBulkPrice - | ReplacePrice.NewPlanThresholdTotalAmountPrice - | ReplacePrice.NewPlanTieredPackagePrice - | ReplacePrice.NewPlanTieredWithMinimumPrice - | ReplacePrice.NewPlanUnitWithPercentPrice - | ReplacePrice.NewPlanPackageWithAllocationPrice - | ReplacePrice.NewPlanTierWithProrationPrice - | ReplacePrice.NewPlanUnitWithProrationPrice - | ReplacePrice.NewPlanGroupedAllocationPrice - | ReplacePrice.NewPlanGroupedWithProratedMinimumPrice - | ReplacePrice.NewPlanGroupedWithMeteredMinimumPrice - | ReplacePrice.NewPlanMatrixWithDisplayNamePrice - | ReplacePrice.NewPlanBulkWithProrationPrice - | ReplacePrice.NewPlanGroupedTieredPackagePrice - | ReplacePrice.NewPlanMaxGroupTieredPackagePrice - | ReplacePrice.NewPlanScalableMatrixWithUnitPricingPrice - | ReplacePrice.NewPlanScalableMatrixWithTieredPricingPrice - | ReplacePrice.NewPlanCumulativeGroupedBulkPrice - | ReplacePrice.NewPlanTieredPackageWithMinimumPrice - | ReplacePrice.NewPlanMatrixWithAllocationPrice - | ReplacePrice.NewPlanGroupedTieredPrice - | null; - } - - export namespace ReplacePrice { - /** - * The allocation price to add to the plan. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewPlanUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewPlanPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewPlanMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewPlanTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBpsPrice { - bps_config: NewPlanBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkBpsPrice { - bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkPrice { - bulk_config: NewPlanBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } + /** + * The price to add to the plan + */ + price?: + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice + | null; } } diff --git a/src/resources/credit-notes.ts b/src/resources/credit-notes.ts index 145c5cd0..bbbb2a17 100644 --- a/src/resources/credit-notes.ts +++ b/src/resources/credit-notes.ts @@ -3,14 +3,16 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import { Page, type PageParams } from '../pagination'; +import * as Shared from './shared'; +import { CreditNotesPage } from './shared'; +import { type PageParams } from '../pagination'; export class CreditNotes extends APIResource { /** * This endpoint is used to create a single * [`Credit Note`](/invoicing/credit-notes). */ - create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/credit_notes', { body, ...options }); } @@ -22,12 +24,12 @@ export class CreditNotes extends APIResource { list( query?: CreditNoteListParams, options?: Core.RequestOptions, - ): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: CreditNoteListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } @@ -38,218 +40,11 @@ export class CreditNotes extends APIResource { * This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) * given an identifier. */ - fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise { + fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/credit_notes/${creditNoteId}`, options); } } -export class CreditNotesPage extends Page {} - -/** - * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has - * been applied to a particular invoice. - */ -export interface CreditNote { - /** - * The Orb id of this credit note. - */ - id: string; - - /** - * The creation time of the resource in Orb. - */ - created_at: string; - - /** - * The unique identifier for credit notes. - */ - credit_note_number: string; - - /** - * A URL to a PDF of the credit note. - */ - credit_note_pdf: string | null; - - customer: CreditNote.Customer; - - /** - * The id of the invoice resource that this credit note is applied to. - */ - invoice_id: string; - - /** - * All of the line items associated with this credit note. - */ - line_items: Array; - - /** - * The maximum amount applied on the original invoice - */ - maximum_amount_adjustment: CreditNote.MaximumAmountAdjustment | null; - - /** - * An optional memo supplied on the credit note. - */ - memo: string | null; - - /** - * Any credited amount from the applied minimum on the invoice. - */ - minimum_amount_refunded: string | null; - - reason: 'Duplicate' | 'Fraudulent' | 'Order change' | 'Product unsatisfactory' | null; - - /** - * The total prior to any creditable invoice-level discounts or minimums. - */ - subtotal: string; - - /** - * The total including creditable invoice-level discounts or minimums, and tax. - */ - total: string; - - type: 'refund' | 'adjustment'; - - /** - * The time at which the credit note was voided in Orb, if applicable. - */ - voided_at: string | null; - - /** - * Any discounts applied on the original invoice. - */ - discounts?: Array; -} - -export namespace CreditNote { - export interface Customer { - id: string; - - external_customer_id: string | null; - } - - export interface LineItem { - /** - * The Orb id of this resource. - */ - id: string; - - /** - * The amount of the line item, including any line item minimums and discounts. - */ - amount: string; - - /** - * The id of the item associated with this line item. - */ - item_id: string; - - /** - * The name of the corresponding invoice line item. - */ - name: string; - - /** - * An optional quantity credited. - */ - quantity: number | null; - - /** - * The amount of the line item, excluding any line item minimums and discounts. - */ - subtotal: string; - - /** - * Any tax amounts applied onto the line item. - */ - tax_amounts: Array; - - /** - * Any line item discounts from the invoice's line item. - */ - discounts?: Array; - } - - export namespace LineItem { - export interface TaxAmount { - /** - * The amount of additional tax incurred by this tax rate. - */ - amount: string; - - /** - * The human-readable description of the applied tax rate. - */ - tax_rate_description: string; - - /** - * The tax rate percentage, out of 100. - */ - tax_rate_percentage: string | null; - } - - export interface Discount { - id: string; - - amount_applied: string; - - applies_to_price_ids: Array; - - discount_type: 'percentage' | 'amount'; - - percentage_discount: number; - - amount_discount?: string | null; - - reason?: string | null; - } - } - - /** - * The maximum amount applied on the original invoice - */ - export interface MaximumAmountAdjustment { - amount_applied: string; - - discount_type: 'percentage'; - - percentage_discount: number; - - applies_to_prices?: Array | null; - - reason?: string | null; - } - - export namespace MaximumAmountAdjustment { - export interface AppliesToPrice { - id: string; - - name: string; - } - } - - export interface Discount { - amount_applied: string; - - discount_type: 'percentage'; - - percentage_discount: number; - - applies_to_prices?: Array | null; - - reason?: string | null; - } - - export namespace Discount { - export interface AppliesToPrice { - id: string; - - name: string; - } - } -} - export interface CreditNoteCreateParams { line_items: Array; @@ -288,13 +83,11 @@ export interface CreditNoteListParams extends PageParams { 'created_at[lte]'?: string | null; } -CreditNotes.CreditNotesPage = CreditNotesPage; - export declare namespace CreditNotes { export { - type CreditNote as CreditNote, - CreditNotesPage as CreditNotesPage, type CreditNoteCreateParams as CreditNoteCreateParams, type CreditNoteListParams as CreditNoteListParams, }; } + +export { CreditNotesPage }; diff --git a/src/resources/customers/balance-transactions.ts b/src/resources/customers/balance-transactions.ts index 6ce16de1..aad7b8d7 100644 --- a/src/resources/customers/balance-transactions.ts +++ b/src/resources/customers/balance-transactions.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; +import * as Shared from '../shared'; import { Page, type PageParams } from '../../pagination'; export class BalanceTransactions extends APIResource { @@ -95,7 +96,7 @@ export interface BalanceTransactionCreateResponse { */ created_at: string; - credit_note: BalanceTransactionCreateResponse.CreditNote | null; + credit_note: Shared.CreditNoteTiny | null; /** * An optional description provided for manual customer balance adjustments. @@ -108,7 +109,7 @@ export interface BalanceTransactionCreateResponse { */ ending_balance: string; - invoice: BalanceTransactionCreateResponse.Invoice | null; + invoice: Shared.InvoiceTiny | null; /** * The original value of the customer's balance prior to the transaction, in the @@ -119,22 +120,6 @@ export interface BalanceTransactionCreateResponse { type: 'increment' | 'decrement'; } -export namespace BalanceTransactionCreateResponse { - export interface CreditNote { - /** - * The id of the Credit note - */ - id: string; - } - - export interface Invoice { - /** - * The Invoice id - */ - id: string; - } -} - export interface BalanceTransactionListResponse { /** * A unique id for this transaction. @@ -162,7 +147,7 @@ export interface BalanceTransactionListResponse { */ created_at: string; - credit_note: BalanceTransactionListResponse.CreditNote | null; + credit_note: Shared.CreditNoteTiny | null; /** * An optional description provided for manual customer balance adjustments. @@ -175,7 +160,7 @@ export interface BalanceTransactionListResponse { */ ending_balance: string; - invoice: BalanceTransactionListResponse.Invoice | null; + invoice: Shared.InvoiceTiny | null; /** * The original value of the customer's balance prior to the transaction, in the @@ -186,22 +171,6 @@ export interface BalanceTransactionListResponse { type: 'increment' | 'decrement'; } -export namespace BalanceTransactionListResponse { - export interface CreditNote { - /** - * The id of the Credit note - */ - id: string; - } - - export interface Invoice { - /** - * The Invoice id - */ - id: string; - } -} - export interface BalanceTransactionCreateParams { amount: string; diff --git a/src/resources/customers/costs.ts b/src/resources/customers/costs.ts index befee2f5..0ab9e1a0 100644 --- a/src/resources/customers/costs.ts +++ b/src/resources/customers/costs.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; -import * as PricesAPI from '../prices/prices'; +import * as Shared from '../shared'; export class Costs extends APIResource { /** @@ -286,109 +286,11 @@ export class Costs extends APIResource { } export interface CostListResponse { - data: Array; -} - -export namespace CostListResponse { - export interface Data { - per_price_costs: Array; - - /** - * Total costs for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; - - timeframe_end: string; - - timeframe_start: string; - - /** - * Total costs for the timeframe, including any minimums and discounts. - */ - total: string; - } - - export namespace Data { - export interface PerPriceCost { - /** - * The price object - */ - price: PricesAPI.Price; - - /** - * The price the cost is associated with - */ - price_id: string; - - /** - * Price's contributions for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; - - /** - * Price's contributions for the timeframe, including minimums and discounts. - */ - total: string; - - /** - * The price's quantity for the timeframe - */ - quantity?: number | null; - } - } + data: Array; } export interface CostListByExternalIDResponse { - data: Array; -} - -export namespace CostListByExternalIDResponse { - export interface Data { - per_price_costs: Array; - - /** - * Total costs for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; - - timeframe_end: string; - - timeframe_start: string; - - /** - * Total costs for the timeframe, including any minimums and discounts. - */ - total: string; - } - - export namespace Data { - export interface PerPriceCost { - /** - * The price object - */ - price: PricesAPI.Price; - - /** - * The price the cost is associated with - */ - price_id: string; - - /** - * Price's contributions for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; - - /** - * Price's contributions for the timeframe, including minimums and discounts. - */ - total: string; - - /** - * The price's quantity for the timeframe - */ - quantity?: number | null; - } - } + data: Array; } export interface CostListParams { diff --git a/src/resources/customers/credits/credits.ts b/src/resources/customers/credits/credits.ts index 0793fe92..fca6efd7 100644 --- a/src/resources/customers/credits/credits.ts +++ b/src/resources/customers/credits/credits.ts @@ -5,6 +5,12 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import * as LedgerAPI from './ledger'; import { + AffectedBlock, + AmendmentLedgerEntry, + CreditBlockExpiryLedgerEntry, + DecrementLedgerEntry, + ExpirationChangeLedgerEntry, + IncrementLedgerEntry, Ledger, LedgerCreateEntryByExternalIDParams, LedgerCreateEntryByExternalIDResponse, @@ -16,6 +22,8 @@ import { LedgerListParams, LedgerListResponse, LedgerListResponsesPage, + VoidInitiatedLedgerEntry, + VoidLedgerEntry, } from './ledger'; import * as TopUpsAPI from './top-ups'; import { @@ -23,6 +31,7 @@ import { TopUpCreateByExternalIDResponse, TopUpCreateParams, TopUpCreateResponse, + TopUpInvoiceSettings, TopUpListByExternalIDParams, TopUpListByExternalIDResponse, TopUpListByExternalIDResponsesPage, @@ -186,6 +195,14 @@ export declare namespace Credits { export { Ledger as Ledger, + type AffectedBlock as AffectedBlock, + type AmendmentLedgerEntry as AmendmentLedgerEntry, + type CreditBlockExpiryLedgerEntry as CreditBlockExpiryLedgerEntry, + type DecrementLedgerEntry as DecrementLedgerEntry, + type ExpirationChangeLedgerEntry as ExpirationChangeLedgerEntry, + type IncrementLedgerEntry as IncrementLedgerEntry, + type VoidInitiatedLedgerEntry as VoidInitiatedLedgerEntry, + type VoidLedgerEntry as VoidLedgerEntry, type LedgerListResponse as LedgerListResponse, type LedgerCreateEntryResponse as LedgerCreateEntryResponse, type LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, @@ -200,6 +217,7 @@ export declare namespace Credits { export { TopUps as TopUps, + type TopUpInvoiceSettings as TopUpInvoiceSettings, type TopUpCreateResponse as TopUpCreateResponse, type TopUpListResponse as TopUpListResponse, type TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse, diff --git a/src/resources/customers/credits/index.ts b/src/resources/customers/credits/index.ts index db8403ee..f4aeff5f 100644 --- a/src/resources/customers/credits/index.ts +++ b/src/resources/customers/credits/index.ts @@ -13,6 +13,14 @@ export { LedgerListResponsesPage, LedgerListByExternalIDResponsesPage, Ledger, + type AffectedBlock, + type AmendmentLedgerEntry, + type CreditBlockExpiryLedgerEntry, + type DecrementLedgerEntry, + type ExpirationChangeLedgerEntry, + type IncrementLedgerEntry, + type VoidInitiatedLedgerEntry, + type VoidLedgerEntry, type LedgerListResponse, type LedgerCreateEntryResponse, type LedgerCreateEntryByExternalIDResponse, @@ -26,6 +34,7 @@ export { TopUpListResponsesPage, TopUpListByExternalIDResponsesPage, TopUps, + type TopUpInvoiceSettings, type TopUpCreateResponse, type TopUpListResponse, type TopUpCreateByExternalIDResponse, diff --git a/src/resources/customers/credits/ledger.ts b/src/resources/customers/credits/ledger.ts index 7b8589f3..1a24ae4f 100644 --- a/src/resources/customers/credits/ledger.ts +++ b/src/resources/customers/credits/ledger.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as InvoicesAPI from '../../invoices'; +import * as Shared from '../../shared'; import { Page, type PageParams } from '../../../pagination'; export class Ledger extends APIResource { @@ -468,1557 +468,326 @@ export class LedgerListResponsesPage extends Page {} export class LedgerListByExternalIDResponsesPage extends Page {} -/** - * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid - * credits within Orb. - */ -export type LedgerListResponse = - | LedgerListResponse.IncrementLedgerEntry - | LedgerListResponse.DecrementLedgerEntry - | LedgerListResponse.ExpirationChangeLedgerEntry - | LedgerListResponse.CreditBlockExpiryLedgerEntry - | LedgerListResponse.VoidLedgerEntry - | LedgerListResponse.VoidInitiatedLedgerEntry - | LedgerListResponse.AmendmentLedgerEntry; - -export namespace LedgerListResponse { - export interface IncrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: IncrementLedgerEntry.CreditBlock; - - currency: string; - - customer: IncrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'increment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - /** - * If the increment resulted in invoice creation, the list of created invoices - */ - created_invoices?: Array | null; - } - - export namespace IncrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface DecrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: DecrementLedgerEntry.CreditBlock; - - currency: string; - - customer: DecrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'decrement'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; +export interface AffectedBlock { + id: string; - event_id?: string | null; + expiry_date: string | null; - invoice_id?: string | null; - - price_id?: string | null; - } + per_unit_cost_basis: string | null; +} - export namespace DecrementLedgerEntry { - export interface CreditBlock { - id: string; +export interface AmendmentLedgerEntry { + id: string; - expiry_date: string | null; + amount: number; - per_unit_cost_basis: string | null; - } + created_at: string; - export interface Customer { - id: string; + credit_block: AffectedBlock; - external_customer_id: string | null; - } - } + currency: string; - export interface ExpirationChangeLedgerEntry { - id: string; + customer: Shared.CustomerMinified; - amount: number; + description: string | null; - created_at: string; + ending_balance: number; - credit_block: ExpirationChangeLedgerEntry.CreditBlock; + entry_status: 'committed' | 'pending'; - currency: string; + entry_type: 'amendment'; - customer: ExpirationChangeLedgerEntry.Customer; + ledger_sequence_number: number; - description: 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: Record; - ending_balance: number; + starting_balance: number; +} - entry_status: 'committed' | 'pending'; +export interface CreditBlockExpiryLedgerEntry { + id: string; - entry_type: 'expiration_change'; + amount: number; - ledger_sequence_number: number; + created_at: string; - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; + credit_block: AffectedBlock; - new_block_expiry_date: string | null; + currency: string; - starting_balance: number; - } + customer: Shared.CustomerMinified; - export namespace ExpirationChangeLedgerEntry { - export interface CreditBlock { - id: string; + description: string | null; - expiry_date: string | null; + ending_balance: number; - per_unit_cost_basis: string | null; - } + entry_status: 'committed' | 'pending'; - export interface Customer { - id: string; + entry_type: 'credit_block_expiry'; - external_customer_id: string | null; - } - } + ledger_sequence_number: number; - export interface CreditBlockExpiryLedgerEntry { - id: string; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - amount: number; + starting_balance: number; +} - created_at: string; +export interface DecrementLedgerEntry { + id: string; - credit_block: CreditBlockExpiryLedgerEntry.CreditBlock; + amount: number; - currency: string; + created_at: string; - customer: CreditBlockExpiryLedgerEntry.Customer; + credit_block: AffectedBlock; - description: string | null; + currency: string; - ending_balance: number; + customer: Shared.CustomerMinified; - entry_status: 'committed' | 'pending'; + description: string | null; - entry_type: 'credit_block_expiry'; + ending_balance: number; - ledger_sequence_number: number; + entry_status: 'committed' | 'pending'; - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; + entry_type: 'decrement'; - starting_balance: number; - } + ledger_sequence_number: number; - export namespace CreditBlockExpiryLedgerEntry { - export interface CreditBlock { - id: string; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - expiry_date: string | null; + starting_balance: number; - per_unit_cost_basis: string | null; - } + event_id?: string | null; - export interface Customer { - id: string; + invoice_id?: string | null; - external_customer_id: string | null; - } - } + price_id?: string | null; +} - export interface VoidLedgerEntry { - id: string; +export interface ExpirationChangeLedgerEntry { + id: string; - amount: number; + amount: number; - created_at: string; + created_at: string; - credit_block: VoidLedgerEntry.CreditBlock; + credit_block: AffectedBlock; - currency: string; + currency: string; - customer: VoidLedgerEntry.Customer; + customer: Shared.CustomerMinified; - description: string | null; + description: string | null; - ending_balance: number; + ending_balance: number; - entry_status: 'committed' | 'pending'; + entry_status: 'committed' | 'pending'; - entry_type: 'void'; + entry_type: 'expiration_change'; - ledger_sequence_number: number; + ledger_sequence_number: number; - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - starting_balance: number; + new_block_expiry_date: string | null; - void_amount: number; + starting_balance: number; +} - void_reason: string | null; - } +export interface IncrementLedgerEntry { + id: string; - export namespace VoidLedgerEntry { - export interface CreditBlock { - id: string; + amount: number; - expiry_date: string | null; + created_at: string; - per_unit_cost_basis: string | null; - } + credit_block: AffectedBlock; - export interface Customer { - id: string; + currency: string; - external_customer_id: string | null; - } - } + customer: Shared.CustomerMinified; - export interface VoidInitiatedLedgerEntry { - id: string; + description: string | null; - amount: number; + ending_balance: number; - created_at: string; + entry_status: 'committed' | 'pending'; - credit_block: VoidInitiatedLedgerEntry.CreditBlock; + entry_type: 'increment'; - currency: string; + ledger_sequence_number: number; - customer: VoidInitiatedLedgerEntry.Customer; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - description: string | null; + starting_balance: number; - ending_balance: number; + /** + * If the increment resulted in invoice creation, the list of created invoices + */ + created_invoices?: Array | null; +} - entry_status: 'committed' | 'pending'; +export interface VoidInitiatedLedgerEntry { + id: string; - entry_type: 'void_initiated'; + amount: number; - ledger_sequence_number: number; + created_at: string; - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; + credit_block: AffectedBlock; - new_block_expiry_date: string; + currency: string; - starting_balance: number; + customer: Shared.CustomerMinified; - void_amount: number; + description: string | null; - void_reason: string | null; - } + ending_balance: number; - export namespace VoidInitiatedLedgerEntry { - export interface CreditBlock { - id: string; + entry_status: 'committed' | 'pending'; - expiry_date: string | null; + entry_type: 'void_initiated'; - per_unit_cost_basis: string | null; - } + ledger_sequence_number: number; - export interface Customer { - id: string; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - external_customer_id: string | null; - } - } + new_block_expiry_date: string; - export interface AmendmentLedgerEntry { - id: string; + starting_balance: number; - amount: number; + void_amount: number; - created_at: string; + void_reason: string | null; +} - credit_block: AmendmentLedgerEntry.CreditBlock; +export interface VoidLedgerEntry { + id: string; - currency: string; + amount: number; - customer: AmendmentLedgerEntry.Customer; + created_at: string; - description: string | null; + credit_block: AffectedBlock; - ending_balance: number; + currency: string; - entry_status: 'committed' | 'pending'; + customer: Shared.CustomerMinified; - entry_type: 'amendment'; + description: string | null; - ledger_sequence_number: number; + ending_balance: number; - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; + entry_status: 'committed' | 'pending'; - starting_balance: number; - } + entry_type: 'void'; - export namespace AmendmentLedgerEntry { - export interface CreditBlock { - id: string; + ledger_sequence_number: number; - expiry_date: 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: Record; - per_unit_cost_basis: string | null; - } + starting_balance: number; - export interface Customer { - id: string; + void_amount: number; - external_customer_id: string | null; - } - } + void_reason: string | null; } /** * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid * credits within Orb. */ -export type LedgerCreateEntryResponse = - | LedgerCreateEntryResponse.IncrementLedgerEntry - | LedgerCreateEntryResponse.DecrementLedgerEntry - | LedgerCreateEntryResponse.ExpirationChangeLedgerEntry - | LedgerCreateEntryResponse.CreditBlockExpiryLedgerEntry - | LedgerCreateEntryResponse.VoidLedgerEntry - | LedgerCreateEntryResponse.VoidInitiatedLedgerEntry - | LedgerCreateEntryResponse.AmendmentLedgerEntry; - -export namespace LedgerCreateEntryResponse { - export interface IncrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: IncrementLedgerEntry.CreditBlock; - - currency: string; - - customer: IncrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'increment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - /** - * If the increment resulted in invoice creation, the list of created invoices - */ - created_invoices?: Array | null; - } - - export namespace IncrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface DecrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: DecrementLedgerEntry.CreditBlock; - - currency: string; - - customer: DecrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'decrement'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - event_id?: string | null; - - invoice_id?: string | null; - - price_id?: string | null; - } - - export namespace DecrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface ExpirationChangeLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: ExpirationChangeLedgerEntry.CreditBlock; - - currency: string; - - customer: ExpirationChangeLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'expiration_change'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string | null; - - starting_balance: number; - } - - export namespace ExpirationChangeLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface CreditBlockExpiryLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: CreditBlockExpiryLedgerEntry.CreditBlock; - - currency: string; - - customer: CreditBlockExpiryLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'credit_block_expiry'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace CreditBlockExpiryLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - void_amount: number; +export type LedgerListResponse = + | IncrementLedgerEntry + | DecrementLedgerEntry + | ExpirationChangeLedgerEntry + | CreditBlockExpiryLedgerEntry + | VoidLedgerEntry + | VoidInitiatedLedgerEntry + | AmendmentLedgerEntry; - void_reason: string | null; - } +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + * credits within Orb. + */ +export type LedgerCreateEntryResponse = + | IncrementLedgerEntry + | DecrementLedgerEntry + | ExpirationChangeLedgerEntry + | CreditBlockExpiryLedgerEntry + | VoidLedgerEntry + | VoidInitiatedLedgerEntry + | AmendmentLedgerEntry; - export namespace VoidLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidInitiatedLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidInitiatedLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidInitiatedLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void_initiated'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string; - - starting_balance: number; - - void_amount: number; - - void_reason: string | null; - } - - export namespace VoidInitiatedLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface AmendmentLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: AmendmentLedgerEntry.CreditBlock; - - currency: string; - - customer: AmendmentLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'amendment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace AmendmentLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } -} - -/** - * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid - * credits within Orb. - */ -export type LedgerCreateEntryByExternalIDResponse = - | LedgerCreateEntryByExternalIDResponse.IncrementLedgerEntry - | LedgerCreateEntryByExternalIDResponse.DecrementLedgerEntry - | LedgerCreateEntryByExternalIDResponse.ExpirationChangeLedgerEntry - | LedgerCreateEntryByExternalIDResponse.CreditBlockExpiryLedgerEntry - | LedgerCreateEntryByExternalIDResponse.VoidLedgerEntry - | LedgerCreateEntryByExternalIDResponse.VoidInitiatedLedgerEntry - | LedgerCreateEntryByExternalIDResponse.AmendmentLedgerEntry; - -export namespace LedgerCreateEntryByExternalIDResponse { - export interface IncrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: IncrementLedgerEntry.CreditBlock; - - currency: string; - - customer: IncrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'increment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - /** - * If the increment resulted in invoice creation, the list of created invoices - */ - created_invoices?: Array | null; - } - - export namespace IncrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface DecrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: DecrementLedgerEntry.CreditBlock; - - currency: string; - - customer: DecrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'decrement'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - event_id?: string | null; - - invoice_id?: string | null; - - price_id?: string | null; - } - - export namespace DecrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface ExpirationChangeLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: ExpirationChangeLedgerEntry.CreditBlock; - - currency: string; - - customer: ExpirationChangeLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'expiration_change'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string | null; - - starting_balance: number; - } - - export namespace ExpirationChangeLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface CreditBlockExpiryLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: CreditBlockExpiryLedgerEntry.CreditBlock; - - currency: string; - - customer: CreditBlockExpiryLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'credit_block_expiry'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace CreditBlockExpiryLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - void_amount: number; - - void_reason: string | null; - } - - export namespace VoidLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidInitiatedLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidInitiatedLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidInitiatedLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void_initiated'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string; - - starting_balance: number; - - void_amount: number; - - void_reason: string | null; - } - - export namespace VoidInitiatedLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface AmendmentLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: AmendmentLedgerEntry.CreditBlock; - - currency: string; - - customer: AmendmentLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'amendment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace AmendmentLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } -} +/** + * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid + * credits within Orb. + */ +export type LedgerCreateEntryByExternalIDResponse = + | IncrementLedgerEntry + | DecrementLedgerEntry + | ExpirationChangeLedgerEntry + | CreditBlockExpiryLedgerEntry + | VoidLedgerEntry + | VoidInitiatedLedgerEntry + | AmendmentLedgerEntry; /** * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid * credits within Orb. */ export type LedgerListByExternalIDResponse = - | LedgerListByExternalIDResponse.IncrementLedgerEntry - | LedgerListByExternalIDResponse.DecrementLedgerEntry - | LedgerListByExternalIDResponse.ExpirationChangeLedgerEntry - | LedgerListByExternalIDResponse.CreditBlockExpiryLedgerEntry - | LedgerListByExternalIDResponse.VoidLedgerEntry - | LedgerListByExternalIDResponse.VoidInitiatedLedgerEntry - | LedgerListByExternalIDResponse.AmendmentLedgerEntry; - -export namespace LedgerListByExternalIDResponse { - export interface IncrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: IncrementLedgerEntry.CreditBlock; - - currency: string; - - customer: IncrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'increment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - /** - * If the increment resulted in invoice creation, the list of created invoices - */ - created_invoices?: Array | null; - } - - export namespace IncrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface DecrementLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: DecrementLedgerEntry.CreditBlock; - - currency: string; - - customer: DecrementLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'decrement'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - event_id?: string | null; - - invoice_id?: string | null; - - price_id?: string | null; - } - - export namespace DecrementLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface ExpirationChangeLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: ExpirationChangeLedgerEntry.CreditBlock; - - currency: string; - - customer: ExpirationChangeLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'expiration_change'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string | null; - - starting_balance: number; - } - - export namespace ExpirationChangeLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface CreditBlockExpiryLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: CreditBlockExpiryLedgerEntry.CreditBlock; - - currency: string; - - customer: CreditBlockExpiryLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'credit_block_expiry'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace CreditBlockExpiryLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - - void_amount: number; - - void_reason: string | null; - } - - export namespace VoidLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface VoidInitiatedLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: VoidInitiatedLedgerEntry.CreditBlock; - - currency: string; - - customer: VoidInitiatedLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'void_initiated'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - new_block_expiry_date: string; - - starting_balance: number; - - void_amount: number; - - void_reason: string | null; - } - - export namespace VoidInitiatedLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } - - export interface AmendmentLedgerEntry { - id: string; - - amount: number; - - created_at: string; - - credit_block: AmendmentLedgerEntry.CreditBlock; - - currency: string; - - customer: AmendmentLedgerEntry.Customer; - - description: string | null; - - ending_balance: number; - - entry_status: 'committed' | 'pending'; - - entry_type: 'amendment'; - - ledger_sequence_number: number; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - starting_balance: number; - } - - export namespace AmendmentLedgerEntry { - export interface CreditBlock { - id: string; - - expiry_date: string | null; - - per_unit_cost_basis: string | null; - } - - export interface Customer { - id: string; - - external_customer_id: string | null; - } - } -} + | IncrementLedgerEntry + | DecrementLedgerEntry + | ExpirationChangeLedgerEntry + | CreditBlockExpiryLedgerEntry + | VoidLedgerEntry + | VoidInitiatedLedgerEntry + | AmendmentLedgerEntry; export interface LedgerListParams extends PageParams { 'created_at[gt]'?: string | null; @@ -2585,6 +1354,14 @@ Ledger.LedgerListByExternalIDResponsesPage = LedgerListByExternalIDResponsesPage export declare namespace Ledger { export { + type AffectedBlock as AffectedBlock, + type AmendmentLedgerEntry as AmendmentLedgerEntry, + type CreditBlockExpiryLedgerEntry as CreditBlockExpiryLedgerEntry, + type DecrementLedgerEntry as DecrementLedgerEntry, + type ExpirationChangeLedgerEntry as ExpirationChangeLedgerEntry, + type IncrementLedgerEntry as IncrementLedgerEntry, + type VoidInitiatedLedgerEntry as VoidInitiatedLedgerEntry, + type VoidLedgerEntry as VoidLedgerEntry, type LedgerListResponse as LedgerListResponse, type LedgerCreateEntryResponse as LedgerCreateEntryResponse, type LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, diff --git a/src/resources/customers/credits/top-ups.ts b/src/resources/customers/credits/top-ups.ts index 3a2ebac5..e3f5db40 100644 --- a/src/resources/customers/credits/top-ups.ts +++ b/src/resources/customers/credits/top-ups.ts @@ -127,6 +127,34 @@ export class TopUpListResponsesPage extends Page {} export class TopUpListByExternalIDResponsesPage extends Page {} +export interface TopUpInvoiceSettings { + /** + * Whether the credits purchase invoice should auto collect with the customer's + * saved payment method. + */ + auto_collection: boolean; + + /** + * The net terms determines the difference between the invoice date and the issue + * date for the invoice. If you intend the invoice to be due on issue, set this + * to 0. + */ + net_terms: number; + + /** + * An optional memo to display on the invoice. + */ + memo?: string | null; + + /** + * When true, credit blocks created by this top-up will require that the + * corresponding invoice is paid before they are drawn down from. If any topup + * block is pending payment, further automatic top-ups will be paused until the + * invoice is paid or voided. + */ + require_successful_payment?: boolean; +} + export interface TopUpCreateResponse { id: string; @@ -144,7 +172,7 @@ export interface TopUpCreateResponse { /** * Settings for invoices generated by triggered top-ups. */ - invoice_settings: TopUpCreateResponse.InvoiceSettings; + invoice_settings: TopUpInvoiceSettings; /** * How much, in the customer's currency, to charge for each unit. @@ -169,39 +197,6 @@ export interface TopUpCreateResponse { expires_after_unit?: 'day' | 'month' | null; } -export namespace TopUpCreateResponse { - /** - * Settings for invoices generated by triggered top-ups. - */ - export interface InvoiceSettings { - /** - * Whether the credits purchase invoice should auto collect with the customer's - * saved payment method. - */ - auto_collection: boolean; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. - */ - net_terms: number; - - /** - * An optional memo to display on the invoice. - */ - memo?: string | null; - - /** - * When true, credit blocks created by this top-up will require that the - * corresponding invoice is paid before they are drawn down from. If any topup - * block is pending payment, further automatic top-ups will be paused until the - * invoice is paid or voided. - */ - require_successful_payment?: boolean; - } -} - export interface TopUpListResponse { id: string; @@ -219,7 +214,7 @@ export interface TopUpListResponse { /** * Settings for invoices generated by triggered top-ups. */ - invoice_settings: TopUpListResponse.InvoiceSettings; + invoice_settings: TopUpInvoiceSettings; /** * How much, in the customer's currency, to charge for each unit. @@ -244,39 +239,6 @@ export interface TopUpListResponse { expires_after_unit?: 'day' | 'month' | null; } -export namespace TopUpListResponse { - /** - * Settings for invoices generated by triggered top-ups. - */ - export interface InvoiceSettings { - /** - * Whether the credits purchase invoice should auto collect with the customer's - * saved payment method. - */ - auto_collection: boolean; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. - */ - net_terms: number; - - /** - * An optional memo to display on the invoice. - */ - memo?: string | null; - - /** - * When true, credit blocks created by this top-up will require that the - * corresponding invoice is paid before they are drawn down from. If any topup - * block is pending payment, further automatic top-ups will be paused until the - * invoice is paid or voided. - */ - require_successful_payment?: boolean; - } -} - export interface TopUpCreateByExternalIDResponse { id: string; @@ -294,7 +256,7 @@ export interface TopUpCreateByExternalIDResponse { /** * Settings for invoices generated by triggered top-ups. */ - invoice_settings: TopUpCreateByExternalIDResponse.InvoiceSettings; + invoice_settings: TopUpInvoiceSettings; /** * How much, in the customer's currency, to charge for each unit. @@ -319,39 +281,6 @@ export interface TopUpCreateByExternalIDResponse { expires_after_unit?: 'day' | 'month' | null; } -export namespace TopUpCreateByExternalIDResponse { - /** - * Settings for invoices generated by triggered top-ups. - */ - export interface InvoiceSettings { - /** - * Whether the credits purchase invoice should auto collect with the customer's - * saved payment method. - */ - auto_collection: boolean; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. - */ - net_terms: number; - - /** - * An optional memo to display on the invoice. - */ - memo?: string | null; - - /** - * When true, credit blocks created by this top-up will require that the - * corresponding invoice is paid before they are drawn down from. If any topup - * block is pending payment, further automatic top-ups will be paused until the - * invoice is paid or voided. - */ - require_successful_payment?: boolean; - } -} - export interface TopUpListByExternalIDResponse { id: string; @@ -369,7 +298,7 @@ export interface TopUpListByExternalIDResponse { /** * Settings for invoices generated by triggered top-ups. */ - invoice_settings: TopUpListByExternalIDResponse.InvoiceSettings; + invoice_settings: TopUpInvoiceSettings; /** * How much, in the customer's currency, to charge for each unit. @@ -394,39 +323,6 @@ export interface TopUpListByExternalIDResponse { expires_after_unit?: 'day' | 'month' | null; } -export namespace TopUpListByExternalIDResponse { - /** - * Settings for invoices generated by triggered top-ups. - */ - export interface InvoiceSettings { - /** - * Whether the credits purchase invoice should auto collect with the customer's - * saved payment method. - */ - auto_collection: boolean; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. - */ - net_terms: number; - - /** - * An optional memo to display on the invoice. - */ - memo?: string | null; - - /** - * When true, credit blocks created by this top-up will require that the - * corresponding invoice is paid before they are drawn down from. If any topup - * block is pending payment, further automatic top-ups will be paused until the - * invoice is paid or voided. - */ - require_successful_payment?: boolean; - } -} - export interface TopUpCreateParams { /** * The amount to increment when the threshold is reached. @@ -594,6 +490,7 @@ TopUps.TopUpListByExternalIDResponsesPage = TopUpListByExternalIDResponsesPage; export declare namespace TopUps { export { + type TopUpInvoiceSettings as TopUpInvoiceSettings, type TopUpCreateResponse as TopUpCreateResponse, type TopUpListResponse as TopUpListResponse, type TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse, diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index f6ab6570..8d6586a2 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; +import * as Shared from '../shared'; import * as BalanceTransactionsAPI from './balance-transactions'; import { BalanceTransactionCreateParams, @@ -185,6 +186,26 @@ export class Customers extends APIResource { export class CustomersPage extends Page {} +export interface AccountingProviderConfig { + external_provider_id: string; + + provider_type: string; +} + +export interface AddressInput { + city?: string | null; + + country?: string | null; + + line1?: string | null; + + line2?: string | null; + + postal_code?: string | null; + + state?: string | null; +} + /** * A customer is a buyer of your products, and the other party to the billing * relationship. @@ -217,7 +238,7 @@ export interface Customer { */ balance: string; - billing_address: Customer.BillingAddress | null; + billing_address: Shared.Address | null; created_at: string; @@ -274,7 +295,7 @@ export interface Customer { portal_url: string | null; - shipping_address: Customer.ShippingAddress | null; + shipping_address: Shared.Address | null; /** * Tax IDs are commonly required to be displayed on customer invoices, which are @@ -383,7 +404,7 @@ export interface Customer { * | Venezuela | `ve_rif` | Venezuelan RIF Number | * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | */ - tax_id: Customer.TaxID | null; + tax_id: Shared.CustomerTaxID | null; /** * A timezone identifier from the IANA timezone database, such as @@ -398,319 +419,13 @@ export interface Customer { } export namespace Customer { - export interface BillingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; - - state: string | null; - } - /** * The hierarchical relationships for this customer. */ export interface Hierarchy { - children: Array; - - parent: Hierarchy.Parent | null; - } - - export namespace Hierarchy { - export interface Child { - id: string; - - external_customer_id: string | null; - } - - export interface Parent { - id: string; - - external_customer_id: string | null; - } - } - - export interface ShippingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; - - state: string | null; - } + children: 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 | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - export interface TaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; + parent: Shared.CustomerMinified | null; } export interface AccountingSyncConfiguration { @@ -732,6 +447,50 @@ export namespace Customer { } } +export interface CustomerHierarchyConfig { + /** + * A list of child customer IDs to add to the hierarchy. The desired child + * customers must not already be part of another hierarchy. + */ + child_customer_ids?: Array; + + /** + * The ID of the parent customer in the hierarchy. The desired parent customer must + * not be a child of another customer. + */ + parent_customer_id?: string | null; +} + +export interface NewAccountingSyncConfiguration { + accounting_providers?: Array | null; + + excluded?: boolean | null; +} + +export interface NewAvalaraTaxConfiguration { + tax_exempt: boolean; + + tax_provider: 'avalara'; + + tax_exemption_code?: string | null; +} + +export interface NewReportingConfiguration { + exempt: boolean; +} + +export interface NewSphereConfiguration { + tax_exempt: boolean; + + tax_provider: 'sphere'; +} + +export interface NewTaxJarConfiguration { + tax_exempt: boolean; + + tax_provider: 'taxjar'; +} + export interface CustomerCreateParams { /** * A valid customer email, to be used for notifications. When Orb triggers payment @@ -745,7 +504,7 @@ export interface CustomerCreateParams { */ name: string; - accounting_sync_configuration?: CustomerCreateParams.AccountingSyncConfiguration | null; + accounting_sync_configuration?: NewAccountingSyncConfiguration | null; /** * Additional email addresses for this customer. If populated, these email @@ -760,7 +519,7 @@ export interface CustomerCreateParams { */ auto_collection?: boolean | null; - billing_address?: CustomerCreateParams.BillingAddress | null; + billing_address?: AddressInput | null; /** * An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -780,7 +539,7 @@ export interface CustomerCreateParams { /** * The hierarchical relationships for this customer. */ - hierarchy?: CustomerCreateParams.Hierarchy | null; + hierarchy?: CustomerHierarchyConfig | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -802,15 +561,11 @@ export interface CustomerCreateParams { */ payment_provider_id?: string | null; - reporting_configuration?: CustomerCreateParams.ReportingConfiguration | null; + reporting_configuration?: NewReportingConfiguration | null; - shipping_address?: CustomerCreateParams.ShippingAddress | null; + shipping_address?: AddressInput | null; - tax_configuration?: - | CustomerCreateParams.NewAvalaraTaxConfiguration - | CustomerCreateParams.NewTaxJarConfiguration - | CustomerCreateParams.NewSphereConfiguration - | null; + tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null; /** * Tax IDs are commonly required to be displayed on customer invoices, which are @@ -919,7 +674,7 @@ export interface CustomerCreateParams { * | Venezuela | `ve_rif` | Venezuelan RIF Number | * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | */ - tax_id?: CustomerCreateParams.TaxID | null; + tax_id?: Shared.CustomerTaxID | null; /** * A timezone identifier from the IANA timezone database, such as @@ -929,89 +684,82 @@ export interface CustomerCreateParams { timezone?: string | null; } -export namespace CustomerCreateParams { - export interface AccountingSyncConfiguration { - accounting_providers?: Array | null; - - excluded?: boolean | null; - } - - export namespace AccountingSyncConfiguration { - export interface AccountingProvider { - external_provider_id: string; +export interface CustomerUpdateParams { + accounting_sync_configuration?: NewAccountingSyncConfiguration | null; - provider_type: string; - } - } + /** + * Additional email addresses for this customer. If populated, these email + * addresses will be CC'd for customer communications. + */ + additional_emails?: Array | null; - export interface BillingAddress { - city?: string | null; + /** + * Used to determine if invoices for this customer will automatically attempt to + * charge a saved payment method, if available. This parameter defaults to `True` + * when a payment provider is provided on customer creation. + */ + auto_collection?: boolean | null; - country?: string | null; + billing_address?: AddressInput | null; - line1?: string | 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. + */ + currency?: string | null; - line2?: string | null; + /** + * A valid customer email, to be used for invoicing and notifications. + */ + email?: string | null; - postal_code?: string | null; + email_delivery?: boolean | null; - state?: string | null; - } + /** + * The external customer ID. This can only be set if empty and the customer has no + * past or current subscriptions. + */ + external_customer_id?: string | null; /** * The hierarchical relationships for this customer. */ - export interface Hierarchy { - /** - * A list of child customer IDs to add to the hierarchy. The desired child - * customers must not already be part of another hierarchy. - */ - child_customer_ids?: Array; - - /** - * The ID of the parent customer in the hierarchy. The desired parent customer must - * not be a child of another customer. - */ - parent_customer_id?: string | null; - } - - export interface ReportingConfiguration { - exempt: boolean; - } - - export interface ShippingAddress { - city?: string | null; - - country?: string | null; - - line1?: string | null; - - line2?: string | null; + hierarchy?: CustomerHierarchyConfig | null; - postal_code?: string | null; - - state?: string | null; - } - - export interface NewAvalaraTaxConfiguration { - tax_exempt: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - tax_provider: 'avalara'; + /** + * The full name of the customer + */ + name?: string | null; - tax_exemption_code?: string | null; - } + /** + * This is used for creating charges or invoices in an external system via Orb. + * When not in test mode: + * + * - the connection must first be configured in the Orb webapp. + * - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, + * `bill.com`, `netsuite`), any product mappings must first be configured with + * the Orb team. + */ + payment_provider?: 'quickbooks' | 'bill.com' | 'stripe_charge' | 'stripe_invoice' | 'netsuite' | null; - export interface NewTaxJarConfiguration { - tax_exempt: boolean; + /** + * The ID of this customer in an external payments solution, such as Stripe. This + * is used for creating charges or invoices in the external system via Orb. + */ + payment_provider_id?: string | null; - tax_provider: 'taxjar'; - } + reporting_configuration?: NewReportingConfiguration | null; - export interface NewSphereConfiguration { - tax_exempt: boolean; + shipping_address?: AddressInput | null; - tax_provider: 'sphere'; - } + tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null; /** * Tax IDs are commonly required to be displayed on customer invoices, which are @@ -1120,166 +868,21 @@ export namespace CustomerCreateParams { * | Venezuela | `ve_rif` | Venezuelan RIF Number | * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | */ - export interface TaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; - } + tax_id?: Shared.CustomerTaxID | null; } -export interface CustomerUpdateParams { - accounting_sync_configuration?: CustomerUpdateParams.AccountingSyncConfiguration | null; +export interface CustomerListParams extends PageParams { + 'created_at[gt]'?: string | null; + + 'created_at[gte]'?: string | null; + + 'created_at[lt]'?: string | null; + + 'created_at[lte]'?: string | null; +} + +export interface CustomerUpdateByExternalIDParams { + accounting_sync_configuration?: NewAccountingSyncConfiguration | null; /** * Additional email addresses for this customer. If populated, these email @@ -1294,7 +897,7 @@ export interface CustomerUpdateParams { */ auto_collection?: boolean | null; - billing_address?: CustomerUpdateParams.BillingAddress | null; + billing_address?: AddressInput | null; /** * An ISO 4217 currency string used for the customer's invoices and balance. If not @@ -1318,7 +921,7 @@ export interface CustomerUpdateParams { /** * The hierarchical relationships for this customer. */ - hierarchy?: CustomerUpdateParams.Hierarchy | null; + hierarchy?: CustomerHierarchyConfig | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -1349,15 +952,11 @@ export interface CustomerUpdateParams { */ payment_provider_id?: string | null; - reporting_configuration?: CustomerUpdateParams.ReportingConfiguration | null; + reporting_configuration?: NewReportingConfiguration | null; - shipping_address?: CustomerUpdateParams.ShippingAddress | null; + shipping_address?: AddressInput | null; - tax_configuration?: - | CustomerUpdateParams.NewAvalaraTaxConfiguration - | CustomerUpdateParams.NewTaxJarConfiguration - | CustomerUpdateParams.NewSphereConfiguration - | null; + tax_configuration?: NewAvalaraTaxConfiguration | NewTaxJarConfiguration | NewSphereConfiguration | null; /** * Tax IDs are commonly required to be displayed on customer invoices, which are @@ -1466,906 +1065,7 @@ export interface CustomerUpdateParams { * | Venezuela | `ve_rif` | Venezuelan RIF Number | * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | */ - tax_id?: CustomerUpdateParams.TaxID | null; -} - -export namespace CustomerUpdateParams { - export interface AccountingSyncConfiguration { - accounting_providers?: Array | null; - - excluded?: boolean | null; - } - - export namespace AccountingSyncConfiguration { - export interface AccountingProvider { - external_provider_id: string; - - provider_type: string; - } - } - - export interface BillingAddress { - city?: string | null; - - country?: string | null; - - line1?: string | null; - - line2?: string | null; - - postal_code?: string | null; - - state?: string | null; - } - - /** - * The hierarchical relationships for this customer. - */ - export interface Hierarchy { - /** - * A list of child customer IDs to add to the hierarchy. The desired child - * customers must not already be part of another hierarchy. - */ - child_customer_ids?: Array; - - /** - * The ID of the parent customer in the hierarchy. The desired parent customer must - * not be a child of another customer. - */ - parent_customer_id?: string | null; - } - - export interface ReportingConfiguration { - exempt: boolean; - } - - export interface ShippingAddress { - city?: string | null; - - country?: string | null; - - line1?: string | null; - - line2?: string | null; - - postal_code?: string | null; - - state?: string | null; - } - - export interface NewAvalaraTaxConfiguration { - tax_exempt: boolean; - - tax_provider: 'avalara'; - - tax_exemption_code?: string | null; - } - - export interface NewTaxJarConfiguration { - tax_exempt: boolean; - - tax_provider: 'taxjar'; - } - - export interface NewSphereConfiguration { - tax_exempt: boolean; - - tax_provider: 'sphere'; - } - - /** - * Tax IDs are commonly required to be displayed on customer invoices, which are - * added to the headers of invoices. - * - * ### Supported Tax ID Countries and Types - * - * | Country | Type | Description | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - export interface TaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; - } -} - -export interface CustomerListParams extends PageParams { - 'created_at[gt]'?: string | null; - - 'created_at[gte]'?: string | null; - - 'created_at[lt]'?: string | null; - - 'created_at[lte]'?: string | null; -} - -export interface CustomerUpdateByExternalIDParams { - accounting_sync_configuration?: CustomerUpdateByExternalIDParams.AccountingSyncConfiguration | null; - - /** - * Additional email addresses for this customer. If populated, these email - * addresses will be CC'd for customer communications. - */ - additional_emails?: Array | null; - - /** - * Used to determine if invoices for this customer will automatically attempt to - * charge a saved payment method, if available. This parameter defaults to `True` - * when a payment provider is provided on customer creation. - */ - auto_collection?: boolean | null; - - billing_address?: CustomerUpdateByExternalIDParams.BillingAddress | 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. - */ - currency?: string | null; - - /** - * A valid customer email, to be used for invoicing and notifications. - */ - email?: string | null; - - email_delivery?: boolean | null; - - /** - * The external customer ID. This can only be set if empty and the customer has no - * past or current subscriptions. - */ - external_customer_id?: string | null; - - /** - * The hierarchical relationships for this customer. - */ - hierarchy?: CustomerUpdateByExternalIDParams.Hierarchy | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * The full name of the customer - */ - name?: string | null; - - /** - * This is used for creating charges or invoices in an external system via Orb. - * When not in test mode: - * - * - the connection must first be configured in the Orb webapp. - * - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, - * `bill.com`, `netsuite`), any product mappings must first be configured with - * the Orb team. - */ - payment_provider?: 'quickbooks' | 'bill.com' | 'stripe_charge' | 'stripe_invoice' | 'netsuite' | null; - - /** - * The ID of this customer in an external payments solution, such as Stripe. This - * is used for creating charges or invoices in the external system via Orb. - */ - payment_provider_id?: string | null; - - reporting_configuration?: CustomerUpdateByExternalIDParams.ReportingConfiguration | null; - - shipping_address?: CustomerUpdateByExternalIDParams.ShippingAddress | null; - - tax_configuration?: - | CustomerUpdateByExternalIDParams.NewAvalaraTaxConfiguration - | CustomerUpdateByExternalIDParams.NewTaxJarConfiguration - | CustomerUpdateByExternalIDParams.NewSphereConfiguration - | null; - - /** - * 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 | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - tax_id?: CustomerUpdateByExternalIDParams.TaxID | null; -} - -export namespace CustomerUpdateByExternalIDParams { - export interface AccountingSyncConfiguration { - accounting_providers?: Array | null; - - excluded?: boolean | null; - } - - export namespace AccountingSyncConfiguration { - export interface AccountingProvider { - external_provider_id: string; - - provider_type: string; - } - } - - export interface BillingAddress { - city?: string | null; - - country?: string | null; - - line1?: string | null; - - line2?: string | null; - - postal_code?: string | null; - - state?: string | null; - } - - /** - * The hierarchical relationships for this customer. - */ - export interface Hierarchy { - /** - * A list of child customer IDs to add to the hierarchy. The desired child - * customers must not already be part of another hierarchy. - */ - child_customer_ids?: Array; - - /** - * The ID of the parent customer in the hierarchy. The desired parent customer must - * not be a child of another customer. - */ - parent_customer_id?: string | null; - } - - export interface ReportingConfiguration { - exempt: boolean; - } - - export interface ShippingAddress { - city?: string | null; - - country?: string | null; - - line1?: string | null; - - line2?: string | null; - - postal_code?: string | null; - - state?: string | null; - } - - export interface NewAvalaraTaxConfiguration { - tax_exempt: boolean; - - tax_provider: 'avalara'; - - tax_exemption_code?: string | null; - } - - export interface NewTaxJarConfiguration { - tax_exempt: boolean; - - tax_provider: 'taxjar'; - } - - export interface NewSphereConfiguration { - tax_exempt: boolean; - - tax_provider: 'sphere'; - } - - /** - * Tax IDs are commonly required to be displayed on customer invoices, which are - * added to the headers of invoices. - * - * ### Supported Tax ID Countries and Types - * - * | Country | Type | Description | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - export interface TaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; - } + tax_id?: Shared.CustomerTaxID | null; } Customers.CustomersPage = CustomersPage; @@ -2378,7 +1078,15 @@ Customers.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesP export declare namespace Customers { export { + type AccountingProviderConfig as AccountingProviderConfig, + type AddressInput as AddressInput, type Customer as Customer, + type CustomerHierarchyConfig as CustomerHierarchyConfig, + type NewAccountingSyncConfiguration as NewAccountingSyncConfiguration, + type NewAvalaraTaxConfiguration as NewAvalaraTaxConfiguration, + type NewReportingConfiguration as NewReportingConfiguration, + type NewSphereConfiguration as NewSphereConfiguration, + type NewTaxJarConfiguration as NewTaxJarConfiguration, CustomersPage as CustomersPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, diff --git a/src/resources/customers/index.ts b/src/resources/customers/index.ts index 123c9dd4..4690ab71 100644 --- a/src/resources/customers/index.ts +++ b/src/resources/customers/index.ts @@ -27,7 +27,15 @@ export { export { CustomersPage, Customers, + type AccountingProviderConfig, + type AddressInput, type Customer, + type CustomerHierarchyConfig, + type NewAccountingSyncConfiguration, + type NewAvalaraTaxConfiguration, + type NewReportingConfiguration, + type NewSphereConfiguration, + type NewTaxJarConfiguration, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, diff --git a/src/resources/index.ts b/src/resources/index.ts index c3dbd011..5b70dbee 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -5,6 +5,7 @@ export { AlertsPage, Alerts, type Alert, + type Threshold, type AlertUpdateParams, type AlertListParams, type AlertCreateForCustomerParams, @@ -35,17 +36,19 @@ export { type CouponCreateParams, type CouponListParams, } from './coupons/coupons'; -export { - CreditNotesPage, - CreditNotes, - type CreditNote, - type CreditNoteCreateParams, - type CreditNoteListParams, -} from './credit-notes'; +export { CreditNotes, type CreditNoteCreateParams, type CreditNoteListParams } from './credit-notes'; export { CustomersPage, Customers, + type AccountingProviderConfig, + type AddressInput, type Customer, + type CustomerHierarchyConfig, + type NewAccountingSyncConfiguration, + type NewAvalaraTaxConfiguration, + type NewReportingConfiguration, + type NewSphereConfiguration, + type NewTaxJarConfiguration, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, @@ -74,9 +77,7 @@ export { type InvoiceLineItemCreateParams, } from './invoice-line-items'; export { - InvoicesPage, Invoices, - type Invoice, type InvoiceFetchUpcomingResponse, type InvoiceCreateParams, type InvoiceUpdateParams, @@ -102,20 +103,21 @@ export { type PlanListParams, } from './plans/plans'; export { - PricesPage, Prices, type EvaluatePriceGroup, - type Price, type PriceEvaluateResponse, type PriceEvaluateMultipleResponse, + type PriceEvaluatePreviewEventsResponse, type PriceCreateParams, type PriceUpdateParams, type PriceListParams, type PriceEvaluateParams, type PriceEvaluateMultipleParams, + type PriceEvaluatePreviewEventsParams, } from './prices/prices'; export { SubscriptionChanges, + type MutatedSubscription, type SubscriptionChangeRetrieveResponse, type SubscriptionChangeApplyResponse, type SubscriptionChangeCancelResponse, @@ -125,21 +127,39 @@ export { SubscriptionsPage, SubscriptionFetchScheduleResponsesPage, Subscriptions, + type DiscountOverride, + type NewSubscriptionBPSPrice, + type NewSubscriptionBulkBPSPrice, + type NewSubscriptionBulkPrice, + type NewSubscriptionBulkWithProrationPrice, + type NewSubscriptionCumulativeGroupedBulkPrice, + type NewSubscriptionGroupedAllocationPrice, + type NewSubscriptionGroupedTieredPackagePrice, + type NewSubscriptionGroupedTieredPrice, + type NewSubscriptionGroupedWithMeteredMinimumPrice, + type NewSubscriptionGroupedWithProratedMinimumPrice, + type NewSubscriptionMatrixPrice, + type NewSubscriptionMatrixWithAllocationPrice, + type NewSubscriptionMatrixWithDisplayNamePrice, + type NewSubscriptionMaxGroupTieredPackagePrice, + type NewSubscriptionPackagePrice, + type NewSubscriptionPackageWithAllocationPrice, + type NewSubscriptionScalableMatrixWithTieredPricingPrice, + type NewSubscriptionScalableMatrixWithUnitPricingPrice, + type NewSubscriptionThresholdTotalAmountPrice, + type NewSubscriptionTierWithProrationPrice, + type NewSubscriptionTieredBPSPrice, + type NewSubscriptionTieredPackagePrice, + type NewSubscriptionTieredPackageWithMinimumPrice, + type NewSubscriptionTieredPrice, + type NewSubscriptionTieredWithMinimumPrice, + type NewSubscriptionUnitPrice, + type NewSubscriptionUnitWithPercentPrice, + type NewSubscriptionUnitWithProrationPrice, type Subscription, type SubscriptionUsage, - type SubscriptionCreateResponse, - type SubscriptionCancelResponse, type SubscriptionFetchCostsResponse, type SubscriptionFetchScheduleResponse, - type SubscriptionPriceIntervalsResponse, - type SubscriptionRedeemCouponResponse, - type SubscriptionSchedulePlanChangeResponse, - type SubscriptionTriggerPhaseResponse, - type SubscriptionUnscheduleCancellationResponse, - type SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, - type SubscriptionUnschedulePendingPlanChangesResponse, - type SubscriptionUpdateFixedFeeQuantityResponse, - type SubscriptionUpdateTrialResponse, type SubscriptionCreateParams, type SubscriptionUpdateParams, type SubscriptionListParams, diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index 9d34eec3..6d0f452c 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -3,7 +3,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; import * as Shared from './shared'; -import * as PricesAPI from './prices/prices'; export class InvoiceLineItems extends APIResource { /** @@ -36,11 +35,11 @@ export interface InvoiceLineItemCreateResponse { * discounts -> minimums -> maximums). */ adjustments: Array< - | InvoiceLineItemCreateResponse.MonetaryUsageDiscountAdjustment - | InvoiceLineItemCreateResponse.MonetaryAmountDiscountAdjustment - | InvoiceLineItemCreateResponse.MonetaryPercentageDiscountAdjustment - | InvoiceLineItemCreateResponse.MonetaryMinimumAdjustment - | InvoiceLineItemCreateResponse.MonetaryMaximumAdjustment + | Shared.MonetaryUsageDiscountAdjustment + | Shared.MonetaryAmountDiscountAdjustment + | Shared.MonetaryPercentageDiscountAdjustment + | Shared.MonetaryMinimumAdjustment + | Shared.MonetaryMaximumAdjustment >; /** @@ -76,7 +75,7 @@ export interface InvoiceLineItemCreateResponse { /** * @deprecated This field is deprecated in favor of `adjustments`. */ - maximum: InvoiceLineItemCreateResponse.Maximum | null; + maximum: Shared.Maximum | null; /** * @deprecated This field is deprecated in favor of `adjustments`. @@ -86,7 +85,7 @@ export interface InvoiceLineItemCreateResponse { /** * @deprecated This field is deprecated in favor of `adjustments`. */ - minimum: InvoiceLineItemCreateResponse.Minimum | null; + minimum: Shared.Minimum | null; /** * @deprecated This field is deprecated in favor of `adjustments`. @@ -115,7 +114,7 @@ export interface InvoiceLineItemCreateResponse { * For more on the types of prices, see * [the core concepts documentation](/core-concepts#plan-and-price) */ - price: PricesAPI.Price; + price: Shared.Price; /** * Either the fixed fee quantity or the usage during the service period. @@ -131,11 +130,7 @@ export interface InvoiceLineItemCreateResponse { * For complex pricing structures, the line item can be broken down further in * `sub_line_items`. */ - sub_line_items: Array< - | InvoiceLineItemCreateResponse.MatrixSubLineItem - | InvoiceLineItemCreateResponse.TierSubLineItem - | InvoiceLineItemCreateResponse.OtherSubLineItem - >; + sub_line_items: Array; /** * The line amount before before any adjustments. @@ -146,7 +141,7 @@ export interface InvoiceLineItemCreateResponse { * An array of tax rates and their incurred tax amounts. Empty if no tax * integration is configured. */ - tax_amounts: Array; + tax_amounts: Array; /** * A list of customer ids that were used to calculate the usage for this line item. @@ -154,492 +149,6 @@ export interface InvoiceLineItemCreateResponse { usage_customer_ids: Array | null; } -export namespace InvoiceLineItemCreateResponse { - export interface MonetaryUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace MonetaryUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryPercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryPercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MatrixSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: MatrixSubLineItem.Grouping | null; - - matrix_config: MatrixSubLineItem.MatrixConfig; - - name: string; - - quantity: number; - - type: 'matrix'; - } - - export namespace MatrixSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface MatrixConfig { - /** - * The ordered dimension values for this line item. - */ - dimension_values: Array; - } - } - - export interface TierSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: TierSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - tier_config: TierSubLineItem.TierConfig; - - type: 'tier'; - } - - export namespace TierSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface TierConfig { - first_unit: number; - - last_unit: number | null; - - unit_amount: string; - } - } - - export interface OtherSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: OtherSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - type: "'null'"; - } - - export namespace OtherSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - } - - export interface TaxAmount { - /** - * The amount of additional tax incurred by this tax rate. - */ - amount: string; - - /** - * The human-readable description of the applied tax rate. - */ - tax_rate_description: string; - - /** - * The tax rate percentage, out of 100. - */ - tax_rate_percentage: string | null; - } -} - export interface InvoiceLineItemCreateParams { /** * The total amount in the invoice's currency to add to the line item. diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index 822101c5..e1c83dfd 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -4,14 +4,14 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; import * as Shared from './shared'; -import * as PricesAPI from './prices/prices'; -import { Page, type PageParams } from '../pagination'; +import { InvoicesPage } from './shared'; +import { type PageParams } from '../pagination'; export class Invoices extends APIResource { /** * This endpoint is used to create a one-off invoice for a customer. */ - create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/invoices', { body, ...options }); } @@ -26,7 +26,7 @@ export class Invoices extends APIResource { invoiceId: string, body: InvoiceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.put(`/invoices/${invoiceId}`, { body, ...options }); } @@ -45,12 +45,15 @@ export class Invoices extends APIResource { * values for each draft invoice, which may not always be up-to-date since Orb * regularly refreshes invoices asynchronously. */ - list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + list( + query?: InvoiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: InvoiceListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } @@ -61,7 +64,7 @@ export class Invoices extends APIResource { * This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an * identifier. */ - fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { + fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/invoices/${invoiceId}`, options); } @@ -89,13 +92,13 @@ export class Invoices extends APIResource { invoiceId: string, body?: InvoiceIssueParams, options?: Core.RequestOptions, - ): Core.APIPromise; - issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; + issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise; issue( invoiceId: string, body: InvoiceIssueParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(body)) { return this.issue(invoiceId, {}, body); } @@ -110,1481 +113,33 @@ export class Invoices extends APIResource { invoiceId: string, body: InvoiceMarkPaidParams, options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options }); - } - - /** - * This endpoint collects payment for an invoice using the customer's default - * payment method. This action can only be taken on invoices with status "issued". - */ - pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post(`/invoices/${invoiceId}/pay`, options); - } - - /** - * This endpoint allows an invoice's status to be set the `void` status. This can - * only be done to invoices that are in the `issued` status. - * - * If the associated invoice has used the customer balance to change the amount - * due, the customer balance operation will be reverted. For example, if the - * invoice used $10 of customer balance, that amount will be added back to the - * customer balance upon voiding. - * - * If the invoice was used to purchase a credit block, but the invoice is not yet - * paid, the credit block will be voided. If the invoice was created due to a - * top-up, the top-up will be disabled. - */ - void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post(`/invoices/${invoiceId}/void`, options); - } -} - -export class InvoicesPage extends Page {} - -/** - * 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 interface Invoice { - 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: Invoice.AutoCollection; - - billing_address: Invoice.BillingAddress | 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: Invoice.Customer; - - 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 | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - customer_tax_id: Invoice.CustomerTaxID | null; - - /** - * @deprecated This field is deprecated in favor of `discounts`. If a `discounts` - * list is provided, the first discount in the list will be returned. If the list - * is empty, `None` will be returned. - */ - discount: unknown; - - discounts: Array; - - /** - * 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; - - /** - * The breakdown of prices in this invoice. - */ - line_items: Array; - - maximum: Invoice.Maximum | null; - - maximum_amount: 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: Record; - - minimum: Invoice.Minimum | null; - - minimum_amount: string | null; - - /** - * 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: Invoice.ShippingAddress | null; - - status: 'issued' | 'paid' | 'synced' | 'void' | 'draft'; - - subscription: Invoice.Subscription | null; - - /** - * The total before any discounts and minimums are applied. - */ - subtotal: string; - - /** - * 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 Invoice { - 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 BillingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; - - state: 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 Customer { - id: string; - - external_customer_id: 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'; - - /** - * The value of the amount changed in the transaction. - */ - amount: string; - - /** - * The creation time of this transaction. - */ - created_at: string; - - credit_note: CustomerBalanceTransaction.CreditNote | 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: CustomerBalanceTransaction.Invoice | 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 namespace CustomerBalanceTransaction { - export interface CreditNote { - /** - * The id of the Credit note - */ - id: string; - } - - export interface Invoice { - /** - * The Invoice id - */ - id: string; - } - } - - /** - * 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 | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - export interface CustomerTaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; - } - - export interface LineItem { - /** - * A unique ID for this line item. - */ - id: string; - - /** - * The line amount after any adjustments and before overage conversion, credits and - * partial invoicing. - */ - adjusted_subtotal: string; - - /** - * All adjustments applied to the line item in the order they were applied based on - * invoice calculations (ie. usage discounts -> amount discounts -> percentage - * discounts -> minimums -> maximums). - */ - adjustments: Array< - | LineItem.MonetaryUsageDiscountAdjustment - | LineItem.MonetaryAmountDiscountAdjustment - | LineItem.MonetaryPercentageDiscountAdjustment - | LineItem.MonetaryMinimumAdjustment - | LineItem.MonetaryMaximumAdjustment - >; - - /** - * The final amount for a line item after all adjustments and pre paid credits have - * been applied. - */ - amount: string; - - /** - * The number of prepaid credits applied. - */ - credits_applied: string; - - discount: Shared.Discount | null; - - /** - * The end date of the range of time applied for this line item's price. - */ - end_date: string; - - /** - * An additional filter that was used to calculate the usage for this line item. - */ - filter: string | null; - - /** - * [DEPRECATED] For configured prices that are split by a grouping key, this will - * be populated with the key and a value. The `amount` and `subtotal` will be the - * values for this particular grouping. - */ - grouping: string | null; - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - maximum: LineItem.Maximum | null; - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - maximum_amount: string | null; - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - minimum: LineItem.Minimum | null; - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - minimum_amount: string | null; - - /** - * The name of the price associated with this line item. - */ - name: string; - - /** - * Any amount applied from a partial invoice - */ - partially_invoiced_amount: string; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * Either the fixed fee quantity or the usage during the service period. - */ - quantity: number; - - /** - * The start date of the range of time applied for this line item's price. - */ - start_date: string; - - /** - * For complex pricing structures, the line item can be broken down further in - * `sub_line_items`. - */ - sub_line_items: Array; - - /** - * The line amount before before any adjustments. - */ - subtotal: string; - - /** - * An array of tax rates and their incurred tax amounts. Empty if no tax - * integration is configured. - */ - tax_amounts: Array; - - /** - * A list of customer ids that were used to calculate the usage for this line item. - */ - usage_customer_ids: Array | null; - } - - export namespace LineItem { - export interface MonetaryUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace MonetaryUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryPercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryPercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MatrixSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: MatrixSubLineItem.Grouping | null; - - matrix_config: MatrixSubLineItem.MatrixConfig; - - name: string; - - quantity: number; - - type: 'matrix'; - } - - export namespace MatrixSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface MatrixConfig { - /** - * The ordered dimension values for this line item. - */ - dimension_values: Array; - } - } - - export interface TierSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: TierSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - tier_config: TierSubLineItem.TierConfig; - - type: 'tier'; - } - - export namespace TierSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface TierConfig { - first_unit: number; - - last_unit: number | null; - - unit_amount: string; - } - } - - export interface OtherSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: OtherSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - type: "'null'"; - } - - export namespace OtherSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - } - - export interface TaxAmount { - /** - * The amount of additional tax incurred by this tax rate. - */ - amount: string; - - /** - * The human-readable description of the applied tax rate. - */ - tax_rate_description: string; - - /** - * The tax rate percentage, out of 100. - */ - tax_rate_percentage: string | null; - } - } - - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PaymentAttempt { - /** - * The ID of the payment attempt. - */ - 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; - - /** - * Whether the payment attempt succeeded. - */ - succeeded: boolean; - } - - export interface ShippingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; + ): Core.APIPromise { + return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options }); + } - state: string | null; + /** + * This endpoint collects payment for an invoice using the customer's default + * payment method. This action can only be taken on invoices with status "issued". + */ + pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.post(`/invoices/${invoiceId}/pay`, options); } - export interface Subscription { - id: string; + /** + * This endpoint allows an invoice's status to be set the `void` status. This can + * only be done to invoices that are in the `issued` status. + * + * If the associated invoice has used the customer balance to change the amount + * due, the customer balance operation will be reverted. For example, if the + * invoice used $10 of customer balance, that amount will be added back to the + * customer balance upon voiding. + * + * If the invoice was used to purchase a credit block, but the invoice is not yet + * paid, the credit block will be voided. If the invoice was created due to a + * top-up, the top-up will be disabled. + */ + void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.post(`/invoices/${invoiceId}/void`, options); } } @@ -1599,7 +154,7 @@ export interface InvoiceFetchUpcomingResponse { auto_collection: InvoiceFetchUpcomingResponse.AutoCollection; - billing_address: InvoiceFetchUpcomingResponse.BillingAddress | null; + billing_address: Shared.Address | null; /** * The creation time of the resource in Orb. @@ -1616,7 +171,7 @@ export interface InvoiceFetchUpcomingResponse { */ currency: string; - customer: InvoiceFetchUpcomingResponse.Customer; + customer: Shared.CustomerMinified; customer_balance_transactions: Array; @@ -1727,7 +282,7 @@ export interface InvoiceFetchUpcomingResponse { * | Venezuela | `ve_rif` | Venezuelan RIF Number | * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | */ - customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null; + customer_tax_id: Shared.CustomerTaxID | null; /** * @deprecated This field is deprecated in favor of `discounts`. If a `discounts` @@ -1788,7 +343,7 @@ export interface InvoiceFetchUpcomingResponse { */ line_items: Array; - maximum: InvoiceFetchUpcomingResponse.Maximum | null; + maximum: Shared.Maximum | null; maximum_amount: string | null; @@ -1805,7 +360,7 @@ export interface InvoiceFetchUpcomingResponse { */ metadata: Record; - minimum: InvoiceFetchUpcomingResponse.Minimum | null; + minimum: Shared.Minimum | null; minimum_amount: string | null; @@ -1839,11 +394,11 @@ export interface InvoiceFetchUpcomingResponse { */ scheduled_issue_at: string | null; - shipping_address: InvoiceFetchUpcomingResponse.ShippingAddress | null; + shipping_address: Shared.Address | null; status: 'issued' | 'paid' | 'synced' | 'void' | 'draft'; - subscription: InvoiceFetchUpcomingResponse.Subscription | null; + subscription: Shared.SubscriptionMinified | null; /** * The total before any discounts and minimums are applied. @@ -1910,20 +465,6 @@ export namespace InvoiceFetchUpcomingResponse { previously_attempted_at: string | null; } - export interface BillingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; - - state: string | null; - } - export interface CreditNote { id: string; @@ -1947,12 +488,6 @@ export namespace InvoiceFetchUpcomingResponse { voided_at: string | null; } - export interface Customer { - id: string; - - external_customer_id: string | null; - } - export interface CustomerBalanceTransaction { /** * A unique id for this transaction. @@ -1980,7 +515,7 @@ export namespace InvoiceFetchUpcomingResponse { */ created_at: string; - credit_note: CustomerBalanceTransaction.CreditNote | null; + credit_note: Shared.CreditNoteTiny | null; /** * An optional description provided for manual customer balance adjustments. @@ -1993,7 +528,7 @@ export namespace InvoiceFetchUpcomingResponse { */ ending_balance: string; - invoice: CustomerBalanceTransaction.Invoice | null; + invoice: Shared.InvoiceTiny | null; /** * The original value of the customer's balance prior to the transaction, in the @@ -2004,286 +539,6 @@ export namespace InvoiceFetchUpcomingResponse { type: 'increment' | 'decrement'; } - export namespace CustomerBalanceTransaction { - export interface CreditNote { - /** - * The id of the Credit note - */ - id: string; - } - - export interface Invoice { - /** - * The Invoice id - */ - id: string; - } - } - - /** - * 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 | - * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | - * | Andorra | `ad_nrt` | Andorran NRT Number | - * | Argentina | `ar_cuit` | Argentinian Tax ID Number | - * | Australia | `au_abn` | Australian Business Number (AU ABN) | - * | Australia | `au_arn` | Australian Taxation Office Reference Number | - * | Austria | `eu_vat` | European VAT Number | - * | Bahrain | `bh_vat` | Bahraini VAT Number | - * | Belgium | `eu_vat` | European VAT Number | - * | Bolivia | `bo_tin` | Bolivian Tax ID | - * | 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 | - * | 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) | - * | Chile | `cl_tin` | Chilean TIN | - * | China | `cn_tin` | Chinese Tax ID | - * | Colombia | `co_nit` | Colombian NIT Number | - * | Costa Rica | `cr_tin` | Costa Rican Tax ID | - * | Croatia | `eu_vat` | European VAT Number | - * | 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 | - * | EU | `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 | `eu_vat` | European VAT Number | - * | Greece | `eu_vat` | European VAT Number | - * | 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 | - * | Latvia | `eu_vat` | European VAT Number | - * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | - * | Mexico | `mx_rfc` | Mexican RFC Number | - * | Netherlands | `eu_vat` | European VAT Number | - * | New Zealand | `nz_gst` | New Zealand GST Number | - * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | - * | 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 | - * | 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 | - * | Sweden | `eu_vat` | European VAT Number | - * | Switzerland | `ch_vat` | Switzerland VAT Number | - * | Taiwan | `tw_vat` | Taiwanese VAT | - * | Thailand | `th_vat` | Thai VAT | - * | Turkey | `tr_tin` | Turkish Tax Identification Number | - * | Ukraine | `ua_vat` | Ukrainian VAT | - * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | - * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | - * | United Kingdom | `gb_vat` | United Kingdom VAT Number | - * | United States | `us_ein` | United States EIN | - * | Uruguay | `uy_ruc` | Uruguayan RUC Number | - * | Venezuela | `ve_rif` | Venezuelan RIF Number | - * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | - */ - export interface CustomerTaxID { - country: - | 'AD' - | 'AE' - | 'AR' - | 'AT' - | 'AU' - | 'BE' - | 'BG' - | 'BH' - | 'BO' - | 'BR' - | 'CA' - | 'CH' - | 'CL' - | 'CN' - | 'CO' - | 'CR' - | 'CY' - | 'CZ' - | 'DE' - | 'DK' - | 'EE' - | 'DO' - | 'EC' - | 'EG' - | 'ES' - | 'EU' - | 'FI' - | 'FR' - | 'GB' - | 'GE' - | 'GR' - | 'HK' - | 'HR' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IN' - | 'IS' - | 'IT' - | 'JP' - | 'KE' - | 'KR' - | 'KZ' - | 'LI' - | 'LT' - | 'LU' - | 'LV' - | 'MT' - | 'MX' - | 'MY' - | 'NG' - | 'NL' - | 'NO' - | 'NZ' - | 'OM' - | 'PE' - | 'PH' - | 'PL' - | 'PT' - | 'RO' - | 'RS' - | 'RU' - | 'SA' - | 'SE' - | 'SG' - | 'SI' - | 'SK' - | 'SV' - | 'TH' - | 'TR' - | 'TW' - | 'UA' - | 'US' - | 'UY' - | 'VE' - | 'VN' - | 'ZA'; - - type: - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'eu_vat' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - - value: string; - } - export interface LineItem { /** * A unique ID for this line item. @@ -2302,11 +557,11 @@ export namespace InvoiceFetchUpcomingResponse { * discounts -> minimums -> maximums). */ adjustments: Array< - | LineItem.MonetaryUsageDiscountAdjustment - | LineItem.MonetaryAmountDiscountAdjustment - | LineItem.MonetaryPercentageDiscountAdjustment - | LineItem.MonetaryMinimumAdjustment - | LineItem.MonetaryMaximumAdjustment + | Shared.MonetaryUsageDiscountAdjustment + | Shared.MonetaryAmountDiscountAdjustment + | Shared.MonetaryPercentageDiscountAdjustment + | Shared.MonetaryMinimumAdjustment + | Shared.MonetaryMaximumAdjustment >; /** @@ -2342,7 +597,7 @@ export namespace InvoiceFetchUpcomingResponse { /** * @deprecated This field is deprecated in favor of `adjustments`. */ - maximum: LineItem.Maximum | null; + maximum: Shared.Maximum | null; /** * @deprecated This field is deprecated in favor of `adjustments`. @@ -2352,7 +607,7 @@ export namespace InvoiceFetchUpcomingResponse { /** * @deprecated This field is deprecated in favor of `adjustments`. */ - minimum: LineItem.Minimum | null; + minimum: Shared.Minimum | null; /** * @deprecated This field is deprecated in favor of `adjustments`. @@ -2381,7 +636,7 @@ export namespace InvoiceFetchUpcomingResponse { * For more on the types of prices, see * [the core concepts documentation](/core-concepts#plan-and-price) */ - price: PricesAPI.Price; + price: Shared.Price; /** * Either the fixed fee quantity or the usage during the service period. @@ -2397,7 +652,7 @@ export namespace InvoiceFetchUpcomingResponse { * For complex pricing structures, the line item can be broken down further in * `sub_line_items`. */ - sub_line_items: Array; + sub_line_items: Array; /** * The line amount before before any adjustments. @@ -2408,7 +663,7 @@ export namespace InvoiceFetchUpcomingResponse { * An array of tax rates and their incurred tax amounts. Empty if no tax * integration is configured. */ - tax_amounts: Array; + tax_amounts: Array; /** * A list of customer ids that were used to calculate the usage for this line item. @@ -2416,566 +671,6 @@ export namespace InvoiceFetchUpcomingResponse { usage_customer_ids: Array | null; } - export namespace LineItem { - export interface MonetaryUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace MonetaryUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryPercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryPercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MonetaryMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * The value applied by an adjustment. - */ - amount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace MonetaryMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated This field is deprecated in favor of `adjustments`. - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MatrixSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: MatrixSubLineItem.Grouping | null; - - matrix_config: MatrixSubLineItem.MatrixConfig; - - name: string; - - quantity: number; - - type: 'matrix'; - } - - export namespace MatrixSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface MatrixConfig { - /** - * The ordered dimension values for this line item. - */ - dimension_values: Array; - } - } - - export interface TierSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: TierSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - tier_config: TierSubLineItem.TierConfig; - - type: 'tier'; - } - - export namespace TierSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - - export interface TierConfig { - first_unit: number; - - last_unit: number | null; - - unit_amount: string; - } - } - - export interface OtherSubLineItem { - /** - * The total amount for this sub line item. - */ - amount: string; - - grouping: OtherSubLineItem.Grouping | null; - - name: string; - - quantity: number; - - type: "'null'"; - } - - export namespace OtherSubLineItem { - export interface Grouping { - key: string; - - /** - * No value indicates the default group - */ - value: string | null; - } - } - - export interface TaxAmount { - /** - * The amount of additional tax incurred by this tax rate. - */ - amount: string; - - /** - * The human-readable description of the applied tax rate. - */ - tax_rate_description: string; - - /** - * The tax rate percentage, out of 100. - */ - tax_rate_percentage: string | null; - } - } - - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - export interface PaymentAttempt { /** * The ID of the payment attempt. @@ -3007,24 +702,6 @@ export namespace InvoiceFetchUpcomingResponse { */ succeeded: boolean; } - - export interface ShippingAddress { - city: string | null; - - country: string | null; - - line1: string | null; - - line2: string | null; - - postal_code: string | null; - - state: string | null; - } - - export interface Subscription { - id: string; - } } export interface InvoiceCreateParams { @@ -3113,16 +790,7 @@ export namespace InvoiceCreateParams { */ start_date: string; - unit_config: LineItem.UnitConfig; - } - - export namespace LineItem { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } + unit_config: Shared.UnitConfig; } } @@ -3209,13 +877,9 @@ export interface InvoiceMarkPaidParams { notes?: string | null; } -Invoices.InvoicesPage = InvoicesPage; - export declare namespace Invoices { export { - type Invoice as Invoice, type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, - InvoicesPage as InvoicesPage, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceUpdateParams as InvoiceUpdateParams, type InvoiceListParams as InvoiceListParams, @@ -3224,3 +888,5 @@ export declare namespace Invoices { type InvoiceMarkPaidParams as InvoiceMarkPaidParams, }; } + +export { InvoicesPage }; diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index c215c916..c80a6428 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -6,7 +6,6 @@ import * as Core from '../../core'; import * as Shared from '../shared'; import * as ExternalPlanIDAPI from './external-plan-id'; import { ExternalPlanID, ExternalPlanIDUpdateParams } from './external-plan-id'; -import * as PricesAPI from '../prices/prices'; import { Page, type PageParams } from '../../pagination'; export class Plans extends APIResource { @@ -88,11 +87,11 @@ export interface Plan { * across all phases of the plan. */ adjustments: Array< - | Plan.PlanPhaseUsageDiscountAdjustment - | Plan.PlanPhaseAmountDiscountAdjustment - | Plan.PlanPhasePercentageDiscountAdjustment - | Plan.PlanPhaseMinimumAdjustment - | Plan.PlanPhaseMaximumAdjustment + | Shared.PlanPhaseUsageDiscountAdjustment + | Shared.PlanPhaseAmountDiscountAdjustment + | Shared.PlanPhasePercentageDiscountAdjustment + | Shared.PlanPhaseMinimumAdjustment + | Shared.PlanPhaseMaximumAdjustment >; base_plan: Plan.BasePlan | null; @@ -140,7 +139,7 @@ export interface Plan { /** * @deprecated */ - maximum: Plan.Maximum | null; + maximum: Shared.Maximum | null; /** * @deprecated @@ -158,7 +157,7 @@ export interface Plan { /** * @deprecated */ - minimum: Plan.Minimum | null; + minimum: Shared.Minimum | null; /** * @deprecated @@ -182,7 +181,7 @@ export interface Plan { * Prices for this plan. If the plan has phases, this includes prices across all * phases of the plan. */ - prices: Array; + prices: Array; product: Plan.Product; @@ -194,296 +193,6 @@ export interface Plan { } export namespace Plan { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - export interface BasePlan { id: string | null; @@ -497,86 +206,6 @@ export namespace Plan { name: string | null; } - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - export interface PlanPhase { id: string; @@ -592,11 +221,11 @@ export namespace Plan { duration_unit: 'daily' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | null; - maximum: PlanPhase.Maximum | null; + maximum: Shared.Maximum | null; maximum_amount: string | null; - minimum: PlanPhase.Minimum | null; + minimum: Shared.Minimum | null; minimum_amount: string | null; @@ -608,82 +237,6 @@ export namespace Plan { order: number; } - export namespace PlanPhase { - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - export interface Product { id: string; @@ -713,34 +266,34 @@ export interface PlanCreateParams { * phases of the plan. */ prices: Array< - | PlanCreateParams.NewPlanUnitPrice - | PlanCreateParams.NewPlanPackagePrice - | PlanCreateParams.NewPlanMatrixPrice - | PlanCreateParams.NewPlanTieredPrice - | PlanCreateParams.NewPlanTieredBpsPrice - | PlanCreateParams.NewPlanBpsPrice - | PlanCreateParams.NewPlanBulkBpsPrice - | PlanCreateParams.NewPlanBulkPrice - | PlanCreateParams.NewPlanThresholdTotalAmountPrice - | PlanCreateParams.NewPlanTieredPackagePrice - | PlanCreateParams.NewPlanTieredWithMinimumPrice - | PlanCreateParams.NewPlanUnitWithPercentPrice - | PlanCreateParams.NewPlanPackageWithAllocationPrice - | PlanCreateParams.NewPlanTierWithProrationPrice - | PlanCreateParams.NewPlanUnitWithProrationPrice - | PlanCreateParams.NewPlanGroupedAllocationPrice - | PlanCreateParams.NewPlanGroupedWithProratedMinimumPrice - | PlanCreateParams.NewPlanGroupedWithMeteredMinimumPrice - | PlanCreateParams.NewPlanMatrixWithDisplayNamePrice - | PlanCreateParams.NewPlanBulkWithProrationPrice - | PlanCreateParams.NewPlanGroupedTieredPackagePrice - | PlanCreateParams.NewPlanMaxGroupTieredPackagePrice - | PlanCreateParams.NewPlanScalableMatrixWithUnitPricingPrice - | PlanCreateParams.NewPlanScalableMatrixWithTieredPricingPrice - | PlanCreateParams.NewPlanCumulativeGroupedBulkPrice - | PlanCreateParams.NewPlanTieredPackageWithMinimumPrice - | PlanCreateParams.NewPlanMatrixWithAllocationPrice - | PlanCreateParams.NewPlanGroupedTieredPrice + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice >; /** @@ -771,4109 +324,6 @@ export interface PlanCreateParams { status?: 'active' | 'draft'; } -export namespace PlanCreateParams { - export interface NewPlanUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewPlanUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewPlanPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewPlanMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewPlanTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewPlanTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBpsPrice { - bps_config: NewPlanBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkBpsPrice { - bulk_bps_config: NewPlanBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkPrice { - bulk_config: NewPlanBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewPlanMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewPlanGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewPlanGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewPlanGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewPlanGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewPlanGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } -} - export interface PlanUpdateParams { /** * An optional user-defined ID for this plan resource, used throughout the system diff --git a/src/resources/prices/external-price-id.ts b/src/resources/prices/external-price-id.ts index 65b2d7b6..e335203c 100644 --- a/src/resources/prices/external-price-id.ts +++ b/src/resources/prices/external-price-id.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as PricesAPI from './prices'; +import * as Shared from '../shared'; export class ExternalPriceID extends APIResource { /** @@ -14,7 +14,7 @@ export class ExternalPriceID extends APIResource { externalPriceId: string, body: ExternalPriceIDUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.put(`/prices/external_price_id/${externalPriceId}`, { body, ...options }); } @@ -23,7 +23,7 @@ export class ExternalPriceID extends APIResource { * [price creation API](/api-reference/price/create-price) for more information * about external price aliases. */ - fetch(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise { + fetch(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/prices/external_price_id/${externalPriceId}`, options); } } diff --git a/src/resources/prices/index.ts b/src/resources/prices/index.ts index d04fff48..7af61056 100644 --- a/src/resources/prices/index.ts +++ b/src/resources/prices/index.ts @@ -2,15 +2,15 @@ export { ExternalPriceID, type ExternalPriceIDUpdateParams } from './external-price-id'; export { - PricesPage, Prices, type EvaluatePriceGroup, - type Price, type PriceEvaluateResponse, type PriceEvaluateMultipleResponse, + type PriceEvaluatePreviewEventsResponse, type PriceCreateParams, type PriceUpdateParams, type PriceListParams, type PriceEvaluateParams, type PriceEvaluateMultipleParams, + type PriceEvaluatePreviewEventsParams, } from './prices'; diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index 52eb97df..be947d79 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -5,9 +5,10 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as PricesAPI from './prices'; import * as Shared from '../shared'; +import { PricesPage } from '../shared'; import * as ExternalPriceIDAPI from './external-price-id'; import { ExternalPriceID, ExternalPriceIDUpdateParams } from './external-price-id'; -import { Page, type PageParams } from '../../pagination'; +import { type PageParams } from '../../pagination'; export class Prices extends APIResource { externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this._client); @@ -24,7 +25,7 @@ export class Prices extends APIResource { * See the [Price resource](/product-catalog/price-configuration) for the * specification of different price model configurations possible in this endpoint. */ - create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/prices', { body, ...options }); } @@ -33,7 +34,11 @@ export class Prices extends APIResource { * pass null for the metadata value, it will clear any existing metadata for that * price. */ - update(priceId: string, body: PriceUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + update( + priceId: string, + body: PriceUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return this._client.put(`/prices/${priceId}`, { body, ...options }); } @@ -41,12 +46,12 @@ export class Prices extends APIResource { * This endpoint is used to list all add-on prices created using the * [price creation endpoint](/api-reference/price/create-price). */ - list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: PriceListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } @@ -73,5865 +78,148 @@ export class Prices extends APIResource { * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd * like to examine a customer's usage for a specific property value, you can do so * with the following `filter`: - * `my_property = 'foo' AND my_other_property = 'bar'`. - * - * By default, the start of the time range must be no more than 100 days ago and - * the length of the results must be no greater than 1000. Note that this is a POST - * endpoint rather than a GET endpoint because it employs a JSON body rather than - * query parameters. - */ - evaluate( - priceId: string, - body: PriceEvaluateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post(`/prices/${priceId}/evaluate`, { body, ...options }); - } - - /** - * This endpoint is used to evaluate the output of price(s) for a given customer - * and time range over either ingested events or preview events. It enables - * filtering and grouping the output using - * [computed properties](/extensibility/advanced-metrics#computed-properties), - * supporting the following workflows: - * - * 1. Showing detailed usage and costs to the end customer. - * 2. Auditing subtotals on invoice line items. - * - * Prices may either reference existing prices in your Orb account or be defined - * inline in the request body. Up to 100 prices can be evaluated in a single - * request. - * - * Price evaluation by default uses ingested events, but you can also provide a - * list of preview events to use instead. Up to 500 preview events can be provided - * in a single request. When using ingested events, the start of the time range - * must be no more than 100 days ago. - * - * For these workflows, the expressiveness of computed properties in both the - * filters and grouping is critical. For example, if you'd like to show your - * customer their usage grouped by hour and another property, you can do so with - * the following `grouping_keys`: - * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd - * like to examine a customer's usage for a specific property value, you can do so - * with the following `filter`: - * `my_property = 'foo' AND my_other_property = 'bar'`. - * - * The length of the results must be no greater than 1000. Note that this is a POST - * endpoint rather than a GET endpoint because it employs a JSON body rather than - * query parameters. - */ - evaluateMultiple( - body: PriceEvaluateMultipleParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post('/prices/evaluate', { body, ...options }); - } - - /** - * This endpoint returns a price given an identifier. - */ - fetch(priceId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/prices/${priceId}`, options); - } -} - -export class PricesPage extends Page {} - -export interface EvaluatePriceGroup { - /** - * The price's output for the group - */ - amount: string; - - /** - * The values for the group in the order specified by `grouping_keys` - */ - grouping_values: Array; - - /** - * The price's usage quantity for the group - */ - quantity: number; -} - -/** - * 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 type Price = - | Price.UnitPrice - | Price.PackagePrice - | Price.MatrixPrice - | Price.TieredPrice - | Price.TieredBpsPrice - | Price.BpsPrice - | Price.BulkBpsPrice - | Price.BulkPrice - | Price.ThresholdTotalAmountPrice - | Price.TieredPackagePrice - | Price.GroupedTieredPrice - | Price.TieredWithMinimumPrice - | Price.TieredPackageWithMinimumPrice - | Price.PackageWithAllocationPrice - | Price.UnitWithPercentPrice - | Price.MatrixWithAllocationPrice - | Price.TieredWithProrationPrice - | Price.UnitWithProrationPrice - | Price.GroupedAllocationPrice - | Price.GroupedWithProratedMinimumPrice - | Price.GroupedWithMeteredMinimumPrice - | Price.MatrixWithDisplayNamePrice - | Price.BulkWithProrationPrice - | Price.GroupedTieredPackagePrice - | Price.MaxGroupTieredPackagePrice - | Price.ScalableMatrixWithUnitPricingPrice - | Price.ScalableMatrixWithTieredPricingPrice - | Price.CumulativeGroupedBulkPrice; - -export namespace Price { - export interface UnitPrice { - id: string; - - billable_metric: UnitPrice.BillableMetric | null; - - billing_cycle_configuration: UnitPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: UnitPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: UnitPrice.InvoicingCycleConfiguration | null; - - item: UnitPrice.Item; - - /** - * @deprecated - */ - maximum: UnitPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: UnitPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'unit'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - unit_config: UnitPrice.UnitConfig; - - dimensional_price_configuration?: UnitPrice.DimensionalPriceConfiguration | null; - } - - export namespace UnitPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface PackagePrice { - id: string; - - billable_metric: PackagePrice.BillableMetric | null; - - billing_cycle_configuration: PackagePrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: PackagePrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: PackagePrice.InvoicingCycleConfiguration | null; - - item: PackagePrice.Item; - - /** - * @deprecated - */ - maximum: PackagePrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: PackagePrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'package'; - - name: string; - - package_config: PackagePrice.PackageConfig; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: PackagePrice.DimensionalPriceConfiguration | null; - } - - export namespace PackagePrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface MatrixPrice { - id: string; - - billable_metric: MatrixPrice.BillableMetric | null; - - billing_cycle_configuration: MatrixPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: MatrixPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: MatrixPrice.InvoicingCycleConfiguration | null; - - item: MatrixPrice.Item; - - matrix_config: MatrixPrice.MatrixConfig; - - /** - * @deprecated - */ - maximum: MatrixPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: MatrixPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'matrix'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: MatrixPrice.DimensionalPriceConfiguration | null; - } - - export namespace MatrixPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredPrice { - id: string; - - billable_metric: TieredPrice.BillableMetric | null; - - billing_cycle_configuration: TieredPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredPrice.InvoicingCycleConfiguration | null; - - item: TieredPrice.Item; - - /** - * @deprecated - */ - maximum: TieredPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_config: TieredPrice.TieredConfig; - - dimensional_price_configuration?: TieredPrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredBpsPrice { - id: string; - - billable_metric: TieredBpsPrice.BillableMetric | null; - - billing_cycle_configuration: TieredBpsPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredBpsPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredBpsPrice.InvoicingCycleConfiguration | null; - - item: TieredBpsPrice.Item; - - /** - * @deprecated - */ - maximum: TieredBpsPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredBpsPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered_bps'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_bps_config: TieredBpsPrice.TieredBpsConfig; - - dimensional_price_configuration?: TieredBpsPrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredBpsPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface BpsPrice { - id: string; - - billable_metric: BpsPrice.BillableMetric | null; - - billing_cycle_configuration: BpsPrice.BillingCycleConfiguration; - - bps_config: BpsPrice.BpsConfig; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: BpsPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: BpsPrice.InvoicingCycleConfiguration | null; - - item: BpsPrice.Item; - - /** - * @deprecated - */ - maximum: BpsPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: BpsPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'bps'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: BpsPrice.DimensionalPriceConfiguration | null; - } - - export namespace BpsPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface BulkBpsPrice { - id: string; - - billable_metric: BulkBpsPrice.BillableMetric | null; - - billing_cycle_configuration: BulkBpsPrice.BillingCycleConfiguration; - - bulk_bps_config: BulkBpsPrice.BulkBpsConfig; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: BulkBpsPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: BulkBpsPrice.InvoicingCycleConfiguration | null; - - item: BulkBpsPrice.Item; - - /** - * @deprecated - */ - maximum: BulkBpsPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: BulkBpsPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'bulk_bps'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: BulkBpsPrice.DimensionalPriceConfiguration | null; - } - - export namespace BulkBpsPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface BulkPrice { - id: string; - - billable_metric: BulkPrice.BillableMetric | null; - - billing_cycle_configuration: BulkPrice.BillingCycleConfiguration; - - bulk_config: BulkPrice.BulkConfig; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: BulkPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: BulkPrice.InvoicingCycleConfiguration | null; - - item: BulkPrice.Item; - - /** - * @deprecated - */ - maximum: BulkPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: BulkPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'bulk'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: BulkPrice.DimensionalPriceConfiguration | null; - } - - export namespace BulkPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface ThresholdTotalAmountPrice { - id: string; - - billable_metric: ThresholdTotalAmountPrice.BillableMetric | null; - - billing_cycle_configuration: ThresholdTotalAmountPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: ThresholdTotalAmountPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: ThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - item: ThresholdTotalAmountPrice.Item; - - /** - * @deprecated - */ - maximum: ThresholdTotalAmountPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: ThresholdTotalAmountPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'threshold_total_amount'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - threshold_total_amount_config: Record; - - dimensional_price_configuration?: ThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - } - - export namespace ThresholdTotalAmountPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredPackagePrice { - id: string; - - billable_metric: TieredPackagePrice.BillableMetric | null; - - billing_cycle_configuration: TieredPackagePrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredPackagePrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredPackagePrice.InvoicingCycleConfiguration | null; - - item: TieredPackagePrice.Item; - - /** - * @deprecated - */ - maximum: TieredPackagePrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredPackagePrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered_package'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_package_config: Record; - - dimensional_price_configuration?: TieredPackagePrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredPackagePrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface GroupedTieredPrice { - id: string; - - billable_metric: GroupedTieredPrice.BillableMetric | null; - - billing_cycle_configuration: GroupedTieredPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: GroupedTieredPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - grouped_tiered_config: Record; - - invoicing_cycle_configuration: GroupedTieredPrice.InvoicingCycleConfiguration | null; - - item: GroupedTieredPrice.Item; - - /** - * @deprecated - */ - maximum: GroupedTieredPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: GroupedTieredPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'grouped_tiered'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: GroupedTieredPrice.DimensionalPriceConfiguration | null; - } - - export namespace GroupedTieredPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredWithMinimumPrice { - id: string; - - billable_metric: TieredWithMinimumPrice.BillableMetric | null; - - billing_cycle_configuration: TieredWithMinimumPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredWithMinimumPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - item: TieredWithMinimumPrice.Item; - - /** - * @deprecated - */ - maximum: TieredWithMinimumPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredWithMinimumPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered_with_minimum'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_with_minimum_config: Record; - - dimensional_price_configuration?: TieredWithMinimumPrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredWithMinimumPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredPackageWithMinimumPrice { - id: string; - - billable_metric: TieredPackageWithMinimumPrice.BillableMetric | null; - - billing_cycle_configuration: TieredPackageWithMinimumPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredPackageWithMinimumPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - item: TieredPackageWithMinimumPrice.Item; - - /** - * @deprecated - */ - maximum: TieredPackageWithMinimumPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredPackageWithMinimumPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered_package_with_minimum'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_package_with_minimum_config: Record; - - dimensional_price_configuration?: TieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredPackageWithMinimumPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface PackageWithAllocationPrice { - id: string; - - billable_metric: PackageWithAllocationPrice.BillableMetric | null; - - billing_cycle_configuration: PackageWithAllocationPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: PackageWithAllocationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: PackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - item: PackageWithAllocationPrice.Item; - - /** - * @deprecated - */ - maximum: PackageWithAllocationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: PackageWithAllocationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'package_with_allocation'; - - name: string; - - package_with_allocation_config: Record; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: PackageWithAllocationPrice.DimensionalPriceConfiguration | null; - } - - export namespace PackageWithAllocationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface UnitWithPercentPrice { - id: string; - - billable_metric: UnitWithPercentPrice.BillableMetric | null; - - billing_cycle_configuration: UnitWithPercentPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: UnitWithPercentPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: UnitWithPercentPrice.InvoicingCycleConfiguration | null; - - item: UnitWithPercentPrice.Item; - - /** - * @deprecated - */ - maximum: UnitWithPercentPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: UnitWithPercentPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'unit_with_percent'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - unit_with_percent_config: Record; - - dimensional_price_configuration?: UnitWithPercentPrice.DimensionalPriceConfiguration | null; - } - - export namespace UnitWithPercentPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface MatrixWithAllocationPrice { - id: string; - - billable_metric: MatrixWithAllocationPrice.BillableMetric | null; - - billing_cycle_configuration: MatrixWithAllocationPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: MatrixWithAllocationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: MatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - item: MatrixWithAllocationPrice.Item; - - matrix_with_allocation_config: MatrixWithAllocationPrice.MatrixWithAllocationConfig; - - /** - * @deprecated - */ - maximum: MatrixWithAllocationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: MatrixWithAllocationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'matrix_with_allocation'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: MatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - } - - export namespace MatrixWithAllocationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface TieredWithProrationPrice { - id: string; - - billable_metric: TieredWithProrationPrice.BillableMetric | null; - - billing_cycle_configuration: TieredWithProrationPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: TieredWithProrationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: TieredWithProrationPrice.InvoicingCycleConfiguration | null; - - item: TieredWithProrationPrice.Item; - - /** - * @deprecated - */ - maximum: TieredWithProrationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: TieredWithProrationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'tiered_with_proration'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - tiered_with_proration_config: Record; - - dimensional_price_configuration?: TieredWithProrationPrice.DimensionalPriceConfiguration | null; - } - - export namespace TieredWithProrationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface UnitWithProrationPrice { - id: string; - - billable_metric: UnitWithProrationPrice.BillableMetric | null; - - billing_cycle_configuration: UnitWithProrationPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: UnitWithProrationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: UnitWithProrationPrice.InvoicingCycleConfiguration | null; - - item: UnitWithProrationPrice.Item; - - /** - * @deprecated - */ - maximum: UnitWithProrationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: UnitWithProrationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'unit_with_proration'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - unit_with_proration_config: Record; - - dimensional_price_configuration?: UnitWithProrationPrice.DimensionalPriceConfiguration | null; - } - - export namespace UnitWithProrationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface GroupedAllocationPrice { - id: string; - - billable_metric: GroupedAllocationPrice.BillableMetric | null; - - billing_cycle_configuration: GroupedAllocationPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: GroupedAllocationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - grouped_allocation_config: Record; - - invoicing_cycle_configuration: GroupedAllocationPrice.InvoicingCycleConfiguration | null; - - item: GroupedAllocationPrice.Item; - - /** - * @deprecated - */ - maximum: GroupedAllocationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: GroupedAllocationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'grouped_allocation'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: GroupedAllocationPrice.DimensionalPriceConfiguration | null; - } - - export namespace GroupedAllocationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface GroupedWithProratedMinimumPrice { - id: string; - - billable_metric: GroupedWithProratedMinimumPrice.BillableMetric | null; - - billing_cycle_configuration: GroupedWithProratedMinimumPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: GroupedWithProratedMinimumPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - grouped_with_prorated_minimum_config: Record; - - invoicing_cycle_configuration: GroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - item: GroupedWithProratedMinimumPrice.Item; - - /** - * @deprecated - */ - maximum: GroupedWithProratedMinimumPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: GroupedWithProratedMinimumPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'grouped_with_prorated_minimum'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: GroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - } - - export namespace GroupedWithProratedMinimumPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface GroupedWithMeteredMinimumPrice { - id: string; - - billable_metric: GroupedWithMeteredMinimumPrice.BillableMetric | null; - - billing_cycle_configuration: GroupedWithMeteredMinimumPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: GroupedWithMeteredMinimumPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - grouped_with_metered_minimum_config: Record; - - invoicing_cycle_configuration: GroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - item: GroupedWithMeteredMinimumPrice.Item; - - /** - * @deprecated - */ - maximum: GroupedWithMeteredMinimumPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: GroupedWithMeteredMinimumPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'grouped_with_metered_minimum'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: GroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - } - - export namespace GroupedWithMeteredMinimumPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface MatrixWithDisplayNamePrice { - id: string; - - billable_metric: MatrixWithDisplayNamePrice.BillableMetric | null; - - billing_cycle_configuration: MatrixWithDisplayNamePrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: MatrixWithDisplayNamePrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: MatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - item: MatrixWithDisplayNamePrice.Item; - - matrix_with_display_name_config: Record; - - /** - * @deprecated - */ - maximum: MatrixWithDisplayNamePrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: MatrixWithDisplayNamePrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'matrix_with_display_name'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: MatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - } - - export namespace MatrixWithDisplayNamePrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface BulkWithProrationPrice { - id: string; - - billable_metric: BulkWithProrationPrice.BillableMetric | null; - - billing_cycle_configuration: BulkWithProrationPrice.BillingCycleConfiguration; - - bulk_with_proration_config: Record; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: BulkWithProrationPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: BulkWithProrationPrice.InvoicingCycleConfiguration | null; - - item: BulkWithProrationPrice.Item; - - /** - * @deprecated - */ - maximum: BulkWithProrationPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: BulkWithProrationPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'bulk_with_proration'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: BulkWithProrationPrice.DimensionalPriceConfiguration | null; - } - - export namespace BulkWithProrationPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface GroupedTieredPackagePrice { - id: string; - - billable_metric: GroupedTieredPackagePrice.BillableMetric | null; - - billing_cycle_configuration: GroupedTieredPackagePrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: GroupedTieredPackagePrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - grouped_tiered_package_config: Record; - - invoicing_cycle_configuration: GroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - item: GroupedTieredPackagePrice.Item; - - /** - * @deprecated - */ - maximum: GroupedTieredPackagePrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: GroupedTieredPackagePrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'grouped_tiered_package'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: GroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - } - - export namespace GroupedTieredPackagePrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface MaxGroupTieredPackagePrice { - id: string; - - billable_metric: MaxGroupTieredPackagePrice.BillableMetric | null; - - billing_cycle_configuration: MaxGroupTieredPackagePrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: MaxGroupTieredPackagePrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: MaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - item: MaxGroupTieredPackagePrice.Item; - - max_group_tiered_package_config: Record; - - /** - * @deprecated - */ - maximum: MaxGroupTieredPackagePrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: MaxGroupTieredPackagePrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'max_group_tiered_package'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: MaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - } - - export namespace MaxGroupTieredPackagePrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface ScalableMatrixWithUnitPricingPrice { - id: string; - - billable_metric: ScalableMatrixWithUnitPricingPrice.BillableMetric | null; - - billing_cycle_configuration: ScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: ScalableMatrixWithUnitPricingPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: ScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - item: ScalableMatrixWithUnitPricingPrice.Item; - - /** - * @deprecated - */ - maximum: ScalableMatrixWithUnitPricingPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: ScalableMatrixWithUnitPricingPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'scalable_matrix_with_unit_pricing'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - scalable_matrix_with_unit_pricing_config: Record; - - dimensional_price_configuration?: ScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - } - - export namespace ScalableMatrixWithUnitPricingPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } - } - - export interface ScalableMatrixWithTieredPricingPrice { - id: string; - - billable_metric: ScalableMatrixWithTieredPricingPrice.BillableMetric | null; - - billing_cycle_configuration: ScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: ScalableMatrixWithTieredPricingPrice.CreditAllocation | null; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; - - external_price_id: string | null; - - fixed_price_quantity: number | null; - - invoicing_cycle_configuration: ScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - item: ScalableMatrixWithTieredPricingPrice.Item; - - /** - * @deprecated - */ - maximum: ScalableMatrixWithTieredPricingPrice.Maximum | null; - - /** - * @deprecated - */ - maximum_amount: string | null; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated - */ - minimum: ScalableMatrixWithTieredPricingPrice.Minimum | null; - - /** - * @deprecated - */ - minimum_amount: string | null; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - scalable_matrix_with_tiered_pricing_config: Record; - - dimensional_price_configuration?: ScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - } - - export namespace ScalableMatrixWithTieredPricingPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } - - /** - * @deprecated - */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * @deprecated - */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } + * `my_property = 'foo' AND my_other_property = 'bar'`. + * + * By default, the start of the time range must be no more than 100 days ago and + * the length of the results must be no greater than 1000. Note that this is a POST + * endpoint rather than a GET endpoint because it employs a JSON body rather than + * query parameters. + */ + evaluate( + priceId: string, + body: PriceEvaluateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post(`/prices/${priceId}/evaluate`, { body, ...options }); } - export interface CumulativeGroupedBulkPrice { - id: string; - - billable_metric: CumulativeGroupedBulkPrice.BillableMetric | null; - - billing_cycle_configuration: CumulativeGroupedBulkPrice.BillingCycleConfiguration; - - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - conversion_rate: number | null; - - created_at: string; - - credit_allocation: CumulativeGroupedBulkPrice.CreditAllocation | null; - - cumulative_grouped_bulk_config: Record; - - currency: string; - - /** - * @deprecated - */ - discount: Shared.Discount | null; + /** + * This endpoint is used to evaluate the output of price(s) for a given customer + * and time range over ingested events. It enables filtering and grouping the + * output using + * [computed properties](/extensibility/advanced-metrics#computed-properties), + * supporting the following workflows: + * + * 1. Showing detailed usage and costs to the end customer. + * 2. Auditing subtotals on invoice line items. + * + * For these workflows, the expressiveness of computed properties in both the + * filters and grouping is critical. For example, if you'd like to show your + * customer their usage grouped by hour and another property, you can do so with + * the following `grouping_keys`: + * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd + * like to examine a customer's usage for a specific property value, you can do so + * with the following `filter`: + * `my_property = 'foo' AND my_other_property = 'bar'`. + * + * Prices may either reference existing prices in your Orb account or be defined + * inline in the request body. Up to 100 prices can be evaluated in a single + * request. + * + * Prices are evaluated on ingested events and the start of the time range must be + * no more than 100 days ago. To evaluate based off a set of provided events, the + * [evaluate preview events](/api-reference/price/evaluate-preview-events) endpoint + * can be used instead. + * + * Note that this is a POST endpoint rather than a GET endpoint because it employs + * a JSON body rather than query parameters. + */ + evaluateMultiple( + body: PriceEvaluateMultipleParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/prices/evaluate', { body, ...options }); + } - external_price_id: string | null; + /** + * This endpoint evaluates prices on preview events instead of actual usage, making + * it ideal for building price calculators and cost estimation tools. You can + * filter and group results using + * [computed properties](/extensibility/advanced-metrics#computed-properties) to + * analyze pricing across different dimensions. + * + * Prices may either reference existing prices in your Orb account or be defined + * inline in the request body. The endpoint has the following limitations: + * + * 1. Up to 100 prices can be evaluated in a single request. + * 2. Up to 500 preview events can be provided in a single request. + * + * A top-level customer_id is required to evaluate the preview events. + * Additionally, all events without a customer_id will have the top-level + * customer_id added. + * + * Note that this is a POST endpoint rather than a GET endpoint because it employs + * a JSON body rather than query parameters. + */ + evaluatePreviewEvents( + body: PriceEvaluatePreviewEventsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/prices/evaluate_preview_events', { body, ...options }); + } - fixed_price_quantity: number | null; + /** + * This endpoint returns a price given an identifier. + */ + fetch(priceId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.get(`/prices/${priceId}`, options); + } +} - invoicing_cycle_configuration: CumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; +export interface EvaluatePriceGroup { + /** + * The price's output for the group + */ + amount: string; - item: CumulativeGroupedBulkPrice.Item; + /** + * The values for the group in the order specified by `grouping_keys` + */ + grouping_values: Array; - /** - * @deprecated - */ - maximum: CumulativeGroupedBulkPrice.Maximum | null; + /** + * The price's usage quantity for the group + */ + quantity: number; +} - /** - * @deprecated - */ - maximum_amount: string | null; +export interface PriceEvaluateResponse { + data: Array; +} - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; +export interface PriceEvaluateMultipleResponse { + data: Array; +} +export namespace PriceEvaluateMultipleResponse { + export interface Data { /** - * @deprecated + * The currency of the price */ - minimum: CumulativeGroupedBulkPrice.Minimum | null; + currency: string; /** - * @deprecated + * The computed price groups associated with input price. */ - minimum_amount: string | null; - - model_type: 'cumulative_grouped_bulk'; - - name: string; - - plan_phase_order: number | null; - - price_type: 'usage_price' | 'fixed_price'; - - dimensional_price_configuration?: CumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - } - - export namespace CumulativeGroupedBulkPrice { - export interface BillableMetric { - id: string; - } - - export interface BillingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface CreditAllocation { - allows_rollover: boolean; - - currency: string; - - custom_expiration: CreditAllocation.CustomExpiration | null; - } - - export namespace CreditAllocation { - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface InvoicingCycleConfiguration { - duration: number; - - duration_unit: 'day' | 'month'; - } - - export interface Item { - id: string; - - name: string; - } + price_groups: Array; /** - * @deprecated + * The index of the inline price */ - export interface Maximum { - /** - * @deprecated List of price_ids that this maximum amount applies to. For plan/plan - * phase maximums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this maximum to. - */ - filters: Array; - - /** - * Maximum amount applied - */ - maximum_amount: string; - } - - export namespace Maximum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + inline_price_index?: number | null; /** - * @deprecated + * The ID of the price */ - export interface Minimum { - /** - * @deprecated List of price_ids that this minimum amount applies to. For plan/plan - * phase minimums, this can be a subset of prices. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this minimum to. - */ - filters: Array; - - /** - * Minimum amount applied - */ - minimum_amount: string; - } - - export namespace Minimum { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface DimensionalPriceConfiguration { - dimension_values: Array; - - dimensional_price_group_id: string; - } + price_id?: string | null; } } -export interface PriceEvaluateResponse { - data: Array; -} - -export interface PriceEvaluateMultipleResponse { - data: Array; +export interface PriceEvaluatePreviewEventsResponse { + data: Array; } -export namespace PriceEvaluateMultipleResponse { +export namespace PriceEvaluatePreviewEventsResponse { export interface Data { /** * The currency of the price @@ -5961,9 +249,9 @@ export type PriceCreateParams = | PriceCreateParams.NewFloatingMatrixPrice | PriceCreateParams.NewFloatingMatrixWithAllocationPrice | PriceCreateParams.NewFloatingTieredPrice - | PriceCreateParams.NewFloatingTieredBpsPrice - | PriceCreateParams.NewFloatingBpsPrice - | PriceCreateParams.NewFloatingBulkBpsPrice + | PriceCreateParams.NewFloatingTieredBPSPrice + | PriceCreateParams.NewFloatingBPSPrice + | PriceCreateParams.NewFloatingBulkBPSPrice | PriceCreateParams.NewFloatingBulkPrice | PriceCreateParams.NewFloatingThresholdTotalAmountPrice | PriceCreateParams.NewFloatingTieredPackagePrice @@ -6009,7 +297,7 @@ export declare namespace PriceCreateParams { */ name: string; - unit_config: NewFloatingUnitPrice.UnitConfig; + unit_config: Shared.UnitConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -6027,17 +315,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6059,7 +352,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6069,68 +362,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingPackagePrice { /** * The cadence to bill for this price on. @@ -6154,7 +385,7 @@ export declare namespace PriceCreateParams { */ name: string; - package_config: NewFloatingPackagePrice.PackageConfig; + package_config: Shared.PackageConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -6172,17 +403,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6204,7 +440,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6214,74 +450,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingMatrixPrice { /** * The cadence to bill for this price on. @@ -6298,7 +466,7 @@ export declare namespace PriceCreateParams { */ item_id: string; - matrix_config: NewFloatingMatrixPrice.MatrixConfig; + matrix_config: Shared.MatrixConfig; model_type: 'matrix'; @@ -6323,17 +491,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6355,7 +528,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6365,94 +538,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingMatrixWithAllocationPrice { /** * The cadence to bill for this price on. @@ -6469,7 +554,7 @@ export declare namespace PriceCreateParams { */ item_id: string; - matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; model_type: 'matrix_with_allocation'; @@ -6494,17 +579,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6526,107 +616,14 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. + * by setting `metadata` to `null`. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + metadata?: Record | null; } export interface NewFloatingTieredPrice { @@ -6652,7 +649,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_config: NewFloatingTieredPrice.TieredConfig; + tiered_config: Shared.TieredConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -6670,17 +667,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6702,7 +704,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6712,88 +714,7 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredBpsPrice { + export interface NewFloatingTieredBPSPrice { /** * The cadence to bill for this price on. */ @@ -6816,7 +737,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; + tiered_bps_config: Shared.TieredBPSConfig; /** * The id of the billable metric for the price. Only needed if the price is @@ -6834,17 +755,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -6866,7 +792,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6876,95 +802,8 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBpsPrice { - bps_config: NewFloatingBpsPrice.BpsConfig; + export interface NewFloatingBPSPrice { + bps_config: Shared.BPSConfig; /** * The cadence to bill for this price on. @@ -7004,17 +843,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7036,7 +880,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7046,75 +890,8 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkBpsPrice { - bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; + export interface NewFloatingBulkBPSPrice { + bulk_bps_config: Shared.BulkBPSConfig; /** * The cadence to bill for this price on. @@ -7154,17 +931,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7186,7 +968,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7196,90 +978,8 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingBulkPrice { - bulk_config: NewFloatingBulkPrice.BulkConfig; + bulk_config: Shared.BulkConfig; /** * The cadence to bill for this price on. @@ -7319,17 +1019,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7351,7 +1056,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7361,82 +1066,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingThresholdTotalAmountPrice { /** * The cadence to bill for this price on. @@ -7478,17 +1107,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7510,7 +1144,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7520,61 +1154,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingTieredPackagePrice { /** * The cadence to bill for this price on. @@ -7616,17 +1195,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7648,7 +1232,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7658,61 +1242,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingGroupedTieredPrice { /** * The cadence to bill for this price on. @@ -7754,17 +1283,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7786,7 +1320,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7796,61 +1330,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingMaxGroupTieredPackagePrice { /** * The cadence to bill for this price on. @@ -7892,17 +1371,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -7924,7 +1408,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7934,61 +1418,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingTieredWithMinimumPrice { /** * The cadence to bill for this price on. @@ -8030,17 +1459,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8062,7 +1496,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8072,61 +1506,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingPackageWithAllocationPrice { /** * The cadence to bill for this price on. @@ -8168,17 +1547,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * The per unit conversion rate of the price currency to the invoicing currency. */ - conversion_rate?: number | null; + 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; /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8200,7 +1584,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8210,61 +1594,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingTieredPackageWithMinimumPrice { /** * The cadence to bill for this price on. @@ -8306,17 +1635,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8338,7 +1672,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8348,61 +1682,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingUnitWithPercentPrice { /** * The cadence to bill for this price on. @@ -8444,17 +1723,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8476,7 +1760,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8486,61 +1770,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingTieredWithProrationPrice { /** * The cadence to bill for this price on. @@ -8582,17 +1811,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8614,7 +1848,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8624,61 +1858,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingTieredWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingUnitWithProrationPrice { /** * The cadence to bill for this price on. @@ -8720,17 +1899,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8752,7 +1936,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8762,61 +1946,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingGroupedAllocationPrice { /** * The cadence to bill for this price on. @@ -8858,17 +1987,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -8890,7 +2024,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8900,61 +2034,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingGroupedWithProratedMinimumPrice { /** * The cadence to bill for this price on. @@ -8996,17 +2075,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9028,7 +2112,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9038,61 +2122,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingGroupedWithMeteredMinimumPrice { /** * The cadence to bill for this price on. @@ -9134,17 +2163,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9166,7 +2200,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9176,61 +2210,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingMatrixWithDisplayNamePrice { /** * The cadence to bill for this price on. @@ -9272,17 +2251,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9304,7 +2288,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9314,61 +2298,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingBulkWithProrationPrice { bulk_with_proration_config: Record; @@ -9410,17 +2339,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9442,7 +2376,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9452,61 +2386,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingGroupedTieredPackagePrice { /** * The cadence to bill for this price on. @@ -9548,17 +2427,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9567,82 +2451,27 @@ export declare namespace PriceCreateParams { /** * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. + * applied. */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + fixed_price_quantity?: number | null; /** - * For dimensional price: specifies a price group and dimension values + * The property used to group this price on an invoice */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } + invoice_grouping_key?: string | null; /** * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; } export interface NewFloatingScalableMatrixWithUnitPricingPrice { @@ -9686,17 +2515,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9718,7 +2552,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9728,61 +2562,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingScalableMatrixWithTieredPricingPrice { /** * The cadence to bill for this price on. @@ -9824,17 +2603,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9856,7 +2640,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9866,61 +2650,6 @@ export declare namespace PriceCreateParams { metadata?: Record | null; } - export namespace NewFloatingScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - export interface NewFloatingCumulativeGroupedBulkPrice { /** * The cadence to bill for this price on. @@ -9962,17 +2691,22 @@ export declare namespace PriceCreateParams { * For custom cadence: specifies the duration of the billing period in days or * months. */ - billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; + 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; + /** * For dimensional price: specifies a price group and dimension values */ - dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** * An alias for the price. @@ -9994,7 +2728,7 @@ export declare namespace PriceCreateParams { * Within each billing cycle, specifies the cadence at which invoices are produced. * If unspecified, a single invoice is produced per billing cycle. */ - invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -10003,61 +2737,6 @@ export declare namespace PriceCreateParams { */ metadata?: Record | null; } - - export namespace NewFloatingCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } } export interface PriceUpdateParams { @@ -10124,9 +2803,94 @@ export interface PriceEvaluateMultipleParams { customer_id?: string | null; /** - * Optional list of preview events to use instead of actual usage data (max 500) + * The external customer ID of the customer to which this evaluation is scoped. + */ + external_customer_id?: string | null; + + /** + * List of prices to evaluate (max 100) + */ + price_evaluations?: Array; +} + +export namespace PriceEvaluateMultipleParams { + export interface PriceEvaluation { + /** + * A boolean + * [computed property](/extensibility/advanced-metrics#computed-properties) used to + * filter the underlying billable metric + */ + filter?: string | null; + + /** + * Properties (or + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used + * to group the underlying billable metric + */ + grouping_keys?: Array; + + /** + * An inline price definition to evaluate, allowing you to test price + * configurations before adding them to Orb. + */ + price?: + | Shared.NewFloatingUnitPrice + | Shared.NewFloatingPackagePrice + | Shared.NewFloatingMatrixPrice + | Shared.NewFloatingMatrixWithAllocationPrice + | Shared.NewFloatingTieredPrice + | Shared.NewFloatingTieredBPSPrice + | Shared.NewFloatingBPSPrice + | Shared.NewFloatingBulkBPSPrice + | Shared.NewFloatingBulkPrice + | Shared.NewFloatingThresholdTotalAmountPrice + | Shared.NewFloatingTieredPackagePrice + | Shared.NewFloatingGroupedTieredPrice + | Shared.NewFloatingMaxGroupTieredPackagePrice + | Shared.NewFloatingTieredWithMinimumPrice + | Shared.NewFloatingPackageWithAllocationPrice + | Shared.NewFloatingTieredPackageWithMinimumPrice + | Shared.NewFloatingUnitWithPercentPrice + | Shared.NewFloatingTieredWithProrationPrice + | Shared.NewFloatingUnitWithProrationPrice + | Shared.NewFloatingGroupedAllocationPrice + | Shared.NewFloatingGroupedWithProratedMinimumPrice + | Shared.NewFloatingGroupedWithMeteredMinimumPrice + | Shared.NewFloatingMatrixWithDisplayNamePrice + | Shared.NewFloatingBulkWithProrationPrice + | Shared.NewFloatingGroupedTieredPackagePrice + | Shared.NewFloatingScalableMatrixWithUnitPricingPrice + | Shared.NewFloatingScalableMatrixWithTieredPricingPrice + | Shared.NewFloatingCumulativeGroupedBulkPrice + | null; + + /** + * The ID of a price to evaluate that exists in your Orb account. + */ + price_id?: string | null; + } +} + +export interface PriceEvaluatePreviewEventsParams { + /** + * The exclusive upper bound for event timestamps + */ + timeframe_end: string; + + /** + * The inclusive lower bound for event timestamps + */ + timeframe_start: string; + + /** + * The ID of the customer to which this evaluation is scoped. + */ + customer_id?: string | null; + + /** + * List of preview events to use instead of actual usage data */ - events?: Array | null; + events?: Array; /** * The external customer ID of the customer to which this evaluation is scoped. @@ -10136,10 +2900,10 @@ export interface PriceEvaluateMultipleParams { /** * List of prices to evaluate (max 100) */ - price_evaluations?: Array; + price_evaluations?: Array; } -export namespace PriceEvaluateMultipleParams { +export namespace PriceEvaluatePreviewEventsParams { export interface Event { /** * A name to meaningfully identify the action or event type. @@ -10191,34 +2955,34 @@ export namespace PriceEvaluateMultipleParams { * configurations before adding them to Orb. */ price?: - | PriceEvaluation.NewFloatingUnitPrice - | PriceEvaluation.NewFloatingPackagePrice - | PriceEvaluation.NewFloatingMatrixPrice - | PriceEvaluation.NewFloatingMatrixWithAllocationPrice - | PriceEvaluation.NewFloatingTieredPrice - | PriceEvaluation.NewFloatingTieredBpsPrice - | PriceEvaluation.NewFloatingBpsPrice - | PriceEvaluation.NewFloatingBulkBpsPrice - | PriceEvaluation.NewFloatingBulkPrice - | PriceEvaluation.NewFloatingThresholdTotalAmountPrice - | PriceEvaluation.NewFloatingTieredPackagePrice - | PriceEvaluation.NewFloatingGroupedTieredPrice - | PriceEvaluation.NewFloatingMaxGroupTieredPackagePrice - | PriceEvaluation.NewFloatingTieredWithMinimumPrice - | PriceEvaluation.NewFloatingPackageWithAllocationPrice - | PriceEvaluation.NewFloatingTieredPackageWithMinimumPrice - | PriceEvaluation.NewFloatingUnitWithPercentPrice - | PriceEvaluation.NewFloatingTieredWithProrationPrice - | PriceEvaluation.NewFloatingUnitWithProrationPrice - | PriceEvaluation.NewFloatingGroupedAllocationPrice - | PriceEvaluation.NewFloatingGroupedWithProratedMinimumPrice - | PriceEvaluation.NewFloatingGroupedWithMeteredMinimumPrice - | PriceEvaluation.NewFloatingMatrixWithDisplayNamePrice - | PriceEvaluation.NewFloatingBulkWithProrationPrice - | PriceEvaluation.NewFloatingGroupedTieredPackagePrice - | PriceEvaluation.NewFloatingScalableMatrixWithUnitPricingPrice - | PriceEvaluation.NewFloatingScalableMatrixWithTieredPricingPrice - | PriceEvaluation.NewFloatingCumulativeGroupedBulkPrice + | Shared.NewFloatingUnitPrice + | Shared.NewFloatingPackagePrice + | Shared.NewFloatingMatrixPrice + | Shared.NewFloatingMatrixWithAllocationPrice + | Shared.NewFloatingTieredPrice + | Shared.NewFloatingTieredBPSPrice + | Shared.NewFloatingBPSPrice + | Shared.NewFloatingBulkBPSPrice + | Shared.NewFloatingBulkPrice + | Shared.NewFloatingThresholdTotalAmountPrice + | Shared.NewFloatingTieredPackagePrice + | Shared.NewFloatingGroupedTieredPrice + | Shared.NewFloatingMaxGroupTieredPackagePrice + | Shared.NewFloatingTieredWithMinimumPrice + | Shared.NewFloatingPackageWithAllocationPrice + | Shared.NewFloatingTieredPackageWithMinimumPrice + | Shared.NewFloatingUnitWithPercentPrice + | Shared.NewFloatingTieredWithProrationPrice + | Shared.NewFloatingUnitWithProrationPrice + | Shared.NewFloatingGroupedAllocationPrice + | Shared.NewFloatingGroupedWithProratedMinimumPrice + | Shared.NewFloatingGroupedWithMeteredMinimumPrice + | Shared.NewFloatingMatrixWithDisplayNamePrice + | Shared.NewFloatingBulkWithProrationPrice + | Shared.NewFloatingGroupedTieredPackagePrice + | Shared.NewFloatingScalableMatrixWithUnitPricingPrice + | Shared.NewFloatingScalableMatrixWithTieredPricingPrice + | Shared.NewFloatingCumulativeGroupedBulkPrice | null; /** @@ -10226,4098 +2990,22 @@ export namespace PriceEvaluateMultipleParams { */ price_id?: string | null; } - - export namespace PriceEvaluation { - export interface NewFloatingUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewFloatingUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewFloatingPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewFloatingMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewFloatingTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBpsPrice { - bps_config: NewFloatingBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkBpsPrice { - bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkPrice { - bulk_config: NewFloatingBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } } -Prices.PricesPage = PricesPage; Prices.ExternalPriceID = ExternalPriceID; export declare namespace Prices { export { type EvaluatePriceGroup as EvaluatePriceGroup, - type Price as Price, type PriceEvaluateResponse as PriceEvaluateResponse, type PriceEvaluateMultipleResponse as PriceEvaluateMultipleResponse, - PricesPage as PricesPage, + type PriceEvaluatePreviewEventsResponse as PriceEvaluatePreviewEventsResponse, type PriceCreateParams as PriceCreateParams, type PriceUpdateParams as PriceUpdateParams, type PriceListParams as PriceListParams, type PriceEvaluateParams as PriceEvaluateParams, type PriceEvaluateMultipleParams as PriceEvaluateMultipleParams, + type PriceEvaluatePreviewEventsParams as PriceEvaluatePreviewEventsParams, }; export { @@ -14325,3 +3013,5 @@ export declare namespace Prices { type ExternalPriceIDUpdateParams as ExternalPriceIDUpdateParams, }; } + +export { PricesPage }; diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 4086be64..15dbe2e1 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,50 +1,9551 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import * as Shared from './shared'; +import { Page } from '../pagination'; + +export interface Address { + city: string | null; + + country: string | null; + + line1: string | null; + + line2: string | null; + + postal_code: string | null; + + state: string | null; +} + +export interface AdjustmentInterval { + id: string; + + adjustment: + | PlanPhaseUsageDiscountAdjustment + | PlanPhaseAmountDiscountAdjustment + | PlanPhasePercentageDiscountAdjustment + | PlanPhaseMinimumAdjustment + | PlanPhaseMaximumAdjustment; + + /** + * The price interval IDs that this adjustment applies to. + */ + applies_to_price_interval_ids: Array; + + /** + * The end date of the adjustment interval. + */ + end_date: string | null; + + /** + * The start date of the adjustment interval. + */ + start_date: string; +} + +export interface AggregatedCost { + per_price_costs: Array; + + /** + * Total costs for the timeframe, excluding any minimums and discounts. + */ + subtotal: string; + + timeframe_end: string; + + timeframe_start: string; + + /** + * Total costs for the timeframe, including any minimums and discounts. + */ + total: string; +} + +export interface Allocation { + allows_rollover: boolean; + + currency: string; + + custom_expiration: CustomExpiration | null; +} + export interface AmountDiscount { /** - * Only available if discount_type is `amount`. + * Only available if discount_type is `amount`. + */ + amount_discount: string; + + discount_type: 'amount'; + + /** + * List of price_ids that this discount applies to. For plan/plan phase discounts, + * this can be a subset of prices. + */ + applies_to_price_ids?: Array | null; + + /** + * The filters that determine which prices to apply this discount to. + */ + filters?: Array | null; + + reason?: string | null; +} + +export interface AmountDiscountInterval { + /** + * Only available if discount_type is `amount`. + */ + amount_discount: string; + + /** + * The price interval ids that this discount interval applies to. + */ + applies_to_price_interval_ids: Array; + + discount_type: 'amount'; + + /** + * The end date of the discount interval. + */ + end_date: string | null; + + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + + /** + * The start date of the discount interval. + */ + start_date: string; +} + +export interface BillableMetricTiny { + id: string; +} + +export interface BillingCycleAnchorConfiguration { + /** + * The day of the month on which the billing cycle is anchored. If the maximum + * number of days in a month is greater than this value, the last day of the month + * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + * period begins on the 30th. + */ + day: number; + + /** + * The month on which the billing cycle is anchored (e.g. a quarterly price + * anchored in February would have cycles starting February, May, August, and + * November). + */ + month?: number | null; + + /** + * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle + * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + */ + year?: number | null; +} + +export interface BillingCycleConfiguration { + duration: number; + + duration_unit: 'day' | 'month'; +} + +export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term'; + +export interface BPSConfig { + /** + * Basis point take rate per event + */ + bps: number; + + /** + * Optional currency amount maximum to cap spend per event + */ + per_unit_maximum?: string | null; +} + +export interface BPSTier { + /** + * Per-event basis point rate + */ + bps: number; + + /** + * Exclusive tier starting value + */ + minimum_amount: string; + + /** + * Inclusive tier ending value + */ + maximum_amount?: string | null; + + /** + * Per unit maximum to charge + */ + per_unit_maximum?: string | null; +} + +export interface BulkBPSConfig { + /** + * Tiers for a bulk BPS pricing model where all usage is aggregated to a single + * tier based on total volume + */ + tiers: Array; +} + +export interface BulkBPSTier { + /** + * Basis points to rate on + */ + bps: number; + + /** + * Upper bound for tier + */ + maximum_amount?: string | null; + + /** + * The maximum amount to charge for any one event + */ + per_unit_maximum?: string | null; +} + +export interface BulkConfig { + /** + * Bulk tiers for rating based on total usage volume + */ + tiers: Array; +} + +export interface BulkTier { + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Upper bound for this tier + */ + maximum_units?: number | null; +} + +export interface ChangedSubscriptionResources { + /** + * The credit notes that were created as part of this operation. + */ + created_credit_notes: Array; + + /** + * The invoices that were created as part of this operation. + */ + created_invoices: Array; + + /** + * The credit notes that were voided as part of this operation. + */ + voided_credit_notes: Array; + + /** + * The invoices that were voided as part of this operation. + */ + voided_invoices: Array; +} + +export interface ConversionRateTier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit of overage + */ + unit_amount: string; + + /** + * Inclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; +} + +export interface ConversionRateTieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; +} + +export interface ConversionRateUnitConfig { + /** + * Amount per unit of overage + */ + unit_amount: string; +} + +export interface CouponRedemption { + coupon_id: string; + + end_date: string | null; + + start_date: string; +} + +/** + * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has + * been applied to a particular invoice. + */ +export interface CreditNote { + /** + * The Orb id of this credit note. + */ + id: string; + + /** + * The creation time of the resource in Orb. + */ + created_at: string; + + /** + * The unique identifier for credit notes. + */ + credit_note_number: string; + + /** + * A URL to a PDF of the credit note. + */ + credit_note_pdf: string | null; + + customer: CustomerMinified; + + /** + * The id of the invoice resource that this credit note is applied to. + */ + invoice_id: string; + + /** + * All of the line items associated with this credit note. + */ + line_items: Array; + + /** + * The maximum amount applied on the original invoice + */ + maximum_amount_adjustment: CreditNote.MaximumAmountAdjustment | null; + + /** + * An optional memo supplied on the credit note. + */ + memo: string | null; + + /** + * Any credited amount from the applied minimum on the invoice. + */ + minimum_amount_refunded: string | null; + + reason: 'Duplicate' | 'Fraudulent' | 'Order change' | 'Product unsatisfactory' | null; + + /** + * The total prior to any creditable invoice-level discounts or minimums. + */ + subtotal: string; + + /** + * The total including creditable invoice-level discounts or minimums, and tax. + */ + total: string; + + type: 'refund' | 'adjustment'; + + /** + * The time at which the credit note was voided in Orb, if applicable. + */ + voided_at: string | null; + + /** + * Any discounts applied on the original invoice. + */ + discounts?: Array; +} + +export namespace CreditNote { + export interface LineItem { + /** + * The Orb id of this resource. + */ + id: string; + + /** + * The amount of the line item, including any line item minimums and discounts. + */ + amount: string; + + /** + * The id of the item associated with this line item. + */ + item_id: string; + + /** + * The name of the corresponding invoice line item. + */ + name: string; + + /** + * An optional quantity credited. + */ + quantity: number | null; + + /** + * The amount of the line item, excluding any line item minimums and discounts. + */ + subtotal: string; + + /** + * Any tax amounts applied onto the line item. + */ + tax_amounts: Array; + + /** + * Any line item discounts from the invoice's line item. + */ + discounts?: Array; + } + + export namespace LineItem { + export interface Discount { + id: string; + + amount_applied: string; + + applies_to_price_ids: Array; + + discount_type: 'percentage' | 'amount'; + + percentage_discount: number; + + amount_discount?: string | null; + + reason?: string | null; + } + } + + /** + * The maximum amount applied on the original invoice + */ + export interface MaximumAmountAdjustment { + amount_applied: string; + + discount_type: 'percentage'; + + percentage_discount: number; + + applies_to_prices?: Array | null; + + reason?: string | null; + } + + export namespace MaximumAmountAdjustment { + export interface AppliesToPrice { + id: string; + + name: string; + } + } + + export interface Discount { + amount_applied: string; + + discount_type: 'percentage'; + + percentage_discount: number; + + applies_to_prices?: Array | null; + + reason?: string | null; + } + + export namespace Discount { + export interface AppliesToPrice { + id: string; + + name: string; + } + } +} + +export interface CreditNoteTiny { + /** + * The id of the Credit note + */ + id: string; +} + +export interface CustomExpiration { + duration: number; + + duration_unit: 'day' | 'month'; +} + +export interface CustomerMinified { + id: string; + + external_customer_id: string | null; +} + +/** + * 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 | + * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + * | Andorra | `ad_nrt` | Andorran NRT Number | + * | Argentina | `ar_cuit` | Argentinian Tax ID Number | + * | Australia | `au_abn` | Australian Business Number (AU ABN) | + * | Australia | `au_arn` | Australian Taxation Office Reference Number | + * | Austria | `eu_vat` | European VAT Number | + * | Bahrain | `bh_vat` | Bahraini VAT Number | + * | Belgium | `eu_vat` | European VAT Number | + * | Bolivia | `bo_tin` | Bolivian Tax ID | + * | 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 | + * | 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) | + * | Chile | `cl_tin` | Chilean TIN | + * | China | `cn_tin` | Chinese Tax ID | + * | Colombia | `co_nit` | Colombian NIT Number | + * | Costa Rica | `cr_tin` | Costa Rican Tax ID | + * | Croatia | `eu_vat` | European VAT Number | + * | 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 | + * | EU | `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 | `eu_vat` | European VAT Number | + * | Greece | `eu_vat` | European VAT Number | + * | 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 | + * | Latvia | `eu_vat` | European VAT Number | + * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | + * | Mexico | `mx_rfc` | Mexican RFC Number | + * | Netherlands | `eu_vat` | European VAT Number | + * | New Zealand | `nz_gst` | New Zealand GST Number | + * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | + * | 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 | + * | 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 | + * | Sweden | `eu_vat` | European VAT Number | + * | Switzerland | `ch_vat` | Switzerland VAT Number | + * | Taiwan | `tw_vat` | Taiwanese VAT | + * | Thailand | `th_vat` | Thai VAT | + * | Turkey | `tr_tin` | Turkish Tax Identification Number | + * | Ukraine | `ua_vat` | Ukrainian VAT | + * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + * | United Kingdom | `gb_vat` | United Kingdom VAT Number | + * | United States | `us_ein` | United States EIN | + * | Uruguay | `uy_ruc` | Uruguayan RUC Number | + * | Venezuela | `ve_rif` | Venezuelan RIF Number | + * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + */ +export interface CustomerTaxID { + country: + | 'AD' + | 'AE' + | 'AR' + | 'AT' + | 'AU' + | 'BE' + | 'BG' + | 'BH' + | 'BO' + | 'BR' + | 'CA' + | 'CH' + | 'CL' + | 'CN' + | 'CO' + | 'CR' + | 'CY' + | 'CZ' + | 'DE' + | 'DK' + | 'EE' + | 'DO' + | 'EC' + | 'EG' + | 'ES' + | 'EU' + | 'FI' + | 'FR' + | 'GB' + | 'GE' + | 'GR' + | 'HK' + | 'HR' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IN' + | 'IS' + | 'IT' + | 'JP' + | 'KE' + | 'KR' + | 'KZ' + | 'LI' + | 'LT' + | 'LU' + | 'LV' + | 'MT' + | 'MX' + | 'MY' + | 'NG' + | 'NL' + | 'NO' + | 'NZ' + | 'OM' + | 'PE' + | 'PH' + | 'PL' + | 'PT' + | 'RO' + | 'RS' + | 'RU' + | 'SA' + | 'SE' + | 'SG' + | 'SI' + | 'SK' + | 'SV' + | 'TH' + | 'TR' + | 'TW' + | 'UA' + | 'US' + | 'UY' + | 'VE' + | 'VN' + | 'ZA'; + + type: + | 'ad_nrt' + | 'ae_trn' + | 'ar_cuit' + | 'eu_vat' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'bh_vat' + | 'bo_tin' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'cn_tin' + | 'co_nit' + | 'cr_tin' + | 'do_rcn' + | 'ec_ruc' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'kz_bin' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'ng_tin' + | 'no_vat' + | 'no_voec' + | 'nz_gst' + | 'om_vat' + | 'pe_ruc' + | 'ph_tin' + | 'ro_tin' + | 'rs_pib' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'sv_nit' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'uy_ruc' + | 've_rif' + | 'vn_tin' + | 'za_vat'; + + value: string; +} + +export interface DimensionalPriceConfiguration { + dimension_values: Array; + + dimensional_price_group_id: string; +} + +export type Discount = PercentageDiscount | TrialDiscount | UsageDiscount | AmountDiscount; + +export interface FixedFeeQuantityScheduleEntry { + end_date: string | null; + + price_id: string; + + quantity: number; + + start_date: string; +} + +export interface FixedFeeQuantityTransition { + effective_date: string; + + price_id: string; + + quantity: number; +} + +/** + * 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 interface Invoice { + 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: Invoice.AutoCollection; + + billing_address: 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: 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 | + * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + * | Andorra | `ad_nrt` | Andorran NRT Number | + * | Argentina | `ar_cuit` | Argentinian Tax ID Number | + * | Australia | `au_abn` | Australian Business Number (AU ABN) | + * | Australia | `au_arn` | Australian Taxation Office Reference Number | + * | Austria | `eu_vat` | European VAT Number | + * | Bahrain | `bh_vat` | Bahraini VAT Number | + * | Belgium | `eu_vat` | European VAT Number | + * | Bolivia | `bo_tin` | Bolivian Tax ID | + * | 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 | + * | 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) | + * | Chile | `cl_tin` | Chilean TIN | + * | China | `cn_tin` | Chinese Tax ID | + * | Colombia | `co_nit` | Colombian NIT Number | + * | Costa Rica | `cr_tin` | Costa Rican Tax ID | + * | Croatia | `eu_vat` | European VAT Number | + * | 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 | + * | EU | `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 | `eu_vat` | European VAT Number | + * | Greece | `eu_vat` | European VAT Number | + * | 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 | + * | Latvia | `eu_vat` | European VAT Number | + * | Liechtenstein | `li_uid` | Liechtensteinian UID 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 | + * | Mexico | `mx_rfc` | Mexican RFC Number | + * | Netherlands | `eu_vat` | European VAT Number | + * | New Zealand | `nz_gst` | New Zealand GST Number | + * | Nigeria | `ng_tin` | Nigerian Tax Identification 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 | + * | 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 | + * | 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 | + * | Sweden | `eu_vat` | European VAT Number | + * | Switzerland | `ch_vat` | Switzerland VAT Number | + * | Taiwan | `tw_vat` | Taiwanese VAT | + * | Thailand | `th_vat` | Thai VAT | + * | Turkey | `tr_tin` | Turkish Tax Identification Number | + * | Ukraine | `ua_vat` | Ukrainian VAT | + * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + * | United Kingdom | `eu_vat` | Northern Ireland VAT Number | + * | United Kingdom | `gb_vat` | United Kingdom VAT Number | + * | United States | `us_ein` | United States EIN | + * | Uruguay | `uy_ruc` | Uruguayan RUC Number | + * | Venezuela | `ve_rif` | Venezuelan RIF Number | + * | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + */ + customer_tax_id: CustomerTaxID | null; + + /** + * @deprecated This field is deprecated in favor of `discounts`. If a `discounts` + * list is provided, the first discount in the list will be returned. If the list + * is empty, `None` will be returned. + */ + discount: unknown; + + discounts: Array; + + /** + * 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; + + /** + * The breakdown of prices in this invoice. + */ + line_items: Array; + + maximum: Maximum | null; + + maximum_amount: 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: Record; + + minimum: Minimum | null; + + minimum_amount: string | null; + + /** + * 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: Address | null; + + status: 'issued' | 'paid' | 'synced' | 'void' | 'draft'; + + subscription: SubscriptionMinified | null; + + /** + * The total before any discounts and minimums are applied. + */ + subtotal: string; + + /** + * 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 Invoice { + 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'; + + /** + * 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 LineItem { + /** + * A unique ID for this line item. + */ + id: string; + + /** + * The line amount after any adjustments and before overage conversion, credits and + * partial invoicing. + */ + adjusted_subtotal: string; + + /** + * All adjustments applied to the line item in the order they were applied based on + * invoice calculations (ie. usage discounts -> amount discounts -> percentage + * discounts -> minimums -> maximums). + */ + adjustments: Array< + | Shared.MonetaryUsageDiscountAdjustment + | Shared.MonetaryAmountDiscountAdjustment + | Shared.MonetaryPercentageDiscountAdjustment + | Shared.MonetaryMinimumAdjustment + | Shared.MonetaryMaximumAdjustment + >; + + /** + * The final amount for a line item after all adjustments and pre paid credits have + * been applied. + */ + amount: string; + + /** + * The number of prepaid credits applied. + */ + credits_applied: string; + + discount: Shared.Discount | null; + + /** + * The end date of the range of time applied for this line item's price. + */ + end_date: string; + + /** + * An additional filter that was used to calculate the usage for this line item. + */ + filter: string | null; + + /** + * [DEPRECATED] For configured prices that are split by a grouping key, this will + * be populated with the key and a value. The `amount` and `subtotal` will be the + * values for this particular grouping. + */ + grouping: string | null; + + /** + * @deprecated This field is deprecated in favor of `adjustments`. + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated This field is deprecated in favor of `adjustments`. + */ + maximum_amount: string | null; + + /** + * @deprecated This field is deprecated in favor of `adjustments`. + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated This field is deprecated in favor of `adjustments`. + */ + minimum_amount: string | null; + + /** + * The name of the price associated with this line item. + */ + name: string; + + /** + * Any amount applied from a partial invoice + */ + partially_invoiced_amount: string; + + /** + * 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) + */ + price: Shared.Price; + + /** + * Either the fixed fee quantity or the usage during the service period. + */ + quantity: number; + + /** + * The start date of the range of time applied for this line item's price. + */ + start_date: string; + + /** + * For complex pricing structures, the line item can be broken down further in + * `sub_line_items`. + */ + sub_line_items: Array; + + /** + * The line amount before before any adjustments. + */ + subtotal: string; + + /** + * An array of tax rates and their incurred tax amounts. Empty if no tax + * integration is configured. + */ + tax_amounts: Array; + + /** + * A list of customer ids that were used to calculate the usage for this line item. + */ + usage_customer_ids: Array | null; + } + + 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; + + /** + * Whether the payment attempt succeeded. + */ + succeeded: boolean; + } +} + +export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount; + +export interface InvoiceTiny { + /** + * The Invoice id + */ + id: string; +} + +export interface ItemSlim { + id: string; + + name: string; +} + +export interface MatrixConfig { + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; +} + +export interface MatrixSubLineItem { + /** + * The total amount for this sub line item. + */ + amount: string; + + grouping: SubLineItemGrouping | null; + + matrix_config: SubLineItemMatrixConfig; + + name: string; + + quantity: number; + + type: 'matrix'; +} + +export interface MatrixValue { + /** + * One or two matrix keys to filter usage to this Matrix value by. For example, + * ["region", "tier"] could be used to filter cloud usage by a cloud region and an + * instance tier. + */ + dimension_values: Array; + + /** + * Unit price for the specified dimension_values + */ + unit_amount: string; +} + +export interface MatrixWithAllocationConfig { + /** + * Allocation to be used to calculate the price + */ + allocation: number; + + /** + * Default per unit rate for any usage not bucketed into a specified matrix_value + */ + default_unit_amount: string; + + /** + * One or two event property values to evaluate matrix groups by + */ + dimensions: Array; + + /** + * Matrix values for specified matrix grouping keys + */ + matrix_values: Array; +} + +export interface Maximum { + /** + * @deprecated List of price_ids that this maximum amount applies to. For plan/plan + * phase maximums, this can be a subset of prices. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this maximum to. + */ + filters: Array; + + /** + * Maximum amount applied + */ + maximum_amount: string; +} + +export interface MaximumInterval { + /** + * The price interval ids that this maximum interval applies to. + */ + applies_to_price_interval_ids: Array; + + /** + * The end date of the maximum interval. + */ + end_date: string | null; + + /** + * The filters that determine which prices this maximum interval applies to. + */ + filters: Array; + + /** + * The maximum amount to charge in a given billing period for the price intervals + * this transform applies to. + */ + maximum_amount: string; + + /** + * The start date of the maximum interval. + */ + start_date: string; +} + +export interface Minimum { + /** + * @deprecated List of price_ids that this minimum amount applies to. For plan/plan + * phase minimums, this can be a subset of prices. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this minimum to. + */ + filters: Array; + + /** + * Minimum amount applied + */ + minimum_amount: string; +} + +export interface MinimumInterval { + /** + * The price interval ids that this minimum interval applies to. + */ + applies_to_price_interval_ids: Array; + + /** + * The end date of the minimum interval. + */ + end_date: string | null; + + /** + * The filters that determine which prices this minimum interval applies to. + */ + filters: Array; + + /** + * The minimum amount to charge in a given billing period for the price intervals + * this minimum applies to. + */ + minimum_amount: string; + + /** + * The start date of the minimum interval. + */ + start_date: string; +} + +export interface MonetaryAmountDiscountAdjustment { + id: string; + + adjustment_type: 'amount_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface MonetaryMaximumAdjustment { + id: string; + + adjustment_type: 'maximum'; + + /** + * The value applied by an adjustment. + */ + amount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + maximum_amount: string; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface MonetaryMinimumAdjustment { + id: string; + + adjustment_type: 'minimum'; + + /** + * The value applied by an adjustment. + */ + amount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + minimum_amount: string; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface MonetaryPercentageDiscountAdjustment { + id: string; + + adjustment_type: 'percentage_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface MonetaryUsageDiscountAdjustment { + id: string; + + adjustment_type: 'usage_discount'; + + /** + * The value applied by an adjustment. + */ + amount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The reason for the adjustment. + */ + reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; +} + +export interface NewAllocationPrice { + /** + * An amount of the currency to allocate to the customer at the specified cadence. + */ + amount: string; + + /** + * The cadence at which to allocate the amount to the customer. + */ + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + /** + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. + */ + currency: string; + + /** + * The custom expiration for the allocation. + */ + custom_expiration?: CustomExpiration | null; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. Set to null if using custom_expiration. + */ + expires_at_end_of_cadence?: boolean | null; +} + +export interface NewAmountDiscount { + adjustment_type: 'amount_discount'; + + amount_discount: string; + + /** + * If set, the adjustment will apply to every price on the subscription. + */ + applies_to_all?: true | null; + + /** + * The set of item IDs to which this adjustment applies. + */ + applies_to_item_ids?: Array | null; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; + + /** + * If set, only prices in the specified currency will have the adjustment applied. + */ + currency?: string | null; + + /** + * A list of filters that determine which prices this adjustment will apply to. + */ + filters?: Array | null; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + + /** + * If set, only prices of the specified type will have the adjustment applied. + */ + price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null; +} + +export interface NewBillingCycleConfiguration { + /** + * The duration of the billing period. + */ + duration: number; + + /** + * The unit of billing period duration. + */ + duration_unit: 'day' | 'month'; +} + +export interface NewDimensionalPriceConfiguration { + /** + * The list of dimension values matching (in order) the dimensions of the price + * group + */ + dimension_values: Array; + + /** + * The id of the dimensional price group to include this price in + */ + dimensional_price_group_id?: string | null; + + /** + * The external id of the dimensional price group to include this price in + */ + external_dimensional_price_group_id?: string | null; +} + +export interface NewFloatingBPSPrice { + bps_config: BPSConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bps'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingBulkBPSPrice { + bulk_bps_config: BulkBPSConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk_bps'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingBulkPrice { + bulk_config: BulkConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + cumulative_grouped_bulk_config: Record; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'cumulative_grouped_bulk'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + grouped_allocation_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + grouped_tiered_package_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + grouped_with_metered_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_metered_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + grouped_with_prorated_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_prorated_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingMatrixPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_config: MatrixConfig; + + model_type: 'matrix'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingMatrixWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_with_allocation_config: MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingMatrixWithDisplayNamePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'package'; + + /** + * The name of the price. + */ + name: string; + + package_config: 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?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingPackageWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + package_with_allocation_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingScalableMatrixWithTieredPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_tiered_pricing_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingScalableMatrixWithUnitPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_unit_pricing_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingThresholdTotalAmountPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'threshold_total_amount'; + + /** + * The name of the price. + */ + name: string; + + threshold_total_amount_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredBPSPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_bps'; + + /** + * The name of the price. + */ + name: string; + + tiered_bps_config: TieredBPSConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_package'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredPackageWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_with_minimum_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered'; + + /** + * The name of the price. + */ + name: string; + + tiered_config: 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?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingTieredWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_proration_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingUnitPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit'; + + /** + * The name of the price. + */ + name: string; + + unit_config: 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?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingUnitWithPercentPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + unit_with_percent_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewFloatingUnitWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * An ISO 4217 currency string for which this price is billed in. + */ + currency: string; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + unit_with_proration_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | TieredConversionRateConfig | null; + + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewMaximum { + adjustment_type: 'maximum'; + + maximum_amount: string; + + /** + * If set, the adjustment will apply to every price on the subscription. + */ + applies_to_all?: true | null; + + /** + * The set of item IDs to which this adjustment applies. + */ + applies_to_item_ids?: Array | null; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; + + /** + * If set, only prices in the specified currency will have the adjustment applied. + */ + currency?: string | null; + + /** + * A list of filters that determine which prices this adjustment will apply to. + */ + filters?: Array | null; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + + /** + * If set, only prices of the specified type will have the adjustment applied. + */ + price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null; +} + +export interface NewMinimum { + adjustment_type: 'minimum'; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + minimum_amount: string; + + /** + * If set, the adjustment will apply to every price on the subscription. + */ + applies_to_all?: true | null; + + /** + * The set of item IDs to which this adjustment applies. + */ + applies_to_item_ids?: Array | null; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; + + /** + * If set, only prices in the specified currency will have the adjustment applied. + */ + currency?: string | null; + + /** + * A list of filters that determine which prices this adjustment will apply to. + */ + filters?: Array | null; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + + /** + * If set, only prices of the specified type will have the adjustment applied. + */ + price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null; +} + +export interface NewPercentageDiscount { + adjustment_type: 'percentage_discount'; + + percentage_discount: number; + + /** + * If set, the adjustment will apply to every price on the subscription. + */ + applies_to_all?: true | null; + + /** + * The set of item IDs to which this adjustment applies. + */ + applies_to_item_ids?: Array | null; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; + + /** + * If set, only prices in the specified currency will have the adjustment applied. + */ + currency?: string | null; + + /** + * A list of filters that determine which prices this adjustment will apply to. + */ + filters?: Array | null; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + + /** + * If set, only prices of the specified type will have the adjustment applied. + */ + price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null; +} + +export interface NewPlanBPSPrice { + bps_config: BPSConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bps'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanBulkBPSPrice { + bulk_bps_config: BulkBPSConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk_bps'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanBulkPrice { + bulk_config: BulkConfig; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanBulkWithProrationPrice { + bulk_with_proration_config: Record; + + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bulk_with_proration'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + cumulative_grouped_bulk_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'cumulative_grouped_bulk'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_allocation_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_package_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_tiered_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_tiered'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanGroupedWithMeteredMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_metered_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_metered_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + grouped_with_prorated_minimum_config: Record; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'grouped_with_prorated_minimum'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanMatrixPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_config: MatrixConfig; + + model_type: 'matrix'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanMatrixWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_with_allocation_config: MatrixWithAllocationConfig; + + model_type: 'matrix_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanMatrixWithDisplayNamePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + matrix_with_display_name_config: Record; + + model_type: 'matrix_with_display_name'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + max_group_tiered_package_config: Record; + + model_type: 'max_group_tiered_package'; + + /** + * The name of the price. + */ + name: string; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'package'; + + /** + * The name of the price. + */ + name: string; + + package_config: 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?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanPackageWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'package_with_allocation'; + + /** + * The name of the price. + */ + name: string; + + package_with_allocation_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanScalableMatrixWithTieredPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'scalable_matrix_with_tiered_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_tiered_pricing_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanScalableMatrixWithUnitPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'scalable_matrix_with_unit_pricing'; + + /** + * The name of the price. + */ + name: string; + + scalable_matrix_with_unit_pricing_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanThresholdTotalAmountPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'threshold_total_amount'; + + /** + * The name of the price. + */ + name: string; + + threshold_total_amount_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTierWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_proration'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_proration_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTieredBPSPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_bps'; + + /** + * The name of the price. + */ + name: string; + + tiered_bps_config: TieredBPSConfig; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_package'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTieredPackageWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_package_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_package_with_minimum_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered'; + + /** + * The name of the price. + */ + name: string; + + tiered_config: 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?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'tiered_with_minimum'; + + /** + * The name of the price. + */ + name: string; + + tiered_with_minimum_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanUnitPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit'; + + /** + * The name of the price. + */ + name: string; + + unit_config: 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?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanUnitWithPercentPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit_with_percent'; + + /** + * The name of the price. + */ + name: string; + + unit_with_percent_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewPlanUnitWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; + + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'unit_with_proration'; + + /** + * The name of the price. + */ + name: string; + + unit_with_proration_config: Record; + + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; + + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; + + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: 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?: UnitConversionRateConfig | 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?: 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?: NewBillingCycleConfiguration | null; + + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; +} + +export interface NewUsageDiscount { + adjustment_type: 'usage_discount'; + + usage_discount: number; + + /** + * If set, the adjustment will apply to every price on the subscription. + */ + applies_to_all?: true | null; + + /** + * The set of item IDs to which this adjustment applies. + */ + applies_to_item_ids?: Array | null; + + /** + * The set of price IDs to which this adjustment applies. + */ + applies_to_price_ids?: Array | null; + + /** + * If set, only prices in the specified currency will have the adjustment applied. + */ + currency?: string | null; + + /** + * A list of filters that determine which prices this adjustment will apply to. + */ + filters?: Array | null; + + /** + * When false, this adjustment will be applied to a single price. Otherwise, it + * will be applied at the invoice level, possibly to multiple prices. + */ + is_invoice_level?: boolean; + + /** + * If set, only prices of the specified type will have the adjustment applied. + */ + price_type?: 'usage' | 'fixed_in_advance' | 'fixed_in_arrears' | 'fixed' | 'in_arrears' | null; +} + +export interface OtherSubLineItem { + /** + * The total amount for this sub line item. + */ + amount: string; + + grouping: SubLineItemGrouping | null; + + name: string; + + quantity: number; + + type: "'null'"; +} + +export interface PackageConfig { + /** + * A currency amount to rate usage by + */ + package_amount: string; + + /** + * An integer amount to represent package size. For example, 1000 here would divide + * usage by 1000 before multiplying by package_amount in rating + */ + package_size: number; +} + +export interface PaginationMetadata { + has_more: boolean; + + next_cursor: string | null; +} + +export interface PerPriceCost { + /** + * The price object + */ + price: Price; + + /** + * The price the cost is associated with + */ + price_id: string; + + /** + * Price's contributions for the timeframe, excluding any minimums and discounts. + */ + subtotal: string; + + /** + * Price's contributions for the timeframe, including minimums and discounts. + */ + total: string; + + /** + * The price's quantity for the timeframe + */ + quantity?: number | null; +} + +export interface PercentageDiscount { + discount_type: 'percentage'; + + /** + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. + */ + percentage_discount: number; + + /** + * List of price_ids that this discount applies to. For plan/plan phase discounts, + * this can be a subset of prices. + */ + applies_to_price_ids?: Array | null; + + /** + * The filters that determine which prices to apply this discount to. + */ + filters?: Array | null; + + reason?: string | null; +} + +export interface PercentageDiscountInterval { + /** + * The price interval ids that this discount interval applies to. + */ + applies_to_price_interval_ids: Array; + + discount_type: 'percentage'; + + /** + * The end date of the discount interval. + */ + end_date: string | null; + + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + + /** + * Only available if discount_type is `percentage`.This is a number between 0 + * and 1. + */ + percentage_discount: number; + + /** + * The start date of the discount interval. + */ + start_date: string; +} + +export interface PlanPhaseAmountDiscountAdjustment { + id: string; + + adjustment_type: 'amount_discount'; + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + amount_discount: string; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface PlanPhaseMaximumAdjustment { + id: string; + + adjustment_type: 'maximum'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + maximum_amount: string; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface PlanPhaseMinimumAdjustment { + id: string; + + adjustment_type: 'minimum'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The item ID that revenue from this minimum will be attributed to. + */ + item_id: string; + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + minimum_amount: string; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface PlanPhasePercentageDiscountAdjustment { + id: string; + + adjustment_type: 'percentage_discount'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + percentage_discount: number; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; +} + +export interface PlanPhaseUsageDiscountAdjustment { + id: string; + + adjustment_type: 'usage_discount'; + + /** + * @deprecated The price IDs that this adjustment applies to. + */ + applies_to_price_ids: Array; + + /** + * The filters that determine which prices to apply this adjustment to. + */ + filters: Array; + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + is_invoice_level: boolean; + + /** + * The plan phase in which this adjustment is active. + */ + plan_phase_order: number | null; + + /** + * The reason for the adjustment. + */ + reason: string | null; + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + usage_discount: number; +} + +/** + * 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 type Price = + | Price.UnitPrice + | Price.PackagePrice + | Price.MatrixPrice + | Price.TieredPrice + | Price.TieredBPSPrice + | Price.BPSPrice + | Price.BulkBPSPrice + | Price.BulkPrice + | Price.ThresholdTotalAmountPrice + | Price.TieredPackagePrice + | Price.GroupedTieredPrice + | Price.TieredWithMinimumPrice + | Price.TieredPackageWithMinimumPrice + | Price.PackageWithAllocationPrice + | Price.UnitWithPercentPrice + | Price.MatrixWithAllocationPrice + | Price.TieredWithProrationPrice + | Price.UnitWithProrationPrice + | Price.GroupedAllocationPrice + | Price.GroupedWithProratedMinimumPrice + | Price.GroupedWithMeteredMinimumPrice + | Price.MatrixWithDisplayNamePrice + | Price.BulkWithProrationPrice + | Price.GroupedTieredPackagePrice + | Price.MaxGroupTieredPackagePrice + | Price.ScalableMatrixWithUnitPricingPrice + | Price.ScalableMatrixWithTieredPricingPrice + | Price.CumulativeGroupedBulkPrice; + +export namespace Price { + export interface UnitPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'unit'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + unit_config: Shared.UnitConfig; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface PackagePrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'package'; + + name: string; + + package_config: Shared.PackageConfig; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface MatrixPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + matrix_config: Shared.MatrixConfig; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'matrix'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_config: Shared.TieredConfig; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredBPSPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered_bps'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_bps_config: Shared.TieredBPSConfig; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface BPSPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + bps_config: Shared.BPSConfig; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'bps'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface BulkBPSPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + bulk_bps_config: Shared.BulkBPSConfig; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'bulk_bps'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface BulkPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + bulk_config: Shared.BulkConfig; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'bulk'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface ThresholdTotalAmountPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'threshold_total_amount'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + threshold_total_amount_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredPackagePrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered_package'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_package_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface GroupedTieredPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + grouped_tiered_config: Record; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'grouped_tiered'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredWithMinimumPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered_with_minimum'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_with_minimum_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredPackageWithMinimumPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered_package_with_minimum'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_package_with_minimum_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface PackageWithAllocationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'package_with_allocation'; + + name: string; + + package_with_allocation_config: Record; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface UnitWithPercentPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'unit_with_percent'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + unit_with_percent_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface MatrixWithAllocationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'matrix_with_allocation'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface TieredWithProrationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'tiered_with_proration'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + tiered_with_proration_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface UnitWithProrationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'unit_with_proration'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + unit_with_proration_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface GroupedAllocationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + grouped_allocation_config: Record; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'grouped_allocation'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface GroupedWithProratedMinimumPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + grouped_with_prorated_minimum_config: Record; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'grouped_with_prorated_minimum'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface GroupedWithMeteredMinimumPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + grouped_with_metered_minimum_config: Record; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'grouped_with_metered_minimum'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface MatrixWithDisplayNamePrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + matrix_with_display_name_config: Record; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'matrix_with_display_name'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface BulkWithProrationPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + bulk_with_proration_config: Record; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'bulk_with_proration'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface GroupedTieredPackagePrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + grouped_tiered_package_config: Record; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'grouped_tiered_package'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface MaxGroupTieredPackagePrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + max_group_tiered_package_config: Record; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'max_group_tiered_package'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface ScalableMatrixWithUnitPricingPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'scalable_matrix_with_unit_pricing'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + scalable_matrix_with_unit_pricing_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface ScalableMatrixWithTieredPricingPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'scalable_matrix_with_tiered_pricing'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + scalable_matrix_with_tiered_pricing_config: Record; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } + + export interface CumulativeGroupedBulkPrice { + id: string; + + billable_metric: Shared.BillableMetricTiny | null; + + billing_cycle_configuration: Shared.BillingCycleConfiguration; + + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + + conversion_rate: number | null; + + conversion_rate_config: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; + + created_at: string; + + credit_allocation: Shared.Allocation | null; + + cumulative_grouped_bulk_config: Record; + + currency: string; + + /** + * @deprecated + */ + discount: Shared.Discount | null; + + external_price_id: string | null; + + fixed_price_quantity: number | null; + + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; + + item: Shared.ItemSlim; + + /** + * @deprecated + */ + maximum: Shared.Maximum | null; + + /** + * @deprecated + */ + maximum_amount: string | null; + + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; + + /** + * @deprecated + */ + minimum: Shared.Minimum | null; + + /** + * @deprecated + */ + minimum_amount: string | null; + + model_type: 'cumulative_grouped_bulk'; + + name: string; + + plan_phase_order: number | null; + + price_type: 'usage_price' | 'fixed_price'; + + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; + } +} + +/** + * The Price Interval resource represents a period of time for which a price will + * bill on a subscription. A subscription’s price intervals define its billing + * behavior. + */ +export interface PriceInterval { + id: string; + + /** + * The day of the month that Orb bills for this price */ - amount_discount: string; + billing_cycle_day: number; - discount_type: 'amount'; + /** + * The end of the current billing period. This is an exclusive timestamp, such that + * the instant returned is exactly the end of the billing period. Set to null if + * this price interval is not currently active. + */ + current_billing_period_end_date: string | null; /** - * List of price_ids that this discount applies to. For plan/plan phase discounts, - * this can be a subset of prices. + * The start date of the current billing period. This is an inclusive timestamp; + * the instant returned is exactly the beginning of the billing period. Set to null + * if this price interval is not currently active. */ - applies_to_price_ids?: Array | null; + current_billing_period_start_date: string | null; - reason?: string | null; + /** + * The end date of the price interval. This is the date that Orb stops billing for + * this price. + */ + end_date: string | null; + + /** + * An additional filter to apply to usage queries. + */ + filter: string | null; + + /** + * The fixed fee quantity transitions for this price interval. This is only + * relevant for fixed fees. + */ + fixed_fee_quantity_transitions: Array | null; + + /** + * 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) + */ + price: Price; + + /** + * The start date of the price interval. This is the date that Orb starts billing + * for this price. + */ + start_date: string; + + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this price interval. + */ + usage_customer_ids: Array | null; } -export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term'; +export interface SubLineItemGrouping { + key: string; -export type Discount = PercentageDiscount | TrialDiscount | UsageDiscount | AmountDiscount; + /** + * No value indicates the default group + */ + value: string | null; +} -export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount; +export interface SubLineItemMatrixConfig { + /** + * The ordered dimension values for this line item. + */ + dimension_values: Array; +} -export interface PaginationMetadata { - has_more: boolean; +export interface SubscriptionChangeMinified { + id: string; +} - next_cursor: string | null; +export interface SubscriptionMinified { + id: string; } -export interface PercentageDiscount { - discount_type: 'percentage'; +export interface SubscriptionTrialInfo { + end_date: string | null; +} +export interface TaxAmount { /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. + * The amount of additional tax incurred by this tax rate. */ - percentage_discount: number; + amount: string; /** - * List of price_ids that this discount applies to. For plan/plan phase discounts, - * this can be a subset of prices. + * The human-readable description of the applied tax rate. */ - applies_to_price_ids?: Array | null; + tax_rate_description: string; - reason?: string | null; + /** + * The tax rate percentage, out of 100. + */ + tax_rate_percentage: string | null; +} + +export interface Tier { + /** + * Exclusive tier starting value + */ + first_unit: number; + + /** + * Amount per unit + */ + unit_amount: string; + + /** + * Inclusive tier ending value. If null, this is treated as the last tier + */ + last_unit?: number | null; +} + +export interface TierConfig { + first_unit: number; + + last_unit: number | null; + + unit_amount: string; +} + +export interface TierSubLineItem { + /** + * The total amount for this sub line item. + */ + amount: string; + + grouping: SubLineItemGrouping | null; + + name: string; + + quantity: number; + + tier_config: TierConfig; + + type: 'tier'; +} + +export interface TieredBPSConfig { + /** + * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + * tiers + */ + tiers: Array; +} + +export interface TieredConfig { + /** + * Tiers for rating based on total usage quantities into the specified tier + */ + tiers: Array; +} + +export interface TieredConversionRateConfig { + conversion_rate_type: 'tiered'; + + tiered_config: ConversionRateTieredConfig; +} + +export interface TransformPriceFilter { + /** + * 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 TrialDiscount { @@ -56,6 +9557,11 @@ export interface TrialDiscount { */ applies_to_price_ids?: Array | null; + /** + * The filters that determine which prices to apply this discount to. + */ + filters?: Array | null; + reason?: string | null; /** @@ -69,6 +9575,19 @@ export interface TrialDiscount { trial_percentage_discount?: number | null; } +export interface UnitConfig { + /** + * Rate per unit of usage + */ + unit_amount: string; +} + +export interface UnitConversionRateConfig { + conversion_rate_type: 'unit'; + + unit_config: ConversionRateUnitConfig; +} + export interface UsageDiscount { discount_type: 'usage'; @@ -84,5 +9603,46 @@ export interface UsageDiscount { */ applies_to_price_ids?: Array | null; + /** + * The filters that determine which prices to apply this discount to. + */ + filters?: Array | null; + reason?: string | null; } + +export interface UsageDiscountInterval { + /** + * The price interval ids that this discount interval applies to. + */ + applies_to_price_interval_ids: Array; + + discount_type: 'usage'; + + /** + * The end date of the discount interval. + */ + end_date: string | null; + + /** + * The filters that determine which prices this discount interval applies to. + */ + filters: Array; + + /** + * The start date of the discount interval. + */ + start_date: string; + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for + */ + usage_discount: number; +} + +export class CreditNotesPage extends Page {} + +export class InvoicesPage extends Page {} + +export class PricesPage extends Page {} diff --git a/src/resources/subscription-changes.ts b/src/resources/subscription-changes.ts index ad1bc4cb..ced31e7e 100644 --- a/src/resources/subscription-changes.ts +++ b/src/resources/subscription-changes.ts @@ -3,11 +3,9 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import * as CreditNotesAPI from './credit-notes'; -import * as InvoicesAPI from './invoices'; +import * as Shared from './shared'; import * as CustomersAPI from './customers/customers'; import * as PlansAPI from './plans/plans'; -import * as PricesAPI from './prices/prices'; export class SubscriptionChanges extends APIResource { /** @@ -66,920 +64,196 @@ export class SubscriptionChanges extends APIResource { } } -/** - * A subscription change represents a desired new subscription / pending change to - * an existing subscription. It is a way to first preview the effects on the - * subscription as well as any changes/creation of invoices (see - * `subscription.changed_resources`). - */ -export interface SubscriptionChangeRetrieveResponse { +export interface MutatedSubscription { id: string; /** - * Subscription change will be cancelled at this time and can no longer be applied. + * The current plan phase that is active, only if the subscription's plan has + * phases. */ - expiration_time: string; - - status: 'pending' | 'applied' | 'cancelled'; - - subscription: SubscriptionChangeRetrieveResponse.Subscription | null; + active_plan_phase_order: number | null; /** - * When this change was applied. + * The adjustment intervals for this subscription sorted by the start_date of the + * adjustment interval. */ - applied_at?: string | null; + adjustment_intervals: Array; /** - * When this change was cancelled. + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. This property defaults to + * the plan's behavior. If null, defaults to the customer's setting. */ - cancelled_at?: string | null; -} - -export namespace SubscriptionChangeRetrieveResponse { - export interface Subscription { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: Subscription.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | Subscription.AmountDiscountInterval - | Subscription.PercentageDiscountInterval - | Subscription.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: Subscription.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: Subscription.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: Subscription.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: Subscription.ChangedResources | null; - } - - export namespace Subscription { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + auto_collection: boolean | null; - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; + billing_cycle_anchor_configuration: Shared.BillingCycleAnchorConfiguration; - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; + /** + * The day of the month on which the billing cycle is anchored. If the maximum + * number of days in a month is greater than this value, the last day of the month + * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + * period begins on the 30th. + */ + billing_cycle_day: number; - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; + created_at: string; - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; + /** + * The end of the current billing period. This is an exclusive timestamp, such that + * the instant returned is not part of the billing period. Set to null for + * subscriptions that are not currently active. + */ + current_billing_period_end_date: string | null; - /** - * The start date of the minimum interval. - */ - start_date: string; - } + /** + * The start date of the current billing period. This is an inclusive timestamp; + * the instant returned is exactly the beginning of the billing period. Set to null + * if the subscription is not currently active. + */ + current_billing_period_start_date: string | null; - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * 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. + */ + customer: CustomersAPI.Customer; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * Determines the default memo on this subscriptions' invoices. Note that if this + * is not provided, it is determined by the plan configuration. + */ + default_invoice_memo: string | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * @deprecated The discount intervals for this subscription sorted by the + * start_date. + */ + discount_intervals: Array< + Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval + >; - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } + /** + * The date Orb stops billing for this subscription. + */ + end_date: string | null; - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; + fixed_fee_quantity_schedule: Array; - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; + invoicing_threshold: string | null; - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; + /** + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. + */ + maximum_intervals: Array; - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: 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: Record; - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; + /** + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. + */ + minimum_intervals: Array; - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; + /** + * The name of the subscription. + */ + name: string; - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; + /** + * Determines the difference between the invoice issue date for subscription + * invoices as the date that they are due. A value of `0` here represents that the + * invoice is due on issue, whereas a value of `30` represents that the customer + * has a month to pay the invoice. + */ + net_terms: number; - /** - * 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) - */ - price: PricesAPI.Price; + /** + * A pending subscription change if one exists on this subscription. + */ + pending_subscription_change: Shared.SubscriptionChangeMinified | null; - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; + /** + * 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). + */ + plan: PlansAPI.Plan | null; - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } + /** + * The price intervals for this subscription. + */ + price_intervals: Array; - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; + redeemed_coupon: Shared.CouponRedemption | null; - price_id: string; + /** + * The date Orb starts billing for this subscription. + */ + start_date: string; - quantity: number; - } - } + status: 'active' | 'ended' | 'upcoming'; - export interface RedeemedCoupon { - coupon_id: string; + trial_info: Shared.SubscriptionTrialInfo; - end_date: string | null; + /** + * The resources that were changed as part of this operation. Only present when + * fetched through the subscription changes API or if the + * `include_changed_resources` parameter was passed in the request. + */ + changed_resources?: Shared.ChangedSubscriptionResources | null; +} - start_date: string; - } +/** + * A subscription change represents a desired new subscription / pending change to + * an existing subscription. It is a way to first preview the effects on the + * subscription as well as any changes/creation of invoices (see + * `subscription.changed_resources`). + */ +export interface SubscriptionChangeRetrieveResponse { + id: string; - export interface TrialInfo { - end_date: string | null; - } + /** + * Subscription change will be cancelled at this time and can no longer be applied. + */ + expiration_time: string; - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; + status: 'pending' | 'applied' | 'cancelled'; - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; + subscription: MutatedSubscription | null; - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; + /** + * When this change was applied. + */ + applied_at?: string | null; - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } - } + /** + * When this change was cancelled. + */ + cancelled_at?: string | null; } /** @@ -998,7 +272,7 @@ export interface SubscriptionChangeApplyResponse { status: 'pending' | 'applied' | 'cancelled'; - subscription: SubscriptionChangeApplyResponse.Subscription | null; + subscription: MutatedSubscription | null; /** * When this change was applied. @@ -1011,915 +285,28 @@ export interface SubscriptionChangeApplyResponse { cancelled_at?: string | null; } -export namespace SubscriptionChangeApplyResponse { - export interface Subscription { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: Subscription.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; +/** + * A subscription change represents a desired new subscription / pending change to + * an existing subscription. It is a way to first preview the effects on the + * subscription as well as any changes/creation of invoices (see + * `subscription.changed_resources`). + */ +export interface SubscriptionChangeCancelResponse { + id: string; - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | Subscription.AmountDiscountInterval - | Subscription.PercentageDiscountInterval - | Subscription.UsageDiscountInterval - >; + /** + * Subscription change will be cancelled at this time and can no longer be applied. + */ + expiration_time: string; - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; + status: 'pending' | 'applied' | 'cancelled'; - fixed_fee_quantity_schedule: Array; + subscription: MutatedSubscription | null; - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: Subscription.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: Subscription.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: Subscription.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: Subscription.ChangedResources | null; - } - - export namespace Subscription { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } - } -} - -/** - * A subscription change represents a desired new subscription / pending change to - * an existing subscription. It is a way to first preview the effects on the - * subscription as well as any changes/creation of invoices (see - * `subscription.changed_resources`). - */ -export interface SubscriptionChangeCancelResponse { - id: string; - - /** - * Subscription change will be cancelled at this time and can no longer be applied. - */ - expiration_time: string; - - status: 'pending' | 'applied' | 'cancelled'; - - subscription: SubscriptionChangeCancelResponse.Subscription | null; - - /** - * When this change was applied. - */ - applied_at?: string | null; + /** + * When this change was applied. + */ + applied_at?: string | null; /** * When this change was cancelled. @@ -1927,893 +314,6 @@ export interface SubscriptionChangeCancelResponse { cancelled_at?: string | null; } -export namespace SubscriptionChangeCancelResponse { - export interface Subscription { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: Subscription.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | Subscription.AmountDiscountInterval - | Subscription.PercentageDiscountInterval - | Subscription.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: Subscription.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: Subscription.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: Subscription.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: Subscription.ChangedResources | null; - } - - export namespace Subscription { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } - } -} - export interface SubscriptionChangeApplyParams { /** * Description to apply to the balance transaction representing this credit. @@ -2828,6 +328,7 @@ export interface SubscriptionChangeApplyParams { export declare namespace SubscriptionChanges { export { + type MutatedSubscription as MutatedSubscription, type SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse, type SubscriptionChangeApplyResponse as SubscriptionChangeApplyResponse, type SubscriptionChangeCancelResponse as SubscriptionChangeCancelResponse, diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 2148c601..ed91bd8f 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -3,12 +3,11 @@ import { APIResource } from '../resource'; import { isRequestOptions } from '../core'; import * as Core from '../core'; -import * as CreditNotesAPI from './credit-notes'; -import * as InvoicesAPI from './invoices'; +import * as SubscriptionsAPI from './subscriptions'; import * as Shared from './shared'; +import * as SubscriptionChangesAPI from './subscription-changes'; import * as CustomersAPI from './customers/customers'; import * as PlansAPI from './plans/plans'; -import * as PricesAPI from './prices/prices'; import { Page, type PageParams } from '../pagination'; export class Subscriptions extends APIResource { @@ -273,7 +272,7 @@ export class Subscriptions extends APIResource { create( body: SubscriptionCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post('/subscriptions', { body, ...options }); } @@ -383,7 +382,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionCancelParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options }); } @@ -748,7 +747,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionPriceIntervalsParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options }); } @@ -759,7 +758,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionRedeemCouponParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/redeem_coupon`, { body, ...options }); } @@ -952,7 +951,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionSchedulePlanChangeParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options }); } @@ -964,7 +963,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionTriggerPhaseParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options }); } @@ -979,7 +978,7 @@ export class Subscriptions extends APIResource { unscheduleCancellation( subscriptionId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options); } @@ -994,7 +993,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, { body, ...options, @@ -1003,12 +1002,12 @@ export class Subscriptions extends APIResource { /** * This endpoint can be used to unschedule any pending plan changes on an existing - * subscription. + * subscription. When called, all upcoming plan changes will be unscheduled. */ unschedulePendingPlanChanges( subscriptionId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options); } @@ -1032,7 +1031,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionUpdateFixedFeeQuantityParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, { body, ...options, @@ -1063,7 +1062,7 @@ export class Subscriptions extends APIResource { subscriptionId: string, body: SubscriptionUpdateTrialParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.post(`/subscriptions/${subscriptionId}/update_trial`, { body, ...options }); } } @@ -1072,34012 +1071,4257 @@ export class SubscriptionsPage extends Page {} export class SubscriptionFetchScheduleResponsesPage extends Page {} -/** - * A [subscription](/core-concepts#subscription) represents the purchase of a plan - * by a customer. - * - * By default, subscriptions begin on the day that they're created and renew - * automatically for each billing cycle at the cadence that's configured in the - * plan definition. - * - * Subscriptions also default to **beginning of month alignment**, which means the - * first invoice issued for the subscription will have pro-rated charges between - * the `start_date` and the first of the following month. Subsequent billing - * periods will always start and end on a month boundary (e.g. subsequent month - * starts for monthly billing). - * - * Depending on the plan configuration, any _flat_ recurring fees will be billed - * either at the beginning (in-advance) or end (in-arrears) of each billing cycle. - * Plans default to **in-advance billing**. Usage-based fees are billed in arrears - * as usage is accumulated. In the normal course of events, you can expect an - * invoice to contain usage-based charges for the previous period, and a recurring - * fee for the following period. - */ -export interface Subscription { - id: string; +export interface DiscountOverride { + discount_type: 'percentage' | 'usage' | 'amount'; /** - * The current plan phase that is active, only if the subscription's plan has - * phases. + * Only available if discount_type is `amount`. */ - active_plan_phase_order: number | null; + amount_discount?: string | null; /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. */ - adjustment_intervals: Array; + percentage_discount?: number | null; /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for */ - auto_collection: boolean | null; + usage_discount?: number | null; +} - billing_cycle_anchor_configuration: Subscription.BillingCycleAnchorConfiguration; +export interface NewSubscriptionBPSPrice { + bps_config: Shared.BPSConfig; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * The cadence to bill for this price on. */ - billing_cycle_day: number; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - created_at: string; + /** + * The id of the item the price will be associated with. + */ + item_id: string; + + model_type: 'bps'; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * The name of the price. */ - current_billing_period_end_date: string | null; + name: string; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - current_billing_period_start_date: string | null; + billable_metric_id?: string | null; /** - * 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. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - customer: CustomersAPI.Customer; + billed_in_advance?: boolean | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - default_invoice_memo: string | null; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * The per unit conversion rate of the price currency to the invoicing currency. */ - discount_intervals: Array< - | Subscription.AmountDiscountInterval - | Subscription.PercentageDiscountInterval - | Subscription.UsageDiscountInterval - >; + conversion_rate?: number | null; /** - * The date Orb stops billing for this subscription. + * The configuration for the rate of the price currency to the invoicing currency. */ - end_date: string | null; + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - fixed_fee_quantity_schedule: Array; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - invoicing_threshold: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * An alias for the price. */ - maximum_intervals: Array; + external_price_id?: 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`. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - metadata: Record; + fixed_price_quantity?: number | null; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * The property used to group this price on an invoice */ - minimum_intervals: Array; + invoice_grouping_key?: string | null; /** - * The name of the subscription. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - name: string; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. */ - net_terms: number; + metadata?: Record | null; /** - * A pending subscription change if one exists on this subscription. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - pending_subscription_change: Subscription.PendingSubscriptionChange | null; + reference_id?: string | null; +} + +export interface NewSubscriptionBulkBPSPrice { + bulk_bps_config: Shared.BulkBPSConfig; /** - * 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). + * The cadence to bill for this price on. */ - plan: PlansAPI.Plan | null; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * The price intervals for this subscription. + * The id of the item the price will be associated with. */ - price_intervals: Array; + item_id: string; - redeemed_coupon: Subscription.RedeemedCoupon | null; + model_type: 'bulk_bps'; /** - * The date Orb starts billing for this subscription. + * The name of the price. */ - start_date: string; + name: string; - status: 'active' | 'ended' | 'upcoming'; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - trial_info: Subscription.TrialInfo; -} + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; -export namespace Subscription { - export interface AdjustmentInterval { - id: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The end date of the adjustment interval. - */ - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The start date of the adjustment interval. - */ - start_date: string; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'usage_discount'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The reason for the adjustment. - */ - reason: string | null; +export interface NewSubscriptionBulkPrice { + bulk_config: Shared.BulkConfig; - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface PlanPhaseAmountDiscountAdjustment { - id: string; + model_type: 'bulk'; - adjustment_type: 'amount_discount'; + /** + * The name of the price. + */ + name: string; - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export interface PlanPhasePercentageDiscountAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'percentage_discount'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; +export interface NewSubscriptionBulkWithProrationPrice { + bulk_with_proration_config: Record; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface PlanPhaseMinimumAdjustment { - id: string; + model_type: 'bulk_with_proration'; - adjustment_type: 'minimum'; + /** + * The name of the price. + */ + name: string; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export interface PlanPhaseMaximumAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'maximum'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; +export interface NewSubscriptionCumulativeGroupedBulkPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + cumulative_grouped_bulk_config: Record; - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; + model_type: 'cumulative_grouped_bulk'; - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; + /** + * The name of the price. + */ + name: string; - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - discount_type: 'amount'; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The start date of the discount interval. - */ - start_date: string; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * Within 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; - discount_type: 'percentage'; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; +export interface NewSubscriptionGroupedAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; + grouped_allocation_config: Record; - /** - * The start date of the discount interval. - */ - start_date: string; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + model_type: 'grouped_allocation'; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * The name of the price. + */ + name: string; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - discount_type: 'usage'; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The start date of the discount interval. - */ - start_date: string; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - export interface FixedFeeQuantitySchedule { - end_date: string | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - price_id: string; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - quantity: number; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - start_date: string; - } +export interface NewSubscriptionGroupedTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; + grouped_tiered_package_config: Record; - /** - * The end date of the maximum interval. - */ - end_date: string | null; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; + model_type: 'grouped_tiered_package'; - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; + /** + * The name of the price. + */ + name: string; - /** - * The start date of the maximum interval. - */ - start_date: string; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; /** - * A pending subscription change if one exists on this subscription. + * For dimensional price: specifies a price group and dimension values */ - export interface PendingSubscriptionChange { - id: string; - } + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. + * An alias for the price. */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; + external_price_id?: string | null; - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - export interface RedeemedCoupon { - coupon_id: string; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - end_date: string | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - start_date: string; - } + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - export interface TrialInfo { - end_date: string | null; - } + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } -export type SubscriptionUsage = - | SubscriptionUsage.UngroupedSubscriptionUsage - | SubscriptionUsage.GroupedSubscriptionUsage; - -export namespace SubscriptionUsage { - export interface UngroupedSubscriptionUsage { - data: Array; - } - - export namespace UngroupedSubscriptionUsage { - export interface Data { - billable_metric: Data.BillableMetric; - - usage: Array; - - view_mode: 'periodic' | 'cumulative'; - } - - export namespace Data { - export interface BillableMetric { - id: string; - - name: string; - } - - export interface Usage { - quantity: number; - - timeframe_end: string; - - timeframe_start: string; - } - } - } - - export interface GroupedSubscriptionUsage { - data: Array; +export interface NewSubscriptionGroupedTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - pagination_metadata?: Shared.PaginationMetadata | null; - } + grouped_tiered_config: Record; - export namespace GroupedSubscriptionUsage { - export interface Data { - billable_metric: Data.BillableMetric; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - metric_group: Data.MetricGroup; + model_type: 'grouped_tiered'; - usage: Array; + /** + * The name of the price. + */ + name: string; - view_mode: 'periodic' | 'cumulative'; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export namespace Data { - export interface BillableMetric { - id: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - name: string; - } + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - export interface MetricGroup { - property_key: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - property_value: string; - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export interface Usage { - quantity: number; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - timeframe_end: string; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - timeframe_start: string; - } - } - } -} + /** + * An alias for the price. + */ + external_price_id?: string | null; -export interface Subscriptions { - data: Array; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - pagination_metadata: Shared.PaginationMetadata; -} + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; -export interface SubscriptionCreateResponse { - id: string; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * The current plan phase that is active, only if the subscription's plan has - * phases. + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. */ - active_plan_phase_order: number | null; + metadata?: Record | null; /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - adjustment_intervals: Array; + reference_id?: string | null; +} +export interface NewSubscriptionGroupedWithMeteredMinimumPrice { /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * The cadence to bill for this price on. */ - auto_collection: boolean | null; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - billing_cycle_anchor_configuration: SubscriptionCreateResponse.BillingCycleAnchorConfiguration; + grouped_with_metered_minimum_config: Record; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * The id of the item the price will be associated with. */ - billing_cycle_day: number; + item_id: string; - created_at: string; + model_type: 'grouped_with_metered_minimum'; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * The name of the price. */ - current_billing_period_end_date: string | null; + name: string; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - current_billing_period_start_date: string | null; + billable_metric_id?: string | null; /** - * 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. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - customer: CustomersAPI.Customer; + billed_in_advance?: boolean | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - default_invoice_memo: string | null; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * The per unit conversion rate of the price currency to the invoicing currency. */ - discount_intervals: Array< - | SubscriptionCreateResponse.AmountDiscountInterval - | SubscriptionCreateResponse.PercentageDiscountInterval - | SubscriptionCreateResponse.UsageDiscountInterval - >; + conversion_rate?: number | null; /** - * The date Orb stops billing for this subscription. + * The configuration for the rate of the price currency to the invoicing currency. */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - maximum_intervals: Array; + currency?: 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`. + * For dimensional price: specifies a price group and dimension values */ - metadata: Record; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * An alias for the price. */ - minimum_intervals: Array; + external_price_id?: string | null; /** - * The name of the subscription. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - name: string; + fixed_price_quantity?: number | null; /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * The property used to group this price on an invoice */ - net_terms: number; + invoice_grouping_key?: string | null; /** - * A pending subscription change if one exists on this subscription. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - pending_subscription_change: SubscriptionCreateResponse.PendingSubscriptionChange | null; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * 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). + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. */ - plan: PlansAPI.Plan | null; + metadata?: Record | null; /** - * The price intervals for this subscription. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - price_intervals: Array; + reference_id?: string | null; +} + +export interface NewSubscriptionGroupedWithProratedMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - redeemed_coupon: SubscriptionCreateResponse.RedeemedCoupon | null; + grouped_with_prorated_minimum_config: Record; /** - * The date Orb starts billing for this subscription. + * The id of the item the price will be associated with. */ - start_date: string; + item_id: string; - status: 'active' | 'ended' | 'upcoming'; + model_type: 'grouped_with_prorated_minimum'; - trial_info: SubscriptionCreateResponse.TrialInfo; + /** + * The name of the price. + */ + name: string; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - changed_resources?: SubscriptionCreateResponse.ChangedResources | null; -} + billable_metric_id?: string | null; -export namespace SubscriptionCreateResponse { - export interface AdjustmentInterval { - id: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The end date of the adjustment interval. - */ - end_date: string | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The start date of the adjustment interval. - */ - start_date: string; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - adjustment_type: 'usage_discount'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * Within 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 plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The reason for the adjustment. - */ - reason: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } +export interface NewSubscriptionMatrixPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface PlanPhaseAmountDiscountAdjustment { - id: string; + matrix_config: Shared.MatrixConfig; - adjustment_type: 'amount_discount'; + model_type: 'matrix'; - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + /** + * The name of the price. + */ + name: string; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export interface PlanPhasePercentageDiscountAdjustment { - id: string; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - adjustment_type: 'percentage_discount'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * Within 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 percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The reason for the adjustment. - */ - reason: string | null; - } +export interface NewSubscriptionMatrixWithAllocationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface PlanPhaseMinimumAdjustment { - id: string; + matrix_with_allocation_config: Shared.MatrixWithAllocationConfig; - adjustment_type: 'minimum'; + model_type: 'matrix_with_allocation'; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The name of the price. + */ + name: string; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export interface PlanPhaseMaximumAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'maximum'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; +export interface NewSubscriptionMatrixWithDisplayNamePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } + matrix_with_display_name_config: Record; - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; + model_type: 'matrix_with_display_name'; - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; + /** + * The name of the price. + */ + name: string; - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - discount_type: 'amount'; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The start date of the discount interval. - */ - start_date: string; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * Within 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; - discount_type: 'percentage'; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; +export interface NewSubscriptionMaxGroupTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The start date of the discount interval. - */ - start_date: string; - } + max_group_tiered_package_config: Record; - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + model_type: 'max_group_tiered_package'; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * The name of the price. + */ + name: string; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - discount_type: 'usage'; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The start date of the discount interval. - */ - start_date: string; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - export interface FixedFeeQuantitySchedule { - end_date: string | null; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - price_id: string; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - quantity: number; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - start_date: string; - } +export interface NewSubscriptionPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The end date of the maximum interval. - */ - end_date: string | null; + model_type: 'package'; - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; + /** + * The name of the price. + */ + name: string; - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; + package_config: Shared.PackageConfig; - /** - * The start date of the maximum interval. - */ - start_date: string; - } + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The end date of the minimum interval. - */ - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The start date of the minimum interval. - */ - start_date: string; - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * Within 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 IDs or values that match this filter. - */ - values: Array; - } - } + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; /** - * A pending subscription change if one exists on this subscription. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - export interface PendingSubscriptionChange { - id: string; - } + reference_id?: string | null; +} +export interface NewSubscriptionPackageWithAllocationPrice { /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. + * The cadence to bill for this price on. */ - export interface PriceInterval { - id: string; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; + model_type: 'package_with_allocation'; - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; + /** + * The name of the price. + */ + name: string; - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; + package_with_allocation_config: Record; - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * 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) - */ - price: PricesAPI.Price; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - price_id: string; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - quantity: number; - } - } + /** + * An alias for the price. + */ + external_price_id?: string | null; - export interface RedeemedCoupon { - coupon_id: string; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - end_date: string | null; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - start_date: string; - } + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - export interface TrialInfo { - end_date: string | null; - } + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; + reference_id?: string | null; +} - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; +export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} + /** + * The id of the item the price will be associated with. + */ + item_id: string; -export interface SubscriptionCancelResponse { - id: string; + model_type: 'scalable_matrix_with_tiered_pricing'; /** - * The current plan phase that is active, only if the subscription's plan has - * phases. + * The name of the price. */ - active_plan_phase_order: number | null; + name: string; + + scalable_matrix_with_tiered_pricing_config: Record; /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - adjustment_intervals: Array; + billable_metric_id?: string | null; /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionCancelResponse.BillingCycleAnchorConfiguration; + billed_in_advance?: boolean | null; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - billing_cycle_day: number; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - created_at: string; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * The configuration for the rate of the price currency to the invoicing currency. */ - current_billing_period_end_date: string | null; + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - current_billing_period_start_date: string | null; + currency?: string | null; /** - * 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. + * For dimensional price: specifies a price group and dimension values */ - customer: CustomersAPI.Customer; + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * An alias for the price. */ - default_invoice_memo: string | null; + external_price_id?: string | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - discount_intervals: Array< - | SubscriptionCancelResponse.AmountDiscountInterval - | SubscriptionCancelResponse.PercentageDiscountInterval - | SubscriptionCancelResponse.UsageDiscountInterval - >; + fixed_price_quantity?: number | null; /** - * The date Orb stops billing for this subscription. + * The property used to group this price on an invoice */ - end_date: string | null; + invoice_grouping_key?: string | null; - fixed_fee_quantity_schedule: Array; + /** + * Within 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; - invoicing_threshold: string | null; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - maximum_intervals: Array; + reference_id?: string | null; +} +export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { /** - * 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`. + * The cadence to bill for this price on. */ - metadata: Record; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * The id of the item the price will be associated with. */ - minimum_intervals: Array; + item_id: string; + + model_type: 'scalable_matrix_with_unit_pricing'; /** - * The name of the subscription. + * The name of the price. */ name: string; + scalable_matrix_with_unit_pricing_config: Record; + /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - net_terms: number; + billable_metric_id?: string | null; /** - * A pending subscription change if one exists on this subscription. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - pending_subscription_change: SubscriptionCancelResponse.PendingSubscriptionChange | null; + billed_in_advance?: boolean | null; /** - * 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). + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - plan: PlansAPI.Plan | null; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * The price intervals for this subscription. + * The per unit conversion rate of the price currency to the invoicing currency. */ - price_intervals: Array; + conversion_rate?: number | null; - redeemed_coupon: SubscriptionCancelResponse.RedeemedCoupon | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; /** - * The date Orb starts billing for this subscription. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - start_date: string; + currency?: string | null; - status: 'active' | 'ended' | 'upcoming'; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - trial_info: SubscriptionCancelResponse.TrialInfo; + /** + * An alias for the price. + */ + external_price_id?: string | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - changed_resources?: SubscriptionCancelResponse.ChangedResources | null; -} + fixed_price_quantity?: number | null; -export namespace SubscriptionCancelResponse { - export interface AdjustmentInterval { - id: string; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + /** + * Within 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 price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The end date of the adjustment interval. - */ - end_date: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The start date of the adjustment interval. - */ - start_date: string; - } +export interface NewSubscriptionThresholdTotalAmountPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - adjustment_type: 'usage_discount'; + model_type: 'threshold_total_amount'; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The name of the price. + */ + name: string; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + threshold_total_amount_config: Record; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The reason for the adjustment. - */ - reason: string | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export interface PlanPhaseAmountDiscountAdjustment { - id: string; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - adjustment_type: 'amount_discount'; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * Within 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 plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } +export interface NewSubscriptionTierWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export interface PlanPhasePercentageDiscountAdjustment { - id: string; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - adjustment_type: 'percentage_discount'; + model_type: 'tiered_with_proration'; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The name of the price. + */ + name: string; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + tiered_with_proration_config: Record; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export interface PlanPhaseMinimumAdjustment { - id: string; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - adjustment_type: 'minimum'; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; + /** + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. + */ + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The reason for the adjustment. - */ - reason: string | null; - } +export interface NewSubscriptionTieredBPSPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export interface PlanPhaseMaximumAdjustment { - id: string; + model_type: 'tiered_bps'; - adjustment_type: 'maximum'; + /** + * The name of the price. + */ + name: string; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + tiered_bps_config: Shared.TieredBPSConfig; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * Within 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; - discount_type: 'amount'; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; +export interface NewSubscriptionTieredPackagePrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The start date of the discount interval. - */ - start_date: string; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + model_type: 'tiered_package'; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * The name of the price. + */ + name: string; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + tiered_package_config: Record; - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - discount_type: 'percentage'; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The end date of the discount interval. - */ - end_date: string | null; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The start date of the discount interval. - */ - start_date: string; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - discount_type: 'usage'; + /** + * Within 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 end date of the discount interval. - */ - end_date: string | null; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The start date of the discount interval. - */ - start_date: string; +export interface NewSubscriptionTieredPackageWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + model_type: 'tiered_package_with_minimum'; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * The name of the price. + */ + name: string; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + tiered_package_with_minimum_config: Record; - export interface FixedFeeQuantitySchedule { - end_date: string | null; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - price_id: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - quantity: number; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - start_date: string; - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The end date of the maximum interval. - */ - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - /** - * The start date of the maximum interval. - */ - start_date: string; - } + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * Within 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 IDs or values that match this filter. - */ - values: Array; - } - } + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The end date of the minimum interval. - */ - end_date: string | null; +export interface NewSubscriptionTieredPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; + model_type: 'tiered'; - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + /** + * The name of the price. + */ + name: string; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + tiered_config: Shared.TieredConfig; /** - * A pending subscription change if one exists on this subscription. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - export interface PendingSubscriptionChange { - id: string; - } + billable_metric_id?: string | null; /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; + billed_in_advance?: boolean | null; - price_id: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - quantity: number; - } - } + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - export interface RedeemedCoupon { - coupon_id: string; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - start_date: string; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export interface TrialInfo { - end_date: string | null; - } + /** + * An alias for the price. + */ + external_price_id?: string | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; + fixed_price_quantity?: number | null; - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; + /** + * Within 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 invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; -export interface SubscriptionFetchCostsResponse { - data: Array; + /** + * 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 SubscriptionFetchCostsResponse { - export interface Data { - per_price_costs: Array; - - /** - * Total costs for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; +export interface NewSubscriptionTieredWithMinimumPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - timeframe_end: string; + /** + * The id of the item the price will be associated with. + */ + item_id: string; - timeframe_start: string; + model_type: 'tiered_with_minimum'; - /** - * Total costs for the timeframe, including any minimums and discounts. - */ - total: string; - } + /** + * The name of the price. + */ + name: string; - export namespace Data { - export interface PerPriceCost { - /** - * The price object - */ - price: PricesAPI.Price; + tiered_with_minimum_config: Record; - /** - * The price the cost is associated with - */ - price_id: string; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * Price's contributions for the timeframe, excluding any minimums and discounts. - */ - subtotal: string; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * Price's contributions for the timeframe, including minimums and discounts. - */ - total: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * The price's quantity for the timeframe - */ - quantity?: number | null; - } - } -} + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; -export interface SubscriptionFetchScheduleResponse { - created_at: string; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - plan: SubscriptionFetchScheduleResponse.Plan | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - start_date: string; -} + /** + * An alias for the price. + */ + external_price_id?: string | null; -export namespace SubscriptionFetchScheduleResponse { - export interface Plan { - id: string | null; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * An optional user-defined ID for this plan resource, used throughout the system - * as an alias for this Plan. Use this field to identify a plan by an existing - * identifier in your system. - */ - external_plan_id: string | null; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - name: string | null; - } -} + /** + * Within 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; -export interface SubscriptionPriceIntervalsResponse { - id: string; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; /** - * The current plan phase that is active, only if the subscription's plan has - * phases. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - active_plan_phase_order: number | null; + reference_id?: string | null; +} +export interface NewSubscriptionUnitPrice { /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * The cadence to bill for this price on. */ - adjustment_intervals: Array; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * The id of the item the price will be associated with. */ - auto_collection: boolean | null; + item_id: string; - billing_cycle_anchor_configuration: SubscriptionPriceIntervalsResponse.BillingCycleAnchorConfiguration; + model_type: 'unit'; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * The name of the price. */ - billing_cycle_day: number; + name: string; - created_at: string; + unit_config: Shared.UnitConfig; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * The id of the billable metric for the price. Only needed if the price is + * usage-based. */ - current_billing_period_end_date: string | null; + billable_metric_id?: string | null; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - current_billing_period_start_date: string | null; + billed_in_advance?: boolean | null; /** - * 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. + * For custom cadence: specifies the duration of the billing period in days or + * months. */ - customer: CustomersAPI.Customer; + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * The per unit conversion rate of the price currency to the invoicing currency. */ - default_invoice_memo: string | null; + conversion_rate?: number | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * The configuration for the rate of the price currency to the invoicing currency. */ - discount_intervals: Array< - | SubscriptionPriceIntervalsResponse.AmountDiscountInterval - | SubscriptionPriceIntervalsResponse.PercentageDiscountInterval - | SubscriptionPriceIntervalsResponse.UsageDiscountInterval - >; + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; /** - * The date Orb stops billing for this subscription. + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; + currency?: string | null; - invoicing_threshold: string | null; + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * An alias for the price. */ - maximum_intervals: Array; + external_price_id?: 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`. + * If the Price represents a fixed cost, this represents the quantity of units + * applied. */ - metadata: Record; + fixed_price_quantity?: number | null; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * The property used to group this price on an invoice */ - minimum_intervals: Array; + invoice_grouping_key?: string | null; /** - * The name of the subscription. + * Within each billing cycle, specifies the cadence at which invoices are produced. + * If unspecified, a single invoice is produced per billing cycle. */ - name: string; + invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. */ - net_terms: number; + metadata?: Record | null; /** - * A pending subscription change if one exists on this subscription. + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. */ - pending_subscription_change: SubscriptionPriceIntervalsResponse.PendingSubscriptionChange | null; + reference_id?: string | null; +} +export interface NewSubscriptionUnitWithPercentPrice { /** - * 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). + * The cadence to bill for this price on. */ - plan: PlansAPI.Plan | null; + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; /** - * The price intervals for this subscription. + * The id of the item the price will be associated with. */ - price_intervals: Array; + item_id: string; - redeemed_coupon: SubscriptionPriceIntervalsResponse.RedeemedCoupon | null; + model_type: 'unit_with_percent'; /** - * The date Orb starts billing for this subscription. + * The name of the price. */ - start_date: string; + name: string; - status: 'active' | 'ended' | 'upcoming'; + unit_with_percent_config: Record; - trial_info: SubscriptionPriceIntervalsResponse.TrialInfo; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. */ - changed_resources?: SubscriptionPriceIntervalsResponse.ChangedResources | null; -} + billed_in_advance?: boolean | null; -export namespace SubscriptionPriceIntervalsResponse { - export interface AdjustmentInterval { - id: string; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The end date of the adjustment interval. - */ - end_date: string | null; + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - /** - * The start date of the adjustment interval. - */ - start_date: string; - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'usage_discount'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The reason for the adjustment. - */ - reason: string | null; +export interface NewSubscriptionUnitWithProrationPrice { + /** + * The cadence to bill for this price on. + */ + cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } + /** + * The id of the item the price will be associated with. + */ + item_id: string; - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + model_type: 'unit_with_proration'; - export interface PlanPhaseAmountDiscountAdjustment { - id: string; + /** + * The name of the price. + */ + name: string; - adjustment_type: 'amount_discount'; + unit_with_proration_config: Record; - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; + /** + * The id of the billable metric for the price. Only needed if the price is + * usage-based. + */ + billable_metric_id?: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * If the Price represents a fixed cost, the price will be billed in-advance if + * this is true, and in-arrears if this is false. + */ + billed_in_advance?: boolean | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * For custom cadence: specifies the duration of the billing period in days or + * months. + */ + billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The per unit conversion rate of the price currency to the invoicing currency. + */ + conversion_rate?: number | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * The configuration for the rate of the price currency to the invoicing currency. + */ + conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * An ISO 4217 currency string, or custom pricing unit identifier, in which this + * price is billed. + */ + currency?: string | null; - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * For dimensional price: specifies a price group and dimension values + */ + dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null; - export interface PlanPhasePercentageDiscountAdjustment { - id: string; + /** + * An alias for the price. + */ + external_price_id?: string | null; - adjustment_type: 'percentage_discount'; + /** + * If the Price represents a fixed cost, this represents the quantity of units + * applied. + */ + fixed_price_quantity?: number | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The property used to group this price on an invoice + */ + invoice_grouping_key?: string | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * Within 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; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; +} - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; +/** + * A [subscription](/core-concepts#subscription) represents the purchase of a plan + * by a customer. + * + * By default, subscriptions begin on the day that they're created and renew + * automatically for each billing cycle at the cadence that's configured in the + * plan definition. + * + * Subscriptions also default to **beginning of month alignment**, which means the + * first invoice issued for the subscription will have pro-rated charges between + * the `start_date` and the first of the following month. Subsequent billing + * periods will always start and end on a month boundary (e.g. subsequent month + * starts for monthly billing). + * + * Depending on the plan configuration, any _flat_ recurring fees will be billed + * either at the beginning (in-advance) or end (in-arrears) of each billing cycle. + * Plans default to **in-advance billing**. Usage-based fees are billed in arrears + * as usage is accumulated. In the normal course of events, you can expect an + * invoice to contain usage-based charges for the previous period, and a recurring + * fee for the following period. + */ +export interface Subscription { + id: string; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The current plan phase that is active, only if the subscription's plan has + * phases. + */ + active_plan_phase_order: number | null; - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The adjustment intervals for this subscription sorted by the start_date of the + * adjustment interval. + */ + adjustment_intervals: Array; - export interface PlanPhaseMinimumAdjustment { - id: string; + /** + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. This property defaults to + * the plan's behavior. If null, defaults to the customer's setting. + */ + auto_collection: boolean | null; - adjustment_type: 'minimum'; + billing_cycle_anchor_configuration: Shared.BillingCycleAnchorConfiguration; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * The day of the month on which the billing cycle is anchored. If the maximum + * number of days in a month is greater than this value, the last day of the month + * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing + * period begins on the 30th. + */ + billing_cycle_day: number; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + created_at: string; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The end of the current billing period. This is an exclusive timestamp, such that + * the instant returned is not part of the billing period. Set to null for + * subscriptions that are not currently active. + */ + current_billing_period_end_date: string | null; - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; + /** + * The start date of the current billing period. This is an inclusive timestamp; + * the instant returned is exactly the beginning of the billing period. Set to null + * if the subscription is not currently active. + */ + current_billing_period_start_date: string | null; - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; + /** + * 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. + */ + customer: CustomersAPI.Customer; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * Determines the default memo on this subscriptions' invoices. Note that if this + * is not provided, it is determined by the plan configuration. + */ + default_invoice_memo: string | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * @deprecated The discount intervals for this subscription sorted by the + * start_date. + */ + discount_intervals: Array< + Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval + >; - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * The date Orb stops billing for this subscription. + */ + end_date: string | null; - export interface PlanPhaseMaximumAdjustment { - id: string; + fixed_fee_quantity_schedule: Array; - adjustment_type: 'maximum'; + invoicing_threshold: string | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * @deprecated The maximum intervals for this subscription sorted by the + * start_date. + */ + maximum_intervals: Array; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * User specified key-value pairs for the resource. If not present, this defaults + * to an empty dictionary. Individual keys can be removed by setting the value to + * `null`, and the entire metadata mapping can be cleared by setting `metadata` to + * `null`. + */ + metadata: Record; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * @deprecated The minimum intervals for this subscription sorted by the + * start_date. + */ + minimum_intervals: Array; - /** - * The reason for the adjustment. - */ - reason: string | null; - } + /** + * The name of the subscription. + */ + name: string; - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } + /** + * Determines the difference between the invoice issue date for subscription + * invoices as the date that they are due. A value of `0` here represents that the + * invoice is due on issue, whereas a value of `30` represents that the customer + * has a month to pay the invoice. + */ + net_terms: number; - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; + /** + * A pending subscription change if one exists on this subscription. + */ + pending_subscription_change: Shared.SubscriptionChangeMinified | null; - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; + /** + * The [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). + */ + plan: PlansAPI.Plan | null; - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } + /** + * The price intervals for this subscription. + */ + price_intervals: Array; - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; + redeemed_coupon: Shared.CouponRedemption | null; - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The date Orb starts billing for this subscription. + */ + start_date: string; - discount_type: 'amount'; + status: 'active' | 'ended' | 'upcoming'; - /** - * The end date of the discount interval. - */ - end_date: string | null; + trial_info: Shared.SubscriptionTrialInfo; +} - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; +export type SubscriptionUsage = + | SubscriptionUsage.UngroupedSubscriptionUsage + | SubscriptionUsage.GroupedSubscriptionUsage; - /** - * The start date of the discount interval. - */ - start_date: string; +export namespace SubscriptionUsage { + export interface UngroupedSubscriptionUsage { + data: Array; } - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + export namespace UngroupedSubscriptionUsage { + export interface Data { + billable_metric: Data.BillableMetric; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + usage: Array; - /** - * The IDs or values that match this filter. - */ - values: Array; + view_mode: 'periodic' | 'cumulative'; } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - discount_type: 'percentage'; + export namespace Data { + export interface BillableMetric { + id: string; - /** - * The end date of the discount interval. - */ - end_date: string | null; + name: string; + } - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + export interface Usage { + quantity: number; - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; + timeframe_end: string; - /** - * The start date of the discount interval. - */ - start_date: string; + timeframe_start: string; + } + } } - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + export interface GroupedSubscriptionUsage { + data: Array; - /** - * The IDs or values that match this filter. - */ - values: Array; - } + pagination_metadata?: Shared.PaginationMetadata | null; } - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; + export namespace GroupedSubscriptionUsage { + export interface Data { + billable_metric: Data.BillableMetric; - discount_type: 'usage'; + metric_group: Data.MetricGroup; - /** - * The end date of the discount interval. - */ - end_date: string | null; + usage: Array; - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; + view_mode: 'periodic' | 'cumulative'; + } - /** - * The start date of the discount interval. - */ - start_date: string; + export namespace Data { + export interface BillableMetric { + id: string; - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } + name: string; + } - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + export interface MetricGroup { + property_key: string; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + property_value: string; + } - /** - * The IDs or values that match this filter. - */ - values: Array; + export interface Usage { + quantity: number; + + timeframe_end: string; + + timeframe_start: string; + } } } +} - export interface FixedFeeQuantitySchedule { - end_date: string | null; +export interface Subscriptions { + data: Array; - price_id: string; + pagination_metadata: Shared.PaginationMetadata; +} - quantity: number; +export interface SubscriptionFetchCostsResponse { + data: Array; +} - start_date: string; - } +export interface SubscriptionFetchScheduleResponse { + created_at: string; - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; + end_date: string | null; - /** - * The end date of the maximum interval. - */ - end_date: string | null; + plan: SubscriptionFetchScheduleResponse.Plan | null; - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; + start_date: string; +} - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; +export namespace SubscriptionFetchScheduleResponse { + export interface Plan { + id: string | null; /** - * The start date of the maximum interval. + * An optional user-defined ID for this plan resource, used throughout the system + * as an alias for this Plan. Use this field to identify a plan by an existing + * identifier in your system. */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + external_plan_id: string | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } + name: string | null; } +} - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; +export interface SubscriptionCreateParams { + /** + * Additional adjustments to be added to the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) + */ + add_adjustments?: Array | null; - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; + /** + * Additional prices to be added to the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) + */ + add_prices?: Array | null; - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; + align_billing_with_subscription_start_date?: boolean; - /** - * The start date of the minimum interval. - */ - start_date: string; - } + /** + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. If not specified, this + * defaults to the behavior configured for this customer. + */ + auto_collection?: boolean | null; - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + /** + * @deprecated + */ + aws_region?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + billing_cycle_anchor_configuration?: Shared.BillingCycleAnchorConfiguration | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * Redemption code to be used for this subscription. If the coupon cannot be found + * by its redemption code, or cannot be redeemed, an error response will be + * returned and the subscription creation or plan change will not be scheduled. + */ + coupon_redemption_code?: string | null; /** - * A pending subscription change if one exists on this subscription. + * @deprecated */ - export interface PendingSubscriptionChange { - id: string; - } + credits_overage_rate?: number | null; /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. + * The currency to use for the subscription. If not specified, the invoicing + * currency for the plan will be used. */ - export interface PriceInterval { - id: string; + currency?: string | null; - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } + customer_id?: string | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * Determines the default memo on this subscription's invoices. Note that if this + * is not provided, it is determined by the plan configuration. */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} + default_invoice_memo?: string | null; -export interface SubscriptionRedeemCouponResponse { - id: string; + end_date?: string | null; - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; + external_customer_id?: string | null; /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * @deprecated */ - adjustment_intervals: Array; + external_marketplace?: 'google' | 'aws' | 'azure' | null; /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * @deprecated */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionRedeemCouponResponse.BillingCycleAnchorConfiguration; + external_marketplace_reporting_id?: string | null; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * The external_plan_id of the plan that the given subscription should be switched + * to. Note that either this property or `plan_id` must be specified. */ - billing_cycle_day: number; - - created_at: string; + external_plan_id?: string | null; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. */ - current_billing_period_end_date: string | null; + filter?: string | null; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * The phase of the plan to start with */ - current_billing_period_start_date: string | null; + initial_phase_order?: number | null; /** - * 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. + * When this subscription's accrued usage reaches this threshold, an invoice will + * be issued for the subscription. If not specified, invoices will only be issued + * at the end of the billing period. */ - customer: CustomersAPI.Customer; + invoicing_threshold?: string | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. */ - default_invoice_memo: string | null; + metadata?: Record | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * The name to use for the subscription. If not specified, the plan name will be + * used. */ - discount_intervals: Array< - | SubscriptionRedeemCouponResponse.AmountDiscountInterval - | SubscriptionRedeemCouponResponse.PercentageDiscountInterval - | SubscriptionRedeemCouponResponse.UsageDiscountInterval - >; + name?: string | null; /** - * The date Orb stops billing for this subscription. + * The net terms determines the difference between the invoice date and the issue + * date for the invoice. If you intend the invoice to be due on issue, set this + * to 0. If not provided, this defaults to the value specified in the plan. */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; + net_terms?: number | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * @deprecated */ - maximum_intervals: Array; + per_credit_overage_amount?: 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`. + * The plan that the given subscription should be switched to. Note that either + * this property or `external_plan_id` must be specified. */ - metadata: Record; + plan_id?: string | null; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * Specifies which version of the plan to subscribe to. If null, the default + * version will be used. */ - minimum_intervals: Array; + plan_version_number?: number | null; /** - * The name of the subscription. + * @deprecated Optionally provide a list of overrides for prices on the plan */ - name: string; + price_overrides?: Array | null; /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * Plan adjustments to be removed from the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) */ - net_terms: number; + remove_adjustments?: Array | null; /** - * A pending subscription change if one exists on this subscription. + * Plan prices to be removed from the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) */ - pending_subscription_change: SubscriptionRedeemCouponResponse.PendingSubscriptionChange | null; + remove_prices?: Array | null; /** - * 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). + * Plan adjustments to be replaced with additional adjustments on the subscription. + * (Only available for accounts that have migrated off of legacy subscription + * overrides) */ - plan: PlansAPI.Plan | null; + replace_adjustments?: Array | null; /** - * The price intervals for this subscription. + * Plan prices to be replaced with additional prices on the subscription. (Only + * available for accounts that have migrated off of legacy subscription overrides) */ - price_intervals: Array; + replace_prices?: Array | null; - redeemed_coupon: SubscriptionRedeemCouponResponse.RedeemedCoupon | null; + start_date?: string | null; /** - * The date Orb starts billing for this subscription. + * The duration of the trial period in days. If not provided, this defaults to the + * value specified in the plan. If `0` is provided, the trial on the plan will be + * skipped. */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionRedeemCouponResponse.TrialInfo; + trial_duration_days?: number | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. */ - changed_resources?: SubscriptionRedeemCouponResponse.ChangedResources | null; + usage_customer_ids?: Array | null; } -export namespace SubscriptionRedeemCouponResponse { - export interface AdjustmentInterval { - id: string; - +export namespace SubscriptionCreateParams { + export interface AddAdjustment { + /** + * The definition of a new adjustment to create and add to the subscription. + */ adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** - * The price interval IDs that this adjustment applies to. + * The end date of the adjustment interval. This is the date that the adjustment + * will stop affecting prices on the subscription. */ - applies_to_price_interval_ids: Array; + end_date?: string | null; /** - * The end date of the adjustment interval. + * The phase to add this adjustment to. */ - end_date: string | null; + plan_phase_order?: number | null; /** - * The start date of the adjustment interval. + * The start date of the adjustment interval. This is the date that the adjustment + * will start affecting prices on the subscription. If null, the adjustment will + * start when the phase or subscription starts. */ - start_date: string; + start_date?: string | null; } - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; + export interface AddPrice { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: Shared.NewAllocationPrice | null; - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for this price. + */ + discounts?: Array | null; - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; + /** + * The end date of the price interval. This is the date that the price will stop + * billing on the subscription. If null, billing will end when the phase or + * subscription ends. + */ + end_date?: string | null; - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; + /** + * The external price id of the price to add to the subscription. + */ + external_price_id?: string | null; - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; + /** + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for this price. + */ + maximum_amount?: string | null; - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for this price. */ - day: number; + minimum_amount?: string | null; /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). + * The phase to add this price to. */ - month?: number | null; + plan_phase_order?: number | null; /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + * The definition of a new price to create and add to the subscription. */ - year?: number | null; - } + price?: + | SubscriptionsAPI.NewSubscriptionUnitPrice + | SubscriptionsAPI.NewSubscriptionPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixPrice + | SubscriptionsAPI.NewSubscriptionTieredPrice + | SubscriptionsAPI.NewSubscriptionTieredBPSPrice + | SubscriptionsAPI.NewSubscriptionBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkPrice + | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice + | SubscriptionsAPI.NewSubscriptionTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice + | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice + | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice + | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice + | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice + | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice + | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice + | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice + | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice + | null; - export interface AmountDiscountInterval { /** - * Only available if discount_type is `amount`. + * The id of the price to add to the subscription. */ - amount_discount: string; + price_id?: string | null; /** - * The price interval ids that this discount interval applies to. + * The start date of the price interval. This is the date that the price will start + * billing on the subscription. If null, billing will start when the phase or + * subscription starts. */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; + start_date?: string | null; + } + export interface RemoveAdjustment { /** - * The end date of the discount interval. + * The id of the adjustment to remove on the subscription. */ - end_date: string | null; + adjustment_id: string; + } + export interface RemovePrice { /** - * The filters that determine which prices this discount interval applies to. + * The external price id of the price to remove on the subscription. */ - filters: Array; + external_price_id?: string | null; /** - * The start date of the discount interval. + * The id of the price to remove on the subscription. */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } + price_id?: string | null; } - export interface PercentageDiscountInterval { + export interface ReplaceAdjustment { /** - * The price interval ids that this discount interval applies to. + * The definition of a new adjustment to create and add to the subscription. */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** - * The end date of the discount interval. + * The id of the adjustment on the plan to replace in the subscription. */ - end_date: string | null; + replaces_adjustment_id: string; + } + export interface ReplacePrice { /** - * The filters that determine which prices this discount interval applies to. + * The id of the price on the plan to replace in the subscription. */ - filters: Array; + replaces_price_id: string; /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. + * The definition of a new allocation price to create and add to the subscription. */ - percentage_discount: number; + allocation_price?: Shared.NewAllocationPrice | null; /** - * The start date of the discount interval. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for the replacement price. */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + discounts?: Array | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { /** - * The price interval ids that this discount interval applies to. + * The external price id of the price to add to the subscription. */ - applies_to_price_interval_ids: Array; + external_price_id?: string | null; - discount_type: 'usage'; + /** + * The new quantity of the price, if the price is a fixed price. + */ + fixed_price_quantity?: number | null; /** - * The end date of the discount interval. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for the replacement price. */ - end_date: string | null; + maximum_amount?: string | null; /** - * The filters that determine which prices this discount interval applies to. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for the replacement price. */ - filters: Array; + minimum_amount?: string | null; /** - * The start date of the discount interval. + * The definition of a new price to create and add to the subscription. */ - start_date: string; + price?: + | SubscriptionsAPI.NewSubscriptionUnitPrice + | SubscriptionsAPI.NewSubscriptionPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixPrice + | SubscriptionsAPI.NewSubscriptionTieredPrice + | SubscriptionsAPI.NewSubscriptionTieredBPSPrice + | SubscriptionsAPI.NewSubscriptionBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkPrice + | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice + | SubscriptionsAPI.NewSubscriptionTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice + | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice + | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice + | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice + | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice + | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice + | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice + | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice + | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice + | null; /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for + * The id of the price to add to the subscription. */ - usage_discount: number; + price_id?: string | null; } +} - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; +export interface SubscriptionUpdateParams { + /** + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. This property defaults to + * the plan's behavior. + */ + auto_collection?: boolean | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * Determines the default memo on this subscription's invoices. Note that if this + * is not provided, it is determined by the plan configuration. + */ + default_invoice_memo?: string | null; - export interface FixedFeeQuantitySchedule { - end_date: string | null; + /** + * When this subscription's accrued usage reaches this threshold, an invoice will + * be issued for the subscription. If not specified, invoices will only be issued + * at the end of the billing period. + */ + invoicing_threshold?: string | null; - price_id: string; + /** + * User-specified key/value pairs for the resource. Individual keys can be removed + * by setting the value to `null`, and the entire metadata mapping can be cleared + * by setting `metadata` to `null`. + */ + metadata?: Record | null; - quantity: number; + /** + * Determines the difference between the invoice issue date for subscription + * invoices as the date that they are due. A value of `0` here represents that the + * invoice is due on issue, whereas a value of `30` represents that the customer + * has a month to pay the invoice. + */ + net_terms?: number | null; +} - start_date: string; - } +export interface SubscriptionListParams extends PageParams { + 'created_at[gt]'?: string | null; - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; + 'created_at[gte]'?: string | null; - /** - * The end date of the maximum interval. - */ - end_date: string | null; + 'created_at[lt]'?: string | null; - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; + 'created_at[lte]'?: string | null; - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; + customer_id?: Array | null; - /** - * The start date of the maximum interval. - */ - start_date: string; - } + external_customer_id?: Array | null; - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; + status?: 'active' | 'ended' | 'upcoming' | null; +} - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; +export interface SubscriptionCancelParams { + /** + * Determines the timing of subscription cancellation + */ + cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + /** + * If false, this request will fail if it would void an issued invoice or create a + * credit note. Consider using this as a safety mechanism if you do not expect + * existing invoices to be changed. + */ + allow_invoice_credit_or_void?: boolean | null; - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The date that the cancellation should take effect. This parameter can only be + * passed if the `cancel_option` is `requested_date`. + */ + cancellation_date?: string | null; +} - /** - * The end date of the minimum interval. - */ - end_date: string | null; +export interface SubscriptionFetchCostsParams { + /** + * The currency or custom pricing unit to use. + */ + currency?: string | null; - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; + /** + * Costs returned are exclusive of `timeframe_end`. + */ + timeframe_end?: string | null; - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; + /** + * Costs returned are inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; - /** - * The start date of the minimum interval. - */ - start_date: string; - } + /** + * Controls whether Orb returns cumulative costs since the start of the billing + * period, or incremental day-by-day costs. If your customer has minimums or + * discounts, it's strongly recommended that you use the default cumulative + * behavior. + */ + view_mode?: 'periodic' | 'cumulative' | null; +} - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; +export interface SubscriptionFetchScheduleParams extends PageParams { + 'start_date[gt]'?: string | null; - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; + 'start_date[gte]'?: string | null; - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + 'start_date[lt]'?: string | null; + + 'start_date[lte]'?: string | null; +} +export interface SubscriptionFetchUsageParams { /** - * A pending subscription change if one exists on this subscription. + * When specified in conjunction with `group_by`, this parameter filters usage to a + * single billable metric. Note that both `group_by` and `billable_metric_id` must + * be specified together. */ - export interface PendingSubscriptionChange { - id: string; - } + billable_metric_id?: string | null; + + first_dimension_key?: string | null; + + first_dimension_value?: string | null; + + /** + * This determines the windowing of usage reporting. + */ + granularity?: 'day' | null; + + /** + * Groups per-price usage by the key provided. + */ + group_by?: string | null; + + second_dimension_key?: string | null; + + second_dimension_value?: string | null; + + /** + * Usage returned is exclusive of `timeframe_end`. + */ + timeframe_end?: string | null; + + /** + * Usage returned is inclusive of `timeframe_start`. + */ + timeframe_start?: string | null; /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing + * Controls whether Orb returns cumulative usage since the start of the billing + * period, or incremental day-by-day usage. If your customer has minimums or + * discounts, it's strongly recommended that you use the default cumulative * behavior. */ - export interface PriceInterval { - id: string; + view_mode?: 'periodic' | 'cumulative' | null; +} + +export interface SubscriptionPriceIntervalsParams { + /** + * A list of price intervals to add to the subscription. + */ + add?: Array; + + /** + * A list of adjustments to add to the subscription. + */ + add_adjustments?: Array; + + /** + * If false, this request will fail if it would void an issued invoice or create a + * credit note. Consider using this as a safety mechanism if you do not expect + * existing invoices to be changed. + */ + allow_invoice_credit_or_void?: boolean | null; + + /** + * A list of price intervals to edit on the subscription. + */ + edit?: Array; + + /** + * A list of adjustments to edit on the subscription. + */ + edit_adjustments?: Array; +} + +export namespace SubscriptionPriceIntervalsParams { + export interface Add { + /** + * The start date of the price interval. This is the date that the price will start + * billing on the subscription. + */ + start_date: (string & {}) | Shared.BillingCycleRelativeDate; + + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: Shared.NewAllocationPrice | null; + + /** + * A list of discounts to initialize on the price interval. + */ + discounts?: Array< + | Add.AmountDiscountCreationParams + | Add.PercentageDiscountCreationParams + | Add.UsageDiscountCreationParams + > | null; /** - * The day of the month that Orb bills for this price + * The end date of the price interval. This is the date that the price will stop + * billing on the subscription. */ - billing_cycle_day: number; + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. + * The external price id of the price to add to the subscription. */ - current_billing_period_end_date: string | null; + external_price_id?: string | null; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. */ - current_billing_period_start_date: string | null; + filter?: string | null; /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. + * A list of fixed fee quantity transitions to initialize on the price interval. */ - end_date: string | null; + fixed_fee_quantity_transitions?: Array | null; /** - * An additional filter to apply to usage queries. + * The maximum amount that will be billed for this price interval for a given + * billing period. */ - filter: string | null; + maximum_amount?: number | null; /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. + * The minimum amount that will be billed for this price interval for a given + * billing period. */ - fixed_fee_quantity_transitions: Array | null; + minimum_amount?: number | null; /** - * 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) + * The definition of a new price to create and add to the subscription. */ - price: PricesAPI.Price; + price?: + | Shared.NewFloatingUnitPrice + | Shared.NewFloatingPackagePrice + | Shared.NewFloatingMatrixPrice + | Shared.NewFloatingMatrixWithAllocationPrice + | Shared.NewFloatingTieredPrice + | Shared.NewFloatingTieredBPSPrice + | Shared.NewFloatingBPSPrice + | Shared.NewFloatingBulkBPSPrice + | Shared.NewFloatingBulkPrice + | Shared.NewFloatingThresholdTotalAmountPrice + | Shared.NewFloatingTieredPackagePrice + | Shared.NewFloatingGroupedTieredPrice + | Shared.NewFloatingMaxGroupTieredPackagePrice + | Shared.NewFloatingTieredWithMinimumPrice + | Shared.NewFloatingPackageWithAllocationPrice + | Shared.NewFloatingTieredPackageWithMinimumPrice + | Shared.NewFloatingUnitWithPercentPrice + | Shared.NewFloatingTieredWithProrationPrice + | Shared.NewFloatingUnitWithProrationPrice + | Shared.NewFloatingGroupedAllocationPrice + | Shared.NewFloatingGroupedWithProratedMinimumPrice + | Shared.NewFloatingGroupedWithMeteredMinimumPrice + | Shared.NewFloatingMatrixWithDisplayNamePrice + | Shared.NewFloatingBulkWithProrationPrice + | Shared.NewFloatingGroupedTieredPackagePrice + | Shared.NewFloatingScalableMatrixWithUnitPricingPrice + | Shared.NewFloatingScalableMatrixWithTieredPricingPrice + | Shared.NewFloatingCumulativeGroupedBulkPrice + | null; /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. + * The id of the price to add to the subscription. */ - start_date: string; + price_id?: string | null; /** * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. */ - usage_customer_ids: Array | null; + usage_customer_ids?: Array | null; } - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; + export namespace Add { + export interface AmountDiscountCreationParams { + /** + * Only available if discount_type is `amount`. + */ + amount_discount: number; - price_id: string; + discount_type: 'amount'; + } - quantity: number; + export interface PercentageDiscountCreationParams { + discount_type: 'percentage'; + + /** + * Only available if discount_type is `percentage`. This is a number between 0 + * and 1. + */ + percentage_discount: number; } - } - export interface RedeemedCoupon { - coupon_id: string; + export interface UsageDiscountCreationParams { + discount_type: 'usage'; - end_date: string | null; + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + usage_discount: number; + } - start_date: string; - } + export interface FixedFeeQuantityTransition { + /** + * The date that the fixed fee quantity transition should take effect. + */ + effective_date: string; - export interface TrialInfo { - end_date: string | null; + /** + * The quantity of the fixed fee quantity transition. + */ + quantity: number; + } } - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { + export interface AddAdjustment { /** - * The credit notes that were created as part of this operation. + * The definition of a new adjustment to create and add to the subscription. */ - created_credit_notes: Array; + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** - * The invoices that were created as part of this operation. + * The start date of the adjustment interval. This is the date that the adjustment + * will start affecting prices on the subscription. The adjustment will apply to + * invoice dates that overlap with this `start_date`. This `start_date` is treated + * as inclusive for in-advance prices, and exclusive for in-arrears prices. */ - created_invoices: Array; + start_date: (string & {}) | Shared.BillingCycleRelativeDate; /** - * The credit notes that were voided as part of this operation. + * The end date of the adjustment interval. This is the date that the adjustment + * will stop affecting prices on the subscription. The adjustment will apply to + * invoice dates that overlap with this `end_date`.This `end_date` is treated as + * exclusive for in-advance prices, and inclusive for in-arrears prices. */ - voided_credit_notes: Array; + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + } + export interface Edit { /** - * The invoices that were voided as part of this operation. + * The id of the price interval to edit. */ - voided_invoices: Array; - } -} + price_interval_id: string; -export interface SubscriptionSchedulePlanChangeResponse { - id: string; + /** + * The updated billing cycle day for this price interval. If not specified, the + * billing cycle day will not be updated. Note that overlapping price intervals + * must have the same billing cycle day. + */ + billing_cycle_day?: number | null; - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; + /** + * The updated end date of this price interval. If not specified, the start date + * will not be updated. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + + /** + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. + */ + filter?: string | null; + + /** + * A list of fixed fee quantity transitions to use for this price interval. Note + * that this list will overwrite all existing fixed fee quantity transitions on the + * price interval. + */ + fixed_fee_quantity_transitions?: Array | null; + + /** + * The updated start date of this price interval. If not specified, the start date + * will not be updated. + */ + start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. + */ + usage_customer_ids?: Array | null; + } + + export namespace Edit { + export interface FixedFeeQuantityTransition { + /** + * The date that the fixed fee quantity transition should take effect. + */ + effective_date: string; + + /** + * The quantity of the fixed fee quantity transition. + */ + quantity: number; + } + } + + export interface EditAdjustment { + /** + * The id of the adjustment interval to edit. + */ + adjustment_interval_id: string; + + /** + * The updated end date of this adjustment interval. If not specified, the start + * date will not be updated. + */ + end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; + + /** + * The updated start date of this adjustment interval. If not specified, the start + * date will not be updated. + */ + start_date?: (string & {}) | Shared.BillingCycleRelativeDate; + } +} + +export interface SubscriptionRedeemCouponParams { + change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. + * If false, this request will fail if it would void an issued invoice or create a + * credit note. Consider using this as a safety mechanism if you do not expect + * existing invoices to be changed. */ - adjustment_intervals: Array; + allow_invoice_credit_or_void?: boolean | null; /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. + * The date that the coupon discount should take effect. This parameter can only be + * passed if the `change_option` is `requested_date`. */ - auto_collection: boolean | null; + change_date?: string | null; - billing_cycle_anchor_configuration: SubscriptionSchedulePlanChangeResponse.BillingCycleAnchorConfiguration; + /** + * Coupon ID to be redeemed for this subscription. + */ + coupon_id?: string | null; /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * Redemption code of the coupon to be redeemed for this subscription. */ - billing_cycle_day: number; + coupon_redemption_code?: string | null; +} - created_at: string; +export interface SubscriptionSchedulePlanChangeParams { + change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. + * Additional adjustments to be added to the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) */ - current_billing_period_end_date: string | null; + add_adjustments?: Array | null; /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. + * Additional prices to be added to the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) */ - current_billing_period_start_date: string | null; + add_prices?: Array | null; /** - * 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. + * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be + * aligned with the plan change's effective date. */ - customer: CustomersAPI.Customer; + align_billing_with_plan_change_date?: boolean | null; /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. + * Determines whether issued invoices for this subscription will automatically be + * charged with the saved payment method on the due date. If not specified, this + * defaults to the behavior configured for this customer. */ - default_invoice_memo: string | null; + auto_collection?: boolean | null; /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * Reset billing periods to be aligned with the plan change's effective date or + * start of the month. Defaults to `unchanged` which keeps subscription's existing + * billing cycle alignment. */ - discount_intervals: Array< - | SubscriptionSchedulePlanChangeResponse.AmountDiscountInterval - | SubscriptionSchedulePlanChangeResponse.PercentageDiscountInterval - | SubscriptionSchedulePlanChangeResponse.UsageDiscountInterval - >; + billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null; + + billing_cycle_anchor_configuration?: Shared.BillingCycleAnchorConfiguration | null; /** - * The date Orb stops billing for this subscription. + * The date that the plan change should take effect. This parameter can only be + * passed if the `change_option` is `requested_date`. If a date with no time is + * passed, the plan change will happen at midnight in the customer's timezone. */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; + change_date?: string | null; - invoicing_threshold: string | null; + /** + * Redemption code to be used for this subscription. If the coupon cannot be found + * by its redemption code, or cannot be redeemed, an error response will be + * returned and the subscription creation or plan change will not be scheduled. + */ + coupon_redemption_code?: string | null; /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * @deprecated */ - maximum_intervals: Array; + credits_overage_rate?: 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`. + * Determines the default memo on this subscription's invoices. Note that if this + * is not provided, it is determined by the plan configuration. */ - metadata: Record; + default_invoice_memo?: string | null; /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * The external_plan_id of the plan that the given subscription should be switched + * to. Note that either this property or `plan_id` must be specified. */ - minimum_intervals: Array; + external_plan_id?: string | null; /** - * The name of the subscription. + * An additional filter to apply to usage queries. This filter must be expressed as + * a boolean + * [computed property](/extensibility/advanced-metrics#computed-properties). If + * null, usage queries will not include any additional filter. */ - name: string; + filter?: string | null; /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. + * The phase of the plan to start with */ - net_terms: number; + initial_phase_order?: number | null; /** - * A pending subscription change if one exists on this subscription. + * When this subscription's accrued usage reaches this threshold, an invoice will + * be issued for the subscription. If not specified, invoices will only be issued + * at the end of the billing period. */ - pending_subscription_change: SubscriptionSchedulePlanChangeResponse.PendingSubscriptionChange | null; + invoicing_threshold?: string | null; /** - * 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). + * The net terms determines the difference between the invoice date and the issue + * date for the invoice. If you intend the invoice to be due on issue, set this + * to 0. If not provided, this defaults to the value specified in the plan. */ - plan: PlansAPI.Plan | null; + net_terms?: number | null; /** - * The price intervals for this subscription. + * @deprecated */ - price_intervals: Array; + per_credit_overage_amount?: number | null; - redeemed_coupon: SubscriptionSchedulePlanChangeResponse.RedeemedCoupon | null; + /** + * The plan that the given subscription should be switched to. Note that either + * this property or `external_plan_id` must be specified. + */ + plan_id?: string | null; /** - * The date Orb starts billing for this subscription. + * Specifies which version of the plan to change to. If null, the default version + * will be used. */ - start_date: string; + plan_version_number?: number | null; - status: 'active' | 'ended' | 'upcoming'; + /** + * @deprecated Optionally provide a list of overrides for prices on the plan + */ + price_overrides?: Array | null; - trial_info: SubscriptionSchedulePlanChangeResponse.TrialInfo; + /** + * Plan adjustments to be removed from the subscription. (Only available for + * accounts that have migrated off of legacy subscription overrides) + */ + remove_adjustments?: Array | null; /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. + * Plan prices to be removed from the subscription. (Only available for accounts + * that have migrated off of legacy subscription overrides) */ - changed_resources?: SubscriptionSchedulePlanChangeResponse.ChangedResources | null; -} + remove_prices?: Array | null; -export namespace SubscriptionSchedulePlanChangeResponse { - export interface AdjustmentInterval { - id: string; + /** + * Plan adjustments to be replaced with additional adjustments on the subscription. + * (Only available for accounts that have migrated off of legacy subscription + * overrides) + */ + replace_adjustments?: Array | null; - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + /** + * Plan prices to be replaced with additional prices on the subscription. (Only + * available for accounts that have migrated off of legacy subscription overrides) + */ + replace_prices?: Array | null; - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; + /** + * The duration of the trial period in days. If not provided, this defaults to the + * value specified in the plan. If `0` is provided, the trial on the plan will be + * skipped. + */ + trial_duration_days?: number | null; - /** - * The end date of the adjustment interval. - */ - end_date: string | null; + /** + * A list of customer IDs whose usage events will be aggregated and billed under + * this subscription. By default, a subscription only considers usage events + * associated with its attached customer's customer_id. When usage_customer_ids is + * provided, the subscription includes usage events from the specified customers + * only. Provided usage_customer_ids must be either the customer for this + * subscription itself, or any of that customer's children. + */ + usage_customer_ids?: Array | null; +} +export namespace SubscriptionSchedulePlanChangeParams { + export interface AddAdjustment { /** - * The start date of the adjustment interval. + * The definition of a new adjustment to create and add to the subscription. */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; - export interface BillingCycleAnchorConfiguration { /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. + * The end date of the adjustment interval. This is the date that the adjustment + * will stop affecting prices on the subscription. */ - day: number; + end_date?: string | null; /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). + * The phase to add this adjustment to. */ - month?: number | null; + plan_phase_order?: number | null; /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). + * The start date of the adjustment interval. This is the date that the adjustment + * will start affecting prices on the subscription. If null, the adjustment will + * start when the phase or subscription starts. */ - year?: number | null; + start_date?: string | null; } - export interface AmountDiscountInterval { + export interface AddPrice { /** - * Only available if discount_type is `amount`. + * The definition of a new allocation price to create and add to the subscription. */ - amount_discount: string; + allocation_price?: Shared.NewAllocationPrice | null; /** - * The price interval ids that this discount interval applies to. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for this price. */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; + discounts?: Array | null; /** - * The end date of the discount interval. + * The end date of the price interval. This is the date that the price will stop + * billing on the subscription. If null, billing will end when the phase or + * subscription ends. */ - end_date: string | null; + end_date?: string | null; /** - * The filters that determine which prices this discount interval applies to. + * The external price id of the price to add to the subscription. */ - filters: Array; + external_price_id?: string | null; /** - * The start date of the discount interval. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for this price. */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } + maximum_amount?: string | null; - export interface PercentageDiscountInterval { /** - * The price interval ids that this discount interval applies to. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for this price. */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; + minimum_amount?: string | null; /** - * The end date of the discount interval. + * The phase to add this price to. */ - end_date: string | null; + plan_phase_order?: number | null; /** - * The filters that determine which prices this discount interval applies to. + * The definition of a new price to create and add to the subscription. */ - filters: Array; + price?: + | SubscriptionsAPI.NewSubscriptionUnitPrice + | SubscriptionsAPI.NewSubscriptionPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixPrice + | SubscriptionsAPI.NewSubscriptionTieredPrice + | SubscriptionsAPI.NewSubscriptionTieredBPSPrice + | SubscriptionsAPI.NewSubscriptionBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkPrice + | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice + | SubscriptionsAPI.NewSubscriptionTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice + | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice + | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice + | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice + | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice + | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice + | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice + | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice + | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice + | null; /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. + * The id of the price to add to the subscription. */ - percentage_discount: number; + price_id?: string | null; /** - * The start date of the discount interval. + * The start date of the price interval. This is the date that the price will start + * billing on the subscription. If null, billing will start when the phase or + * subscription starts. */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } + start_date?: string | null; } - export interface UsageDiscountInterval { + export interface RemoveAdjustment { /** - * The price interval ids that this discount interval applies to. + * The id of the adjustment to remove on the subscription. */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; + adjustment_id: string; + } + export interface RemovePrice { /** - * The end date of the discount interval. + * The external price id of the price to remove on the subscription. */ - end_date: string | null; + external_price_id?: string | null; /** - * The filters that determine which prices this discount interval applies to. + * The id of the price to remove on the subscription. */ - filters: Array; + price_id?: string | null; + } + export interface ReplaceAdjustment { /** - * The start date of the discount interval. + * The definition of a new adjustment to create and add to the subscription. */ - start_date: string; + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for + * The id of the adjustment on the plan to replace in the subscription. */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; + replaces_adjustment_id: string; } - export interface MaximumInterval { + export interface ReplacePrice { /** - * The price interval ids that this maximum interval applies to. + * The id of the price on the plan to replace in the subscription. */ - applies_to_price_interval_ids: Array; + replaces_price_id: string; /** - * The end date of the maximum interval. + * The definition of a new allocation price to create and add to the subscription. */ - end_date: string | null; + allocation_price?: Shared.NewAllocationPrice | null; /** - * The filters that determine which prices this maximum interval applies to. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's + * discounts for the replacement price. */ - filters: Array; + discounts?: Array | null; /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. + * The external price id of the price to add to the subscription. */ - maximum_amount: string; + external_price_id?: string | null; /** - * The start date of the maximum interval. + * The new quantity of the price, if the price is a fixed price. */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; + fixed_price_quantity?: number | null; /** - * The invoices that were created as part of this operation. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum + * amount for the replacement price. */ - created_invoices: Array; + maximum_amount?: string | null; /** - * The credit notes that were voided as part of this operation. + * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum + * amount for the replacement price. */ - voided_credit_notes: Array; + minimum_amount?: string | null; /** - * The invoices that were voided as part of this operation. + * The definition of a new price to create and add to the subscription. */ - voided_invoices: Array; - } -} - -export interface SubscriptionTriggerPhaseResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionTriggerPhaseResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionTriggerPhaseResponse.AmountDiscountInterval - | SubscriptionTriggerPhaseResponse.PercentageDiscountInterval - | SubscriptionTriggerPhaseResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionTriggerPhaseResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionTriggerPhaseResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionTriggerPhaseResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionTriggerPhaseResponse.ChangedResources | null; -} - -export namespace SubscriptionTriggerPhaseResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; + price?: + | SubscriptionsAPI.NewSubscriptionUnitPrice + | SubscriptionsAPI.NewSubscriptionPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixPrice + | SubscriptionsAPI.NewSubscriptionTieredPrice + | SubscriptionsAPI.NewSubscriptionTieredBPSPrice + | SubscriptionsAPI.NewSubscriptionBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkBPSPrice + | SubscriptionsAPI.NewSubscriptionBulkPrice + | SubscriptionsAPI.NewSubscriptionThresholdTotalAmountPrice + | SubscriptionsAPI.NewSubscriptionTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionTieredWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionUnitWithPercentPrice + | SubscriptionsAPI.NewSubscriptionPackageWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTierWithProrationPrice + | SubscriptionsAPI.NewSubscriptionUnitWithProrationPrice + | SubscriptionsAPI.NewSubscriptionGroupedAllocationPrice + | SubscriptionsAPI.NewSubscriptionGroupedWithProratedMinimumPrice + | SubscriptionsAPI.NewSubscriptionBulkWithProrationPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithUnitPricingPrice + | SubscriptionsAPI.NewSubscriptionScalableMatrixWithTieredPricingPrice + | SubscriptionsAPI.NewSubscriptionCumulativeGroupedBulkPrice + | SubscriptionsAPI.NewSubscriptionMaxGroupTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionGroupedWithMeteredMinimumPrice + | SubscriptionsAPI.NewSubscriptionMatrixWithDisplayNamePrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPackagePrice + | SubscriptionsAPI.NewSubscriptionMatrixWithAllocationPrice + | SubscriptionsAPI.NewSubscriptionTieredPackageWithMinimumPrice + | SubscriptionsAPI.NewSubscriptionGroupedTieredPrice + | null; /** - * The price interval IDs that this adjustment applies to. + * The id of the price to add to the subscription. */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionUnscheduleCancellationResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionUnscheduleCancellationResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionUnscheduleCancellationResponse.AmountDiscountInterval - | SubscriptionUnscheduleCancellationResponse.PercentageDiscountInterval - | SubscriptionUnscheduleCancellationResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionUnscheduleCancellationResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionUnscheduleCancellationResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionUnscheduleCancellationResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionUnscheduleCancellationResponse.ChangedResources | null; -} - -export namespace SubscriptionUnscheduleCancellationResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.AmountDiscountInterval - | SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.PercentageDiscountInterval - | SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.ChangedResources | null; -} - -export namespace SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionUnschedulePendingPlanChangesResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionUnschedulePendingPlanChangesResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionUnschedulePendingPlanChangesResponse.AmountDiscountInterval - | SubscriptionUnschedulePendingPlanChangesResponse.PercentageDiscountInterval - | SubscriptionUnschedulePendingPlanChangesResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionUnschedulePendingPlanChangesResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionUnschedulePendingPlanChangesResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionUnschedulePendingPlanChangesResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionUnschedulePendingPlanChangesResponse.ChangedResources | null; -} - -export namespace SubscriptionUnschedulePendingPlanChangesResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionUpdateFixedFeeQuantityResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionUpdateFixedFeeQuantityResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionUpdateFixedFeeQuantityResponse.AmountDiscountInterval - | SubscriptionUpdateFixedFeeQuantityResponse.PercentageDiscountInterval - | SubscriptionUpdateFixedFeeQuantityResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionUpdateFixedFeeQuantityResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionUpdateFixedFeeQuantityResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionUpdateFixedFeeQuantityResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionUpdateFixedFeeQuantityResponse.ChangedResources | null; -} - -export namespace SubscriptionUpdateFixedFeeQuantityResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionUpdateTrialResponse { - id: string; - - /** - * The current plan phase that is active, only if the subscription's plan has - * phases. - */ - active_plan_phase_order: number | null; - - /** - * The adjustment intervals for this subscription sorted by the start_date of the - * adjustment interval. - */ - adjustment_intervals: Array; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. If null, defaults to the customer's setting. - */ - auto_collection: boolean | null; - - billing_cycle_anchor_configuration: SubscriptionUpdateTrialResponse.BillingCycleAnchorConfiguration; - - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - billing_cycle_day: number; - - created_at: string; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is not part of the billing period. Set to null for - * subscriptions that are not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if the subscription is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * 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. - */ - customer: CustomersAPI.Customer; - - /** - * Determines the default memo on this subscriptions' invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo: string | null; - - /** - * @deprecated The discount intervals for this subscription sorted by the - * start_date. - */ - discount_intervals: Array< - | SubscriptionUpdateTrialResponse.AmountDiscountInterval - | SubscriptionUpdateTrialResponse.PercentageDiscountInterval - | SubscriptionUpdateTrialResponse.UsageDiscountInterval - >; - - /** - * The date Orb stops billing for this subscription. - */ - end_date: string | null; - - fixed_fee_quantity_schedule: Array; - - invoicing_threshold: string | null; - - /** - * @deprecated The maximum intervals for this subscription sorted by the - * start_date. - */ - maximum_intervals: Array; - - /** - * User specified key-value pairs for the resource. If not present, this defaults - * to an empty dictionary. Individual keys can be removed by setting the value to - * `null`, and the entire metadata mapping can be cleared by setting `metadata` to - * `null`. - */ - metadata: Record; - - /** - * @deprecated The minimum intervals for this subscription sorted by the - * start_date. - */ - minimum_intervals: Array; - - /** - * The name of the subscription. - */ - name: string; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms: number; - - /** - * A pending subscription change if one exists on this subscription. - */ - pending_subscription_change: SubscriptionUpdateTrialResponse.PendingSubscriptionChange | null; - - /** - * 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). - */ - plan: PlansAPI.Plan | null; - - /** - * The price intervals for this subscription. - */ - price_intervals: Array; - - redeemed_coupon: SubscriptionUpdateTrialResponse.RedeemedCoupon | null; - - /** - * The date Orb starts billing for this subscription. - */ - start_date: string; - - status: 'active' | 'ended' | 'upcoming'; - - trial_info: SubscriptionUpdateTrialResponse.TrialInfo; - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - changed_resources?: SubscriptionUpdateTrialResponse.ChangedResources | null; -} - -export namespace SubscriptionUpdateTrialResponse { - export interface AdjustmentInterval { - id: string; - - adjustment: - | AdjustmentInterval.PlanPhaseUsageDiscountAdjustment - | AdjustmentInterval.PlanPhaseAmountDiscountAdjustment - | AdjustmentInterval.PlanPhasePercentageDiscountAdjustment - | AdjustmentInterval.PlanPhaseMinimumAdjustment - | AdjustmentInterval.PlanPhaseMaximumAdjustment; - - /** - * The price interval IDs that this adjustment applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the adjustment interval. - */ - end_date: string | null; - - /** - * The start date of the adjustment interval. - */ - start_date: string; - } - - export namespace AdjustmentInterval { - export interface PlanPhaseUsageDiscountAdjustment { - id: string; - - adjustment_type: 'usage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - - /** - * The number of usage units by which to discount the price this adjustment applies - * to in a given billing period. - */ - usage_discount: number; - } - - export namespace PlanPhaseUsageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseAmountDiscountAdjustment { - id: string; - - adjustment_type: 'amount_discount'; - - /** - * The amount by which to discount the prices this adjustment applies to in a given - * billing period. - */ - amount_discount: string; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseAmountDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhasePercentageDiscountAdjustment { - id: string; - - adjustment_type: 'percentage_discount'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The percentage (as a value between 0 and 1) by which to discount the price - * intervals this adjustment applies to in a given billing period. - */ - percentage_discount: number; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhasePercentageDiscountAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMinimumAdjustment { - id: string; - - adjustment_type: 'minimum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - /** - * The minimum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - minimum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMinimumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PlanPhaseMaximumAdjustment { - id: string; - - adjustment_type: 'maximum'; - - /** - * @deprecated The price IDs that this adjustment applies to. - */ - applies_to_price_ids: Array; - - /** - * The filters that determine which prices to apply this adjustment to. - */ - filters: Array; - - /** - * True for adjustments that apply to an entire invocice, false for adjustments - * that apply to only one price. - */ - is_invoice_level: boolean; - - /** - * The maximum amount to charge in a given billing period for the prices this - * adjustment applies to. - */ - maximum_amount: string; - - /** - * The plan phase in which this adjustment is active. - */ - plan_phase_order: number | null; - - /** - * The reason for the adjustment. - */ - reason: string | null; - } - - export namespace PlanPhaseMaximumAdjustment { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface AmountDiscountInterval { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: string; - - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'amount'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace AmountDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface PercentageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'percentage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * Only available if discount_type is `percentage`.This is a number between 0 - * and 1. - */ - percentage_discount: number; - - /** - * The start date of the discount interval. - */ - start_date: string; - } - - export namespace PercentageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface UsageDiscountInterval { - /** - * The price interval ids that this discount interval applies to. - */ - applies_to_price_interval_ids: Array; - - discount_type: 'usage'; - - /** - * The end date of the discount interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this discount interval applies to. - */ - filters: Array; - - /** - * The start date of the discount interval. - */ - start_date: string; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount: number; - } - - export namespace UsageDiscountInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface FixedFeeQuantitySchedule { - end_date: string | null; - - price_id: string; - - quantity: number; - - start_date: string; - } - - export interface MaximumInterval { - /** - * The price interval ids that this maximum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the maximum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this maximum interval applies to. - */ - filters: Array; - - /** - * The maximum amount to charge in a given billing period for the price intervals - * this transform applies to. - */ - maximum_amount: string; - - /** - * The start date of the maximum interval. - */ - start_date: string; - } - - export namespace MaximumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - export interface MinimumInterval { - /** - * The price interval ids that this minimum interval applies to. - */ - applies_to_price_interval_ids: Array; - - /** - * The end date of the minimum interval. - */ - end_date: string | null; - - /** - * The filters that determine which prices this minimum interval applies to. - */ - filters: Array; - - /** - * The minimum amount to charge in a given billing period for the price intervals - * this minimum applies to. - */ - minimum_amount: string; - - /** - * The start date of the minimum interval. - */ - start_date: string; - } - - export namespace MinimumInterval { - export interface Filter { - /** - * The property of the price to filter on. - */ - field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id'; - - /** - * Should prices that match the filter be included or excluded. - */ - operator: 'includes' | 'excludes'; - - /** - * The IDs or values that match this filter. - */ - values: Array; - } - } - - /** - * A pending subscription change if one exists on this subscription. - */ - export interface PendingSubscriptionChange { - id: string; - } - - /** - * The Price Interval resource represents a period of time for which a price will - * bill on a subscription. A subscription’s price intervals define its billing - * behavior. - */ - export interface PriceInterval { - id: string; - - /** - * The day of the month that Orb bills for this price - */ - billing_cycle_day: number; - - /** - * The end of the current billing period. This is an exclusive timestamp, such that - * the instant returned is exactly the end of the billing period. Set to null if - * this price interval is not currently active. - */ - current_billing_period_end_date: string | null; - - /** - * The start date of the current billing period. This is an inclusive timestamp; - * the instant returned is exactly the beginning of the billing period. Set to null - * if this price interval is not currently active. - */ - current_billing_period_start_date: string | null; - - /** - * The end date of the price interval. This is the date that Orb stops billing for - * this price. - */ - end_date: string | null; - - /** - * An additional filter to apply to usage queries. - */ - filter: string | null; - - /** - * The fixed fee quantity transitions for this price interval. This is only - * relevant for fixed fees. - */ - fixed_fee_quantity_transitions: Array | null; - - /** - * 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) - */ - price: PricesAPI.Price; - - /** - * The start date of the price interval. This is the date that Orb starts billing - * for this price. - */ - start_date: string; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this price interval. - */ - usage_customer_ids: Array | null; - } - - export namespace PriceInterval { - export interface FixedFeeQuantityTransition { - effective_date: string; - - price_id: string; - - quantity: number; - } - } - - export interface RedeemedCoupon { - coupon_id: string; - - end_date: string | null; - - start_date: string; - } - - export interface TrialInfo { - end_date: string | null; - } - - /** - * The resources that were changed as part of this operation. Only present when - * fetched through the subscription changes API or if the - * `include_changed_resources` parameter was passed in the request. - */ - export interface ChangedResources { - /** - * The credit notes that were created as part of this operation. - */ - created_credit_notes: Array; - - /** - * The invoices that were created as part of this operation. - */ - created_invoices: Array; - - /** - * The credit notes that were voided as part of this operation. - */ - voided_credit_notes: Array; - - /** - * The invoices that were voided as part of this operation. - */ - voided_invoices: Array; - } -} - -export interface SubscriptionCreateParams { - /** - * Additional adjustments to be added to the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - add_adjustments?: Array | null; - - /** - * Additional prices to be added to the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - add_prices?: Array | null; - - align_billing_with_subscription_start_date?: boolean; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. If not specified, this - * defaults to the behavior configured for this customer. - */ - auto_collection?: boolean | null; - - /** - * @deprecated - */ - aws_region?: string | null; - - billing_cycle_anchor_configuration?: SubscriptionCreateParams.BillingCycleAnchorConfiguration | null; - - /** - * Redemption code to be used for this subscription. If the coupon cannot be found - * by its redemption code, or cannot be redeemed, an error response will be - * returned and the subscription creation or plan change will not be scheduled. - */ - coupon_redemption_code?: string | null; - - /** - * @deprecated - */ - credits_overage_rate?: number | null; - - /** - * The currency to use for the subscription. If not specified, the invoicing - * currency for the plan will be used. - */ - currency?: string | null; - - customer_id?: string | null; - - /** - * Determines the default memo on this subscription's invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo?: string | null; - - end_date?: string | null; - - external_customer_id?: string | null; - - /** - * @deprecated - */ - external_marketplace?: 'google' | 'aws' | 'azure' | null; - - /** - * @deprecated - */ - external_marketplace_reporting_id?: string | null; - - /** - * The external_plan_id of the plan that the given subscription should be switched - * to. Note that either this property or `plan_id` must be specified. - */ - external_plan_id?: string | null; - - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; - - /** - * The phase of the plan to start with - */ - initial_phase_order?: number | null; - - /** - * When this subscription's accrued usage reaches this threshold, an invoice will - * be issued for the subscription. If not specified, invoices will only be issued - * at the end of the billing period. - */ - invoicing_threshold?: string | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * The name to use for the subscription. If not specified, the plan name will be - * used. - */ - name?: string | null; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. If not provided, this defaults to the value specified in the plan. - */ - net_terms?: number | null; - - /** - * @deprecated - */ - per_credit_overage_amount?: number | null; - - /** - * The plan that the given subscription should be switched to. Note that either - * this property or `external_plan_id` must be specified. - */ - plan_id?: string | null; - - /** - * Specifies which version of the plan to subscribe to. If null, the default - * version will be used. - */ - plan_version_number?: number | null; - - /** - * @deprecated Optionally provide a list of overrides for prices on the plan - */ - price_overrides?: Array | null; - - /** - * Plan adjustments to be removed from the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - remove_adjustments?: Array | null; - - /** - * Plan prices to be removed from the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - remove_prices?: Array | null; - - /** - * Plan adjustments to be replaced with additional adjustments on the subscription. - * (Only available for accounts that have migrated off of legacy subscription - * overrides) - */ - replace_adjustments?: Array | null; - - /** - * Plan prices to be replaced with additional prices on the subscription. (Only - * available for accounts that have migrated off of legacy subscription overrides) - */ - replace_prices?: Array | null; - - start_date?: string | null; - - /** - * The duration of the trial period in days. If not provided, this defaults to the - * value specified in the plan. If `0` is provided, the trial on the plan will be - * skipped. - */ - trial_duration_days?: number | null; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; -} - -export namespace SubscriptionCreateParams { - export interface AddAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; - - /** - * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. - */ - end_date?: string | null; - - /** - * The phase to add this adjustment to. - */ - plan_phase_order?: number | null; - - /** - * The start date of the adjustment interval. This is the date that the adjustment - * will start affecting prices on the subscription. If null, the adjustment will - * start when the phase or subscription starts. - */ - start_date?: string | null; - } - - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: AddPrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for this price. - */ - discounts?: Array | null; - - /** - * The end date of the price interval. This is the date that the price will stop - * billing on the subscription. If null, billing will end when the phase or - * subscription ends. - */ - end_date?: string | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for this price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for this price. - */ - minimum_amount?: string | null; - - /** - * The phase to add this price to. - */ - plan_phase_order?: number | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | AddPrice.NewSubscriptionUnitPrice - | AddPrice.NewSubscriptionPackagePrice - | AddPrice.NewSubscriptionMatrixPrice - | AddPrice.NewSubscriptionTieredPrice - | AddPrice.NewSubscriptionTieredBpsPrice - | AddPrice.NewSubscriptionBpsPrice - | AddPrice.NewSubscriptionBulkBpsPrice - | AddPrice.NewSubscriptionBulkPrice - | AddPrice.NewSubscriptionThresholdTotalAmountPrice - | AddPrice.NewSubscriptionTieredPackagePrice - | AddPrice.NewSubscriptionTieredWithMinimumPrice - | AddPrice.NewSubscriptionUnitWithPercentPrice - | AddPrice.NewSubscriptionPackageWithAllocationPrice - | AddPrice.NewSubscriptionTierWithProrationPrice - | AddPrice.NewSubscriptionUnitWithProrationPrice - | AddPrice.NewSubscriptionGroupedAllocationPrice - | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice - | AddPrice.NewSubscriptionBulkWithProrationPrice - | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice - | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice - | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice - | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice - | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice - | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice - | AddPrice.NewSubscriptionGroupedTieredPackagePrice - | AddPrice.NewSubscriptionMatrixWithAllocationPrice - | AddPrice.NewSubscriptionTieredPackageWithMinimumPrice - | AddPrice.NewSubscriptionGroupedTieredPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - - /** - * The start date of the price interval. This is the date that the price will start - * billing on the subscription. If null, billing will start when the phase or - * subscription starts. - */ - start_date?: string | null; - } - - export namespace AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; - - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount?: number | null; - } - - export interface NewSubscriptionUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewSubscriptionUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewSubscriptionPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove on the subscription. - */ - adjustment_id: string; - } - - export interface RemovePrice { - /** - * The external price id of the price to remove on the subscription. - */ - external_price_id?: string | null; - - /** - * The id of the price to remove on the subscription. - */ - price_id?: string | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } - - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the subscription. - */ - replaces_price_id: string; - - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for the replacement price. - */ - discounts?: Array | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * The new quantity of the price, if the price is a fixed price. - */ - fixed_price_quantity?: number | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for the replacement price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for the replacement price. - */ - minimum_amount?: string | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | ReplacePrice.NewSubscriptionUnitPrice - | ReplacePrice.NewSubscriptionPackagePrice - | ReplacePrice.NewSubscriptionMatrixPrice - | ReplacePrice.NewSubscriptionTieredPrice - | ReplacePrice.NewSubscriptionTieredBpsPrice - | ReplacePrice.NewSubscriptionBpsPrice - | ReplacePrice.NewSubscriptionBulkBpsPrice - | ReplacePrice.NewSubscriptionBulkPrice - | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice - | ReplacePrice.NewSubscriptionTieredPackagePrice - | ReplacePrice.NewSubscriptionTieredWithMinimumPrice - | ReplacePrice.NewSubscriptionUnitWithPercentPrice - | ReplacePrice.NewSubscriptionPackageWithAllocationPrice - | ReplacePrice.NewSubscriptionTierWithProrationPrice - | ReplacePrice.NewSubscriptionUnitWithProrationPrice - | ReplacePrice.NewSubscriptionGroupedAllocationPrice - | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice - | ReplacePrice.NewSubscriptionBulkWithProrationPrice - | ReplacePrice.NewSubscriptionScalableMatrixWithUnitPricingPrice - | ReplacePrice.NewSubscriptionScalableMatrixWithTieredPricingPrice - | ReplacePrice.NewSubscriptionCumulativeGroupedBulkPrice - | ReplacePrice.NewSubscriptionMaxGroupTieredPackagePrice - | ReplacePrice.NewSubscriptionGroupedWithMeteredMinimumPrice - | ReplacePrice.NewSubscriptionMatrixWithDisplayNamePrice - | ReplacePrice.NewSubscriptionGroupedTieredPackagePrice - | ReplacePrice.NewSubscriptionMatrixWithAllocationPrice - | ReplacePrice.NewSubscriptionTieredPackageWithMinimumPrice - | ReplacePrice.NewSubscriptionGroupedTieredPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } - - export namespace ReplacePrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; - - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount?: number | null; - } - - export interface NewSubscriptionUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewSubscriptionUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewSubscriptionPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } -} - -export interface SubscriptionUpdateParams { - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. This property defaults to - * the plan's behavior. - */ - auto_collection?: boolean | null; - - /** - * Determines the default memo on this subscription's invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo?: string | null; - - /** - * When this subscription's accrued usage reaches this threshold, an invoice will - * be issued for the subscription. If not specified, invoices will only be issued - * at the end of the billing period. - */ - invoicing_threshold?: string | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * Determines the difference between the invoice issue date for subscription - * invoices as the date that they are due. A value of `0` here represents that the - * invoice is due on issue, whereas a value of `30` represents that the customer - * has a month to pay the invoice. - */ - net_terms?: number | null; -} - -export interface SubscriptionListParams extends PageParams { - 'created_at[gt]'?: string | null; - - 'created_at[gte]'?: string | null; - - 'created_at[lt]'?: string | null; - - 'created_at[lte]'?: string | null; - - customer_id?: Array | null; - - external_customer_id?: Array | null; - - status?: 'active' | 'ended' | 'upcoming' | null; -} - -export interface SubscriptionCancelParams { - /** - * Determines the timing of subscription cancellation - */ - cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date'; - - /** - * If false, this request will fail if it would void an issued invoice or create a - * credit note. Consider using this as a safety mechanism if you do not expect - * existing invoices to be changed. - */ - allow_invoice_credit_or_void?: boolean | null; - - /** - * The date that the cancellation should take effect. This parameter can only be - * passed if the `cancel_option` is `requested_date`. - */ - cancellation_date?: string | null; -} - -export interface SubscriptionFetchCostsParams { - /** - * The currency or custom pricing unit to use. - */ - currency?: string | null; - - /** - * Costs returned are exclusive of `timeframe_end`. - */ - timeframe_end?: string | null; - - /** - * Costs returned are inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; - - /** - * Controls whether Orb returns cumulative costs since the start of the billing - * period, or incremental day-by-day costs. If your customer has minimums or - * discounts, it's strongly recommended that you use the default cumulative - * behavior. - */ - view_mode?: 'periodic' | 'cumulative' | null; -} - -export interface SubscriptionFetchScheduleParams extends PageParams { - 'start_date[gt]'?: string | null; - - 'start_date[gte]'?: string | null; - - 'start_date[lt]'?: string | null; - - 'start_date[lte]'?: string | null; -} - -export interface SubscriptionFetchUsageParams { - /** - * When specified in conjunction with `group_by`, this parameter filters usage to a - * single billable metric. Note that both `group_by` and `billable_metric_id` must - * be specified together. - */ - billable_metric_id?: string | null; - - first_dimension_key?: string | null; - - first_dimension_value?: string | null; - - /** - * This determines the windowing of usage reporting. - */ - granularity?: 'day' | null; - - /** - * Groups per-price usage by the key provided. - */ - group_by?: string | null; - - second_dimension_key?: string | null; - - second_dimension_value?: string | null; - - /** - * Usage returned is exclusive of `timeframe_end`. - */ - timeframe_end?: string | null; - - /** - * Usage returned is inclusive of `timeframe_start`. - */ - timeframe_start?: string | null; - - /** - * Controls whether Orb returns cumulative usage since the start of the billing - * period, or incremental day-by-day usage. If your customer has minimums or - * discounts, it's strongly recommended that you use the default cumulative - * behavior. - */ - view_mode?: 'periodic' | 'cumulative' | null; -} - -export interface SubscriptionPriceIntervalsParams { - /** - * A list of price intervals to add to the subscription. - */ - add?: Array; - - /** - * A list of adjustments to add to the subscription. - */ - add_adjustments?: Array; - - /** - * If false, this request will fail if it would void an issued invoice or create a - * credit note. Consider using this as a safety mechanism if you do not expect - * existing invoices to be changed. - */ - allow_invoice_credit_or_void?: boolean | null; - - /** - * A list of price intervals to edit on the subscription. - */ - edit?: Array; - - /** - * A list of adjustments to edit on the subscription. - */ - edit_adjustments?: Array; -} - -export namespace SubscriptionPriceIntervalsParams { - export interface Add { - /** - * The start date of the price interval. This is the date that the price will start - * billing on the subscription. - */ - start_date: (string & {}) | Shared.BillingCycleRelativeDate; - - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: Add.AllocationPrice | null; - - /** - * A list of discounts to initialize on the price interval. - */ - discounts?: Array< - | Add.AmountDiscountCreationParams - | Add.PercentageDiscountCreationParams - | Add.UsageDiscountCreationParams - > | null; - - /** - * The end date of the price interval. This is the date that the price will stop - * billing on the subscription. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; - - /** - * A list of fixed fee quantity transitions to initialize on the price interval. - */ - fixed_fee_quantity_transitions?: Array | null; - - /** - * The maximum amount that will be billed for this price interval for a given - * billing period. - */ - maximum_amount?: number | null; - - /** - * The minimum amount that will be billed for this price interval for a given - * billing period. - */ - minimum_amount?: number | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | Add.NewFloatingUnitPrice - | Add.NewFloatingPackagePrice - | Add.NewFloatingMatrixPrice - | Add.NewFloatingMatrixWithAllocationPrice - | Add.NewFloatingTieredPrice - | Add.NewFloatingTieredBpsPrice - | Add.NewFloatingBpsPrice - | Add.NewFloatingBulkBpsPrice - | Add.NewFloatingBulkPrice - | Add.NewFloatingThresholdTotalAmountPrice - | Add.NewFloatingTieredPackagePrice - | Add.NewFloatingGroupedTieredPrice - | Add.NewFloatingMaxGroupTieredPackagePrice - | Add.NewFloatingTieredWithMinimumPrice - | Add.NewFloatingPackageWithAllocationPrice - | Add.NewFloatingTieredPackageWithMinimumPrice - | Add.NewFloatingUnitWithPercentPrice - | Add.NewFloatingTieredWithProrationPrice - | Add.NewFloatingUnitWithProrationPrice - | Add.NewFloatingGroupedAllocationPrice - | Add.NewFloatingGroupedWithProratedMinimumPrice - | Add.NewFloatingGroupedWithMeteredMinimumPrice - | Add.NewFloatingMatrixWithDisplayNamePrice - | Add.NewFloatingBulkWithProrationPrice - | Add.NewFloatingGroupedTieredPackagePrice - | Add.NewFloatingScalableMatrixWithUnitPricingPrice - | Add.NewFloatingScalableMatrixWithTieredPricingPrice - | Add.NewFloatingCumulativeGroupedBulkPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; - } - - export namespace Add { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface AmountDiscountCreationParams { - /** - * Only available if discount_type is `amount`. - */ - amount_discount: number; - - discount_type: 'amount'; - } - - export interface PercentageDiscountCreationParams { - discount_type: 'percentage'; - - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount: number; - } - - export interface UsageDiscountCreationParams { - discount_type: 'usage'; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. - */ - usage_discount: number; - } - - export interface FixedFeeQuantityTransition { - /** - * The date that the fixed fee quantity transition should take effect. - */ - effective_date: string; - - /** - * The quantity of the fixed fee quantity transition. - */ - quantity: number; - } - - export interface NewFloatingUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewFloatingUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewFloatingPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewFloatingMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewFloatingMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewFloatingTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewFloatingTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBpsPrice { - bps_config: NewFloatingBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkBpsPrice { - bulk_bps_config: NewFloatingBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkPrice { - bulk_config: NewFloatingBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingTieredWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingTieredWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingTieredWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingTieredWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingTieredWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_prorated_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_with_metered_minimum'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewFloatingCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * An ISO 4217 currency string for which this price is billed in. - */ - currency: string; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'cumulative_grouped_bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewFloatingCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - } - - export namespace NewFloatingCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } - - export interface AddAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; - - /** - * The start date of the adjustment interval. This is the date that the adjustment - * will start affecting prices on the subscription. The adjustment will apply to - * invoice dates that overlap with this `start_date`. This `start_date` is treated - * as inclusive for in-advance prices, and exclusive for in-arrears prices. - */ - start_date: (string & {}) | Shared.BillingCycleRelativeDate; - - /** - * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. The adjustment will apply to - * invoice dates that overlap with this `end_date`.This `end_date` is treated as - * exclusive for in-advance prices, and inclusive for in-arrears prices. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - } - - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface Edit { - /** - * The id of the price interval to edit. - */ - price_interval_id: string; - - /** - * The updated billing cycle day for this price interval. If not specified, the - * billing cycle day will not be updated. Note that overlapping price intervals - * must have the same billing cycle day. - */ - billing_cycle_day?: number | null; - - /** - * The updated end date of this price interval. If not specified, the start date - * will not be updated. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; - - /** - * A list of fixed fee quantity transitions to use for this price interval. Note - * that this list will overwrite all existing fixed fee quantity transitions on the - * price interval. - */ - fixed_fee_quantity_transitions?: Array | null; - - /** - * The updated start date of this price interval. If not specified, the start date - * will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; - } - - export namespace Edit { - export interface FixedFeeQuantityTransition { - /** - * The date that the fixed fee quantity transition should take effect. - */ - effective_date: string; - - /** - * The quantity of the fixed fee quantity transition. - */ - quantity: number; - } - } - - export interface EditAdjustment { - /** - * The id of the adjustment interval to edit. - */ - adjustment_interval_id: string; - - /** - * The updated end date of this adjustment interval. If not specified, the start - * date will not be updated. - */ - end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; - - /** - * The updated start date of this adjustment interval. If not specified, the start - * date will not be updated. - */ - start_date?: (string & {}) | Shared.BillingCycleRelativeDate; - } -} - -export interface SubscriptionRedeemCouponParams { - change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; - - /** - * Coupon ID to be redeemed for this subscription. - */ - coupon_id: string; - - /** - * If false, this request will fail if it would void an issued invoice or create a - * credit note. Consider using this as a safety mechanism if you do not expect - * existing invoices to be changed. - */ - allow_invoice_credit_or_void?: boolean | null; - - /** - * The date that the coupon discount should take effect. This parameter can only be - * passed if the `change_option` is `requested_date`. - */ - change_date?: string | null; -} - -export interface SubscriptionSchedulePlanChangeParams { - change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate'; - - /** - * Additional adjustments to be added to the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - add_adjustments?: Array | null; - - /** - * Additional prices to be added to the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - add_prices?: Array | null; - - /** - * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be - * aligned with the plan change's effective date. - */ - align_billing_with_plan_change_date?: boolean | null; - - /** - * Determines whether issued invoices for this subscription will automatically be - * charged with the saved payment method on the due date. If not specified, this - * defaults to the behavior configured for this customer. - */ - auto_collection?: boolean | null; - - /** - * Reset billing periods to be aligned with the plan change's effective date or - * start of the month. Defaults to `unchanged` which keeps subscription's existing - * billing cycle alignment. - */ - billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null; - - billing_cycle_anchor_configuration?: SubscriptionSchedulePlanChangeParams.BillingCycleAnchorConfiguration | null; - - /** - * The date that the plan change should take effect. This parameter can only be - * passed if the `change_option` is `requested_date`. If a date with no time is - * passed, the plan change will happen at midnight in the customer's timezone. - */ - change_date?: string | null; - - /** - * Redemption code to be used for this subscription. If the coupon cannot be found - * by its redemption code, or cannot be redeemed, an error response will be - * returned and the subscription creation or plan change will not be scheduled. - */ - coupon_redemption_code?: string | null; - - /** - * @deprecated - */ - credits_overage_rate?: number | null; - - /** - * Determines the default memo on this subscription's invoices. Note that if this - * is not provided, it is determined by the plan configuration. - */ - default_invoice_memo?: string | null; - - /** - * The external_plan_id of the plan that the given subscription should be switched - * to. Note that either this property or `plan_id` must be specified. - */ - external_plan_id?: string | null; - - /** - * An additional filter to apply to usage queries. This filter must be expressed as - * a boolean - * [computed property](/extensibility/advanced-metrics#computed-properties). If - * null, usage queries will not include any additional filter. - */ - filter?: string | null; - - /** - * The phase of the plan to start with - */ - initial_phase_order?: number | null; - - /** - * When this subscription's accrued usage reaches this threshold, an invoice will - * be issued for the subscription. If not specified, invoices will only be issued - * at the end of the billing period. - */ - invoicing_threshold?: string | null; - - /** - * The net terms determines the difference between the invoice date and the issue - * date for the invoice. If you intend the invoice to be due on issue, set this - * to 0. If not provided, this defaults to the value specified in the plan. - */ - net_terms?: number | null; - - /** - * @deprecated - */ - per_credit_overage_amount?: number | null; - - /** - * The plan that the given subscription should be switched to. Note that either - * this property or `external_plan_id` must be specified. - */ - plan_id?: string | null; - - /** - * Specifies which version of the plan to change to. If null, the default version - * will be used. - */ - plan_version_number?: number | null; - - /** - * @deprecated Optionally provide a list of overrides for prices on the plan - */ - price_overrides?: Array | null; - - /** - * Plan adjustments to be removed from the subscription. (Only available for - * accounts that have migrated off of legacy subscription overrides) - */ - remove_adjustments?: Array | null; - - /** - * Plan prices to be removed from the subscription. (Only available for accounts - * that have migrated off of legacy subscription overrides) - */ - remove_prices?: Array | null; - - /** - * Plan adjustments to be replaced with additional adjustments on the subscription. - * (Only available for accounts that have migrated off of legacy subscription - * overrides) - */ - replace_adjustments?: Array | null; - - /** - * Plan prices to be replaced with additional prices on the subscription. (Only - * available for accounts that have migrated off of legacy subscription overrides) - */ - replace_prices?: Array | null; - - /** - * The duration of the trial period in days. If not provided, this defaults to the - * value specified in the plan. If `0` is provided, the trial on the plan will be - * skipped. - */ - trial_duration_days?: number | null; - - /** - * A list of customer IDs whose usage events will be aggregated and billed under - * this subscription. By default, a subscription only considers usage events - * associated with its attached customer's customer_id. When usage_customer_ids is - * provided, the subscription includes usage events from the specified customers - * only. Provided usage_customer_ids must be either the customer for this - * subscription itself, or any of that customer's children. - */ - usage_customer_ids?: Array | null; -} - -export namespace SubscriptionSchedulePlanChangeParams { - export interface AddAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | AddAdjustment.NewPercentageDiscount - | AddAdjustment.NewUsageDiscount - | AddAdjustment.NewAmountDiscount - | AddAdjustment.NewMinimum - | AddAdjustment.NewMaximum; - - /** - * The end date of the adjustment interval. This is the date that the adjustment - * will stop affecting prices on the subscription. - */ - end_date?: string | null; - - /** - * The phase to add this adjustment to. - */ - plan_phase_order?: number | null; - - /** - * The start date of the adjustment interval. This is the date that the adjustment - * will start affecting prices on the subscription. If null, the adjustment will - * start when the phase or subscription starts. - */ - start_date?: string | null; - } - - export namespace AddAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: AddPrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for this price. - */ - discounts?: Array | null; - - /** - * The end date of the price interval. This is the date that the price will stop - * billing on the subscription. If null, billing will end when the phase or - * subscription ends. - */ - end_date?: string | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for this price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for this price. - */ - minimum_amount?: string | null; - - /** - * The phase to add this price to. - */ - plan_phase_order?: number | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | AddPrice.NewSubscriptionUnitPrice - | AddPrice.NewSubscriptionPackagePrice - | AddPrice.NewSubscriptionMatrixPrice - | AddPrice.NewSubscriptionTieredPrice - | AddPrice.NewSubscriptionTieredBpsPrice - | AddPrice.NewSubscriptionBpsPrice - | AddPrice.NewSubscriptionBulkBpsPrice - | AddPrice.NewSubscriptionBulkPrice - | AddPrice.NewSubscriptionThresholdTotalAmountPrice - | AddPrice.NewSubscriptionTieredPackagePrice - | AddPrice.NewSubscriptionTieredWithMinimumPrice - | AddPrice.NewSubscriptionUnitWithPercentPrice - | AddPrice.NewSubscriptionPackageWithAllocationPrice - | AddPrice.NewSubscriptionTierWithProrationPrice - | AddPrice.NewSubscriptionUnitWithProrationPrice - | AddPrice.NewSubscriptionGroupedAllocationPrice - | AddPrice.NewSubscriptionGroupedWithProratedMinimumPrice - | AddPrice.NewSubscriptionBulkWithProrationPrice - | AddPrice.NewSubscriptionScalableMatrixWithUnitPricingPrice - | AddPrice.NewSubscriptionScalableMatrixWithTieredPricingPrice - | AddPrice.NewSubscriptionCumulativeGroupedBulkPrice - | AddPrice.NewSubscriptionMaxGroupTieredPackagePrice - | AddPrice.NewSubscriptionGroupedWithMeteredMinimumPrice - | AddPrice.NewSubscriptionMatrixWithDisplayNamePrice - | AddPrice.NewSubscriptionGroupedTieredPackagePrice - | AddPrice.NewSubscriptionMatrixWithAllocationPrice - | AddPrice.NewSubscriptionTieredPackageWithMinimumPrice - | AddPrice.NewSubscriptionGroupedTieredPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - - /** - * The start date of the price interval. This is the date that the price will start - * billing on the subscription. If null, billing will start when the phase or - * subscription starts. - */ - start_date?: string | null; - } - - export namespace AddPrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; - - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount?: number | null; - } - - export interface NewSubscriptionUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewSubscriptionUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewSubscriptionPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - } - - export interface BillingCycleAnchorConfiguration { - /** - * The day of the month on which the billing cycle is anchored. If the maximum - * number of days in a month is greater than this value, the last day of the month - * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing - * period begins on the 30th. - */ - day: number; - - /** - * The month on which the billing cycle is anchored (e.g. a quarterly price - * anchored in February would have cycles starting February, May, August, and - * November). - */ - month?: number | null; - - /** - * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle - * anchored on 2021 would have cycles starting on 2021, 2023, 2025, etc.). - */ - year?: number | null; - } - - export interface RemoveAdjustment { - /** - * The id of the adjustment to remove on the subscription. - */ - adjustment_id: string; - } - - export interface RemovePrice { - /** - * The external price id of the price to remove on the subscription. - */ - external_price_id?: string | null; - - /** - * The id of the price to remove on the subscription. - */ - price_id?: string | null; - } - - export interface ReplaceAdjustment { - /** - * The definition of a new adjustment to create and add to the subscription. - */ - adjustment: - | ReplaceAdjustment.NewPercentageDiscount - | ReplaceAdjustment.NewUsageDiscount - | ReplaceAdjustment.NewAmountDiscount - | ReplaceAdjustment.NewMinimum - | ReplaceAdjustment.NewMaximum; - - /** - * The id of the adjustment on the plan to replace in the subscription. - */ - replaces_adjustment_id: string; - } - - export namespace ReplaceAdjustment { - export interface NewPercentageDiscount { - adjustment_type: 'percentage_discount'; - - percentage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewUsageDiscount { - adjustment_type: 'usage_discount'; - - usage_discount: number; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewAmountDiscount { - adjustment_type: 'amount_discount'; - - amount_discount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMinimum { - adjustment_type: 'minimum'; - - /** - * The item ID that revenue from this minimum will be attributed to. - */ - item_id: string; - - minimum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - - export interface NewMaximum { - adjustment_type: 'maximum'; - - maximum_amount: string; - - /** - * The set of price IDs to which this adjustment applies. - */ - applies_to_price_ids?: Array | null; - - /** - * When false, this adjustment will be applied to a single price. Otherwise, it - * will be applied at the invoice level, possibly to multiple prices. - */ - is_invoice_level?: boolean; - } - } - - export interface ReplacePrice { - /** - * The id of the price on the plan to replace in the subscription. - */ - replaces_price_id: string; - - /** - * The definition of a new allocation price to create and add to the subscription. - */ - allocation_price?: ReplacePrice.AllocationPrice | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's - * discounts for the replacement price. - */ - discounts?: Array | null; - - /** - * The external price id of the price to add to the subscription. - */ - external_price_id?: string | null; - - /** - * The new quantity of the price, if the price is a fixed price. - */ - fixed_price_quantity?: number | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's maximum - * amount for the replacement price. - */ - maximum_amount?: string | null; - - /** - * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's minimum - * amount for the replacement price. - */ - minimum_amount?: string | null; - - /** - * The definition of a new price to create and add to the subscription. - */ - price?: - | ReplacePrice.NewSubscriptionUnitPrice - | ReplacePrice.NewSubscriptionPackagePrice - | ReplacePrice.NewSubscriptionMatrixPrice - | ReplacePrice.NewSubscriptionTieredPrice - | ReplacePrice.NewSubscriptionTieredBpsPrice - | ReplacePrice.NewSubscriptionBpsPrice - | ReplacePrice.NewSubscriptionBulkBpsPrice - | ReplacePrice.NewSubscriptionBulkPrice - | ReplacePrice.NewSubscriptionThresholdTotalAmountPrice - | ReplacePrice.NewSubscriptionTieredPackagePrice - | ReplacePrice.NewSubscriptionTieredWithMinimumPrice - | ReplacePrice.NewSubscriptionUnitWithPercentPrice - | ReplacePrice.NewSubscriptionPackageWithAllocationPrice - | ReplacePrice.NewSubscriptionTierWithProrationPrice - | ReplacePrice.NewSubscriptionUnitWithProrationPrice - | ReplacePrice.NewSubscriptionGroupedAllocationPrice - | ReplacePrice.NewSubscriptionGroupedWithProratedMinimumPrice - | ReplacePrice.NewSubscriptionBulkWithProrationPrice - | ReplacePrice.NewSubscriptionScalableMatrixWithUnitPricingPrice - | ReplacePrice.NewSubscriptionScalableMatrixWithTieredPricingPrice - | ReplacePrice.NewSubscriptionCumulativeGroupedBulkPrice - | ReplacePrice.NewSubscriptionMaxGroupTieredPackagePrice - | ReplacePrice.NewSubscriptionGroupedWithMeteredMinimumPrice - | ReplacePrice.NewSubscriptionMatrixWithDisplayNamePrice - | ReplacePrice.NewSubscriptionGroupedTieredPackagePrice - | ReplacePrice.NewSubscriptionMatrixWithAllocationPrice - | ReplacePrice.NewSubscriptionTieredPackageWithMinimumPrice - | ReplacePrice.NewSubscriptionGroupedTieredPrice - | null; - - /** - * The id of the price to add to the subscription. - */ - price_id?: string | null; - } - - export namespace ReplacePrice { - /** - * The definition of a new allocation price to create and add to the subscription. - */ - export interface AllocationPrice { - /** - * An amount of the currency to allocate to the customer at the specified cadence. - */ - amount: string; - - /** - * The cadence at which to allocate the amount to the customer. - */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; - - /** - * An ISO 4217 currency string or a custom pricing unit identifier in which to bill - * this price. - */ - currency: string; - - /** - * The custom expiration for the allocation. - */ - custom_expiration?: AllocationPrice.CustomExpiration | null; - - /** - * Whether the allocated amount should expire at the end of the cadence or roll - * over to the next period. Set to null if using custom_expiration. - */ - expires_at_end_of_cadence?: boolean | null; - } - - export namespace AllocationPrice { - /** - * The custom expiration for the allocation. - */ - export interface CustomExpiration { - duration: number; - - duration_unit: 'day' | 'month'; - } - } - - export interface Discount { - discount_type: 'percentage' | 'usage' | 'amount'; - - /** - * Only available if discount_type is `amount`. - */ - amount_discount?: string | null; - - /** - * Only available if discount_type is `percentage`. This is a number between 0 - * and 1. - */ - percentage_discount?: number | null; - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for - */ - usage_discount?: number | null; - } - - export interface NewSubscriptionUnitPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit'; - - /** - * The name of the price. - */ - name: string; - - unit_config: NewSubscriptionUnitPrice.UnitConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitPrice { - export interface UnitConfig { - /** - * Rate per unit of usage - */ - unit_amount: string; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package'; - - /** - * The name of the price. - */ - name: string; - - package_config: NewSubscriptionPackagePrice.PackageConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackagePrice { - export interface PackageConfig { - /** - * A currency amount to rate usage by - */ - package_amount: string; - - /** - * An integer amount to represent package size. For example, 1000 here would divide - * usage by 1000 before multiplying by package_amount in rating - */ - package_size: number; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_config: NewSubscriptionMatrixPrice.MatrixConfig; - - model_type: 'matrix'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixPrice { - export interface MatrixConfig { - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered'; - - /** - * The name of the price. - */ - name: string; - - tiered_config: NewSubscriptionTieredPrice.TieredConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPrice { - export interface TieredConfig { - /** - * Tiers for rating based on total usage quantities into the specified tier - */ - tiers: Array; - } - - export namespace TieredConfig { - export interface Tier { - /** - * Exclusive tier starting value - */ - first_unit: number; - - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Inclusive tier ending value. If null, this is treated as the last tier - */ - last_unit?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredBpsPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_bps'; - - /** - * The name of the price. - */ - name: string; - - tiered_bps_config: NewSubscriptionTieredBpsPrice.TieredBpsConfig; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredBpsPrice { - export interface TieredBpsConfig { - /** - * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - * tiers - */ - tiers: Array; - } - - export namespace TieredBpsConfig { - export interface Tier { - /** - * Per-event basis point rate - */ - bps: number; - - /** - * Exclusive tier starting value - */ - minimum_amount: string; - - /** - * Inclusive tier ending value - */ - maximum_amount?: string | null; - - /** - * Per unit maximum to charge - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBpsPrice { - bps_config: NewSubscriptionBpsPrice.BpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBpsPrice { - export interface BpsConfig { - /** - * Basis point take rate per event - */ - bps: number; - - /** - * Optional currency amount maximum to cap spend per event - */ - per_unit_maximum?: string | null; - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkBpsPrice { - bulk_bps_config: NewSubscriptionBulkBpsPrice.BulkBpsConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_bps'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkBpsPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkBpsPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkBpsPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkBpsPrice { - export interface BulkBpsConfig { - /** - * Tiers for a bulk BPS pricing model where all usage is aggregated to a single - * tier based on total volume - */ - tiers: Array; - } - - export namespace BulkBpsConfig { - export interface Tier { - /** - * Basis points to rate on - */ - bps: number; - - /** - * Upper bound for tier - */ - maximum_amount?: string | null; - - /** - * The maximum amount to charge for any one event - */ - per_unit_maximum?: string | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkPrice { - bulk_config: NewSubscriptionBulkPrice.BulkConfig; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkPrice { - export interface BulkConfig { - /** - * Bulk tiers for rating based on total usage volume - */ - tiers: Array; - } - - export namespace BulkConfig { - export interface Tier { - /** - * Amount per unit - */ - unit_amount: string; - - /** - * Upper bound for this tier - */ - maximum_units?: number | null; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionThresholdTotalAmountPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'threshold_total_amount'; - - /** - * The name of the price. - */ - name: string; - - threshold_total_amount_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionThresholdTotalAmountPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionThresholdTotalAmountPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionThresholdTotalAmountPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithPercentPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_percent'; - - /** - * The name of the price. - */ - name: string; - - unit_with_percent_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithPercentPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithPercentPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithPercentPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionPackageWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'package_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - package_with_allocation_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionPackageWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionPackageWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionPackageWithAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTierWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_with_proration'; - - /** - * The name of the price. - */ - name: string; - - tiered_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTierWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTierWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTierWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionUnitWithProrationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'unit_with_proration'; - - /** - * The name of the price. - */ - name: string; - - unit_with_proration_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionUnitWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionUnitWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionUnitWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_allocation_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedAllocationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_prorated_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithProratedMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithProratedMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithProratedMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; - - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'bulk_with_proration'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionBulkWithProrationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionBulkWithProrationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionBulkWithProrationPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_unit_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_unit_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithUnitPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithUnitPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'scalable_matrix_with_tiered_pricing'; - - /** - * The name of the price. - */ - name: string; - - scalable_matrix_with_tiered_pricing_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionScalableMatrixWithTieredPricingPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionScalableMatrixWithTieredPricingPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionCumulativeGroupedBulkPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - cumulative_grouped_bulk_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionCumulativeGroupedBulkPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionCumulativeGroupedBulkPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMaxGroupTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - max_group_tiered_package_config: Record; - - model_type: 'max_group_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMaxGroupTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_with_metered_minimum_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedWithMeteredMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedWithMeteredMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedWithMeteredMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithDisplayNamePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_display_name_config: Record; - - model_type: 'matrix_with_display_name'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithDisplayNamePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithDisplayNamePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPackagePrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_package_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'grouped_tiered_package'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPackagePrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPackagePrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPackagePrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionMatrixWithAllocationPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - matrix_with_allocation_config: NewSubscriptionMatrixWithAllocationPrice.MatrixWithAllocationConfig; - - model_type: 'matrix_with_allocation'; - - /** - * The name of the price. - */ - name: string; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionMatrixWithAllocationPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionMatrixWithAllocationPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionMatrixWithAllocationPrice { - export interface MatrixWithAllocationConfig { - /** - * Allocation to be used to calculate the price - */ - allocation: number; - - /** - * Default per unit rate for any usage not bucketed into a specified matrix_value - */ - default_unit_amount: string; - - /** - * One or two event property values to evaluate matrix groups by - */ - dimensions: Array; - - /** - * Matrix values for specified matrix grouping keys - */ - matrix_values: Array; - } - - export namespace MatrixWithAllocationConfig { - export interface MatrixValue { - /** - * One or two matrix keys to filter usage to this Matrix value by. For example, - * ["region", "tier"] could be used to filter cloud usage by a cloud region and an - * instance tier. - */ - dimension_values: Array; - - /** - * Unit price for the specified dimension_values - */ - unit_amount: string; - } - } - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionTieredPackageWithMinimumPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: 'tiered_package_with_minimum'; - - /** - * The name of the price. - */ - name: string; - - tiered_package_with_minimum_config: Record; - - /** - * The id of the billable metric for the price. Only needed if the price is - * usage-based. - */ - billable_metric_id?: string | null; - - /** - * If the Price represents a fixed cost, the price will be billed in-advance if - * this is true, and in-arrears if this is false. - */ - billed_in_advance?: boolean | null; - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - billing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionTieredPackageWithMinimumPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionTieredPackageWithMinimumPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } - - export interface NewSubscriptionGroupedTieredPrice { - /** - * The cadence to bill for this price on. - */ - cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - - grouped_tiered_config: Record; - - /** - * The id of the item the price will be associated with. - */ - item_id: string; - - model_type: '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?: NewSubscriptionGroupedTieredPrice.BillingCycleConfiguration | null; - - /** - * The per unit conversion rate of the price currency to the invoicing currency. - */ - conversion_rate?: number | null; - - /** - * An ISO 4217 currency string, or custom pricing unit identifier, in which this - * price is billed. - */ - currency?: string | null; - - /** - * For dimensional price: specifies a price group and dimension values - */ - dimensional_price_configuration?: NewSubscriptionGroupedTieredPrice.DimensionalPriceConfiguration | null; - - /** - * An alias for the price. - */ - external_price_id?: string | null; - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fixed_price_quantity?: number | null; - - /** - * The property used to group this price on an invoice - */ - invoice_grouping_key?: string | null; - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - invoicing_cycle_configuration?: NewSubscriptionGroupedTieredPrice.InvoicingCycleConfiguration | null; - - /** - * User-specified key/value pairs for the resource. Individual keys can be removed - * by setting the value to `null`, and the entire metadata mapping can be cleared - * by setting `metadata` to `null`. - */ - metadata?: Record | null; - - /** - * A transient ID that can be used to reference this price when adding adjustments - * in the same API call. - */ - reference_id?: string | null; - } - - export namespace NewSubscriptionGroupedTieredPrice { - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - export interface BillingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - - /** - * For dimensional price: specifies a price group and dimension values - */ - export interface DimensionalPriceConfiguration { - /** - * The list of dimension values matching (in order) the dimensions of the price - * group - */ - dimension_values: Array; - - /** - * The id of the dimensional price group to include this price in - */ - dimensional_price_group_id?: string | null; - - /** - * The external id of the dimensional price group to include this price in - */ - external_dimensional_price_group_id?: string | null; - } - - /** - * Within each billing cycle, specifies the cadence at which invoices are produced. - * If unspecified, a single invoice is produced per billing cycle. - */ - export interface InvoicingCycleConfiguration { - /** - * The duration of the billing period. - */ - duration: number; - - /** - * The unit of billing period duration. - */ - duration_unit: 'day' | 'month'; - } - } + price_id?: string | null; } } @@ -35152,22 +5396,40 @@ Subscriptions.SubscriptionFetchScheduleResponsesPage = SubscriptionFetchSchedule export declare namespace Subscriptions { export { + type DiscountOverride as DiscountOverride, + type NewSubscriptionBPSPrice as NewSubscriptionBPSPrice, + type NewSubscriptionBulkBPSPrice as NewSubscriptionBulkBPSPrice, + type NewSubscriptionBulkPrice as NewSubscriptionBulkPrice, + type NewSubscriptionBulkWithProrationPrice as NewSubscriptionBulkWithProrationPrice, + type NewSubscriptionCumulativeGroupedBulkPrice as NewSubscriptionCumulativeGroupedBulkPrice, + type NewSubscriptionGroupedAllocationPrice as NewSubscriptionGroupedAllocationPrice, + type NewSubscriptionGroupedTieredPackagePrice as NewSubscriptionGroupedTieredPackagePrice, + type NewSubscriptionGroupedTieredPrice as NewSubscriptionGroupedTieredPrice, + type NewSubscriptionGroupedWithMeteredMinimumPrice as NewSubscriptionGroupedWithMeteredMinimumPrice, + type NewSubscriptionGroupedWithProratedMinimumPrice as NewSubscriptionGroupedWithProratedMinimumPrice, + type NewSubscriptionMatrixPrice as NewSubscriptionMatrixPrice, + type NewSubscriptionMatrixWithAllocationPrice as NewSubscriptionMatrixWithAllocationPrice, + type NewSubscriptionMatrixWithDisplayNamePrice as NewSubscriptionMatrixWithDisplayNamePrice, + type NewSubscriptionMaxGroupTieredPackagePrice as NewSubscriptionMaxGroupTieredPackagePrice, + type NewSubscriptionPackagePrice as NewSubscriptionPackagePrice, + type NewSubscriptionPackageWithAllocationPrice as NewSubscriptionPackageWithAllocationPrice, + type NewSubscriptionScalableMatrixWithTieredPricingPrice as NewSubscriptionScalableMatrixWithTieredPricingPrice, + type NewSubscriptionScalableMatrixWithUnitPricingPrice as NewSubscriptionScalableMatrixWithUnitPricingPrice, + type NewSubscriptionThresholdTotalAmountPrice as NewSubscriptionThresholdTotalAmountPrice, + type NewSubscriptionTierWithProrationPrice as NewSubscriptionTierWithProrationPrice, + type NewSubscriptionTieredBPSPrice as NewSubscriptionTieredBPSPrice, + type NewSubscriptionTieredPackagePrice as NewSubscriptionTieredPackagePrice, + type NewSubscriptionTieredPackageWithMinimumPrice as NewSubscriptionTieredPackageWithMinimumPrice, + type NewSubscriptionTieredPrice as NewSubscriptionTieredPrice, + type NewSubscriptionTieredWithMinimumPrice as NewSubscriptionTieredWithMinimumPrice, + type NewSubscriptionUnitPrice as NewSubscriptionUnitPrice, + type NewSubscriptionUnitWithPercentPrice as NewSubscriptionUnitWithPercentPrice, + type NewSubscriptionUnitWithProrationPrice as NewSubscriptionUnitWithProrationPrice, type Subscription as Subscription, type SubscriptionUsage as SubscriptionUsage, type Subscriptions as Subscriptions, - type SubscriptionCreateResponse as SubscriptionCreateResponse, - type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse, type SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse, - type SubscriptionPriceIntervalsResponse as SubscriptionPriceIntervalsResponse, - type SubscriptionRedeemCouponResponse as SubscriptionRedeemCouponResponse, - type SubscriptionSchedulePlanChangeResponse as SubscriptionSchedulePlanChangeResponse, - type SubscriptionTriggerPhaseResponse as SubscriptionTriggerPhaseResponse, - type SubscriptionUnscheduleCancellationResponse as SubscriptionUnscheduleCancellationResponse, - type SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse as SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse, - type SubscriptionUnschedulePendingPlanChangesResponse as SubscriptionUnschedulePendingPlanChangesResponse, - type SubscriptionUpdateFixedFeeQuantityResponse as SubscriptionUpdateFixedFeeQuantityResponse, - type SubscriptionUpdateTrialResponse as SubscriptionUpdateTrialResponse, SubscriptionsPage as SubscriptionsPage, SubscriptionFetchScheduleResponsesPage as SubscriptionFetchScheduleResponsesPage, type SubscriptionCreateParams as SubscriptionCreateParams, diff --git a/src/version.ts b/src/version.ts index b8dd781b..e156b0ea 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.74.0'; // x-release-please-version +export const VERSION = '5.0.0'; // x-release-please-version diff --git a/tests/api-resources/beta/beta.test.ts b/tests/api-resources/beta/beta.test.ts index ca5c95f5..3b257ca2 100644 --- a/tests/api-resources/beta/beta.test.ts +++ b/tests/api-resources/beta/beta.test.ts @@ -28,8 +28,13 @@ describe('resource beta', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, plan_phase_order: 0, }, @@ -54,6 +59,10 @@ describe('resource beta', () => { 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'], @@ -75,8 +84,13 @@ describe('resource beta', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, replaces_adjustment_id: 'replaces_adjustment_id', plan_phase_order: 0, @@ -103,6 +117,10 @@ describe('resource beta', () => { 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'], diff --git a/tests/api-resources/beta/external-plan-id.test.ts b/tests/api-resources/beta/external-plan-id.test.ts index 897c1ded..1ccb0fed 100644 --- a/tests/api-resources/beta/external-plan-id.test.ts +++ b/tests/api-resources/beta/external-plan-id.test.ts @@ -28,8 +28,13 @@ describe('resource externalPlanId', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, plan_phase_order: 0, }, @@ -54,6 +59,10 @@ describe('resource externalPlanId', () => { 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'], @@ -75,8 +84,13 @@ describe('resource externalPlanId', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, replaces_adjustment_id: 'replaces_adjustment_id', plan_phase_order: 0, @@ -103,6 +117,10 @@ describe('resource externalPlanId', () => { 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'], diff --git a/tests/api-resources/invoices.test.ts b/tests/api-resources/invoices.test.ts index 32833614..df1c2845 100644 --- a/tests/api-resources/invoices.test.ts +++ b/tests/api-resources/invoices.test.ts @@ -56,6 +56,7 @@ describe('resource invoices', () => { discount_type: 'percentage', percentage_discount: 0.15, applies_to_price_ids: ['h74gfhdjvn7ujokd', '7hfgtgjnbvc3ujkl'], + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], reason: 'reason', }, external_customer_id: 'external-customer-id', diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts index 826ac4de..81624574 100644 --- a/tests/api-resources/plans/plans.test.ts +++ b/tests/api-resources/plans/plans.test.ts @@ -47,6 +47,10 @@ describe('resource plans', () => { 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'], diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts index c8286d15..3e5d0c53 100644 --- a/tests/api-resources/prices/prices.test.ts +++ b/tests/api-resources/prices/prices.test.ts @@ -39,6 +39,7 @@ describe('resource prices', () => { 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' } }, dimensional_price_configuration: { dimension_values: ['string'], dimensional_price_group_id: 'dimensional_price_group_id', @@ -127,6 +128,62 @@ describe('resource prices', () => { test('evaluateMultiple: required and optional params', async () => { const response = await client.prices.evaluateMultiple({ + timeframe_end: '2019-12-27T18:11:19.117Z', + timeframe_start: '2019-12-27T18:11:19.117Z', + customer_id: 'customer_id', + external_customer_id: 'external_customer_id', + price_evaluations: [ + { + filter: "my_numeric_property > 100 AND my_other_property = 'bar'", + grouping_keys: ["case when my_event_type = 'foo' then true else false end"], + price: { + cadence: 'annual', + currency: 'currency', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', + unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + }, + price_id: 'price_id', + }, + ], + }); + }); + + test('evaluatePreviewEvents: only required params', async () => { + const responsePromise = client.prices.evaluatePreviewEvents({ + timeframe_end: '2019-12-27T18:11:19.117Z', + timeframe_start: '2019-12-27T18:11:19.117Z', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('evaluatePreviewEvents: required and optional params', async () => { + const response = await client.prices.evaluatePreviewEvents({ timeframe_end: '2019-12-27T18:11:19.117Z', timeframe_start: '2019-12-27T18:11:19.117Z', customer_id: 'customer_id', @@ -155,6 +212,10 @@ describe('resource prices', () => { 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' }, + }, dimensional_price_configuration: { dimension_values: ['string'], dimensional_price_group_id: 'dimensional_price_group_id', diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index 86468403..b4556008 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -236,7 +236,6 @@ describe('resource subscriptions', () => { test('redeemCoupon: only required params', async () => { const responsePromise = client.subscriptions.redeemCoupon('subscription_id', { change_option: 'requested_date', - coupon_id: 'coupon_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -250,9 +249,10 @@ describe('resource subscriptions', () => { test('redeemCoupon: required and optional params', async () => { const response = await client.subscriptions.redeemCoupon('subscription_id', { change_option: 'requested_date', - coupon_id: 'coupon_id', allow_invoice_credit_or_void: true, change_date: '2017-07-21T17:32:28Z', + coupon_id: 'coupon_id', + coupon_redemption_code: 'coupon_redemption_code', }); }); @@ -277,8 +277,13 @@ describe('resource subscriptions', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, end_date: '2019-12-27T18:11:19.117Z', plan_phase_order: 0, @@ -317,6 +322,10 @@ describe('resource subscriptions', () => { 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'], @@ -358,8 +367,13 @@ describe('resource subscriptions', () => { adjustment: { adjustment_type: 'percentage_discount', percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], is_invoice_level: true, + price_type: 'usage', }, replaces_adjustment_id: 'replaces_adjustment_id', }, @@ -396,6 +410,10 @@ describe('resource subscriptions', () => { 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'],