diff --git a/api.md b/api.md index bcad3284..c649ca8c 100644 --- a/api.md +++ b/api.md @@ -2,23 +2,13 @@ ```python from orb.types import ( - AddCreditLedgerEntryRequest, - AddCreditTopUpRequest, - AddSubscriptionAdjustmentParams, - AddSubscriptionPriceParams, AmountDiscount, BillingCycleRelativeDate, - CreateCustomerAlertRequest, Discount, InvoiceLevelDiscount, PaginationMetadata, PercentageDiscount, - RemoveSubscriptionAdjustmentParams, - RemoveSubscriptionPriceParams, - ReplaceSubscriptionAdjustmentParams, - ReplaceSubscriptionPriceParams, TrialDiscount, - UpdatePriceRequestParams, UsageDiscount, ) ``` diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index bc0ca16b..83422a37 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -44,14 +44,8 @@ from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse from ..types.subscription_price_intervals_response import SubscriptionPriceIntervalsResponse from ..types.subscription_schedule_plan_change_response import SubscriptionSchedulePlanChangeResponse -from ..types.shared_params.add_subscription_price_params import AddSubscriptionPriceParams from ..types.subscription_unschedule_cancellation_response import SubscriptionUnscheduleCancellationResponse -from ..types.shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams -from ..types.shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams from ..types.subscription_update_fixed_fee_quantity_response import SubscriptionUpdateFixedFeeQuantityResponse -from ..types.shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams -from ..types.shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams -from ..types.shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams from ..types.subscription_unschedule_pending_plan_changes_response import ( SubscriptionUnschedulePendingPlanChangesResponse, ) @@ -85,8 +79,8 @@ def with_streaming_response(self) -> SubscriptionsWithStreamingResponse: def create( self, *, - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN, align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, @@ -110,10 +104,10 @@ def create( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN, start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -1365,8 +1359,9 @@ def schedule_plan_change( subscription_id: str, *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]] + | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN, align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] @@ -1388,10 +1383,13 @@ def schedule_plan_change( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]] + | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]] + | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] + | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2095,8 +2093,8 @@ def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse: async def create( self, *, - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[subscription_create_params.AddAdjustment]] | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[subscription_create_params.AddPrice]] | NotGiven = NOT_GIVEN, align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, aws_region: Optional[str] | NotGiven = NOT_GIVEN, @@ -2120,10 +2118,10 @@ async def create( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[subscription_create_params.RemoveAdjustment]] | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[subscription_create_params.RemovePrice]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[subscription_create_params.ReplaceAdjustment]] | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[subscription_create_params.ReplacePrice]] | NotGiven = NOT_GIVEN, start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -3375,8 +3373,9 @@ async def schedule_plan_change( subscription_id: str, *, change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + add_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.AddAdjustment]] + | NotGiven = NOT_GIVEN, + add_prices: Optional[Iterable[subscription_schedule_plan_change_params.AddPrice]] | NotGiven = NOT_GIVEN, align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] @@ -3398,10 +3397,13 @@ async def schedule_plan_change( plan_id: Optional[str] | NotGiven = NOT_GIVEN, plan_version_number: Optional[int] | NotGiven = NOT_GIVEN, price_overrides: Optional[Iterable[object]] | NotGiven = NOT_GIVEN, - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] | NotGiven = NOT_GIVEN, - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] | NotGiven = NOT_GIVEN, + remove_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.RemoveAdjustment]] + | NotGiven = NOT_GIVEN, + remove_prices: Optional[Iterable[subscription_schedule_plan_change_params.RemovePrice]] | NotGiven = NOT_GIVEN, + replace_adjustments: Optional[Iterable[subscription_schedule_plan_change_params.ReplaceAdjustment]] + | NotGiven = NOT_GIVEN, + replace_prices: Optional[Iterable[subscription_schedule_plan_change_params.ReplacePrice]] + | NotGiven = NOT_GIVEN, trial_duration_days: Optional[int] | NotGiven = NOT_GIVEN, usage_customer_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index 7f695fb0..74c64801 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -15,17 +15,7 @@ PaginationMetadata as PaginationMetadata, PercentageDiscount as PercentageDiscount, InvoiceLevelDiscount as InvoiceLevelDiscount, - AddCreditTopUpRequest as AddCreditTopUpRequest, BillingCycleRelativeDate as BillingCycleRelativeDate, - UpdatePriceRequestParams as UpdatePriceRequestParams, - AddSubscriptionPriceParams as AddSubscriptionPriceParams, - CreateCustomerAlertRequest as CreateCustomerAlertRequest, - AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest, - RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams, - ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams, - AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams, - RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, - ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, ) from .invoice import Invoice as Invoice from .customer import Customer as Customer diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index e7843b23..cebcd76a 100644 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -7,18 +7,4 @@ from .pagination_metadata import PaginationMetadata as PaginationMetadata from .percentage_discount import PercentageDiscount as PercentageDiscount from .invoice_level_discount import InvoiceLevelDiscount as InvoiceLevelDiscount -from .add_credit_top_up_request import AddCreditTopUpRequest as AddCreditTopUpRequest from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate -from .update_price_request_params import UpdatePriceRequestParams as UpdatePriceRequestParams -from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams -from .create_customer_alert_request import CreateCustomerAlertRequest as CreateCustomerAlertRequest -from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest -from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams -from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams -from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams -from .remove_subscription_adjustment_params import ( - RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, -) -from .replace_subscription_adjustment_params import ( - ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, -) diff --git a/src/orb/types/shared/add_credit_ledger_entry_request.py b/src/orb/types/shared/add_credit_ledger_entry_request.py deleted file mode 100644 index c1cad6e9..00000000 --- a/src/orb/types/shared/add_credit_ledger_entry_request.py +++ /dev/null @@ -1,258 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from datetime import date, datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "AddCreditLedgerEntryRequest", - "AddIncrementCreditLedgerEntryRequestParams", - "AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings", - "AddDecrementCreditLedgerEntryRequestParams", - "AddExpirationChangeCreditLedgerEntryRequestParams", - "AddVoidCreditLedgerEntryRequestParams", - "AddAmendmentCreditLedgerEntryRequestParams", -] - - -class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(BaseModel): - auto_collection: bool - """ - Whether the credits purchase invoice should auto collect with the customer's - saved payment method. - """ - - net_terms: int - """ - 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. - """ - - memo: Optional[str] = None - """An optional memo to display on the invoice.""" - - require_successful_payment: Optional[bool] = None - """ - If true, the new credit block will require that the corresponding invoice is - paid before it can be drawn down from. - """ - - -class AddIncrementCreditLedgerEntryRequestParams(BaseModel): - amount: float - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - entry_type: Literal["increment"] - - currency: Optional[str] = None - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] = None - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - effective_date: Optional[datetime] = None - """ - An ISO 8601 format date that denotes when this credit balance should become - available for use. - """ - - expiry_date: Optional[datetime] = None - """An ISO 8601 format date that denotes when this credit balance should expire.""" - - invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] = None - """ - Passing `invoice_settings` automatically generates an invoice for the newly - added credits. If `invoice_settings` is passed, you must specify - per_unit_cost_basis, as the calculation of the invoice total is done on that - basis. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - per_unit_cost_basis: Optional[str] = None - """Can only be specified when entry_type=increment. - - How much, in the customer's currency, a customer paid for a single credit in - this block - """ - - -class AddDecrementCreditLedgerEntryRequestParams(BaseModel): - amount: float - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - entry_type: Literal["decrement"] - - currency: Optional[str] = None - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] = None - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddExpirationChangeCreditLedgerEntryRequestParams(BaseModel): - entry_type: Literal["expiration_change"] - - expiry_date: Optional[datetime] = None - """An ISO 8601 format date that identifies the origination credit block to expire""" - - target_expiry_date: date - """ - A future date (specified in YYYY-MM-DD format) used for expiration change, - denoting when credits transferred (as part of a partial block expiration) should - expire. - """ - - amount: Optional[float] = None - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - block_id: Optional[str] = None - """ - The ID of the block affected by an expiration_change, used to differentiate - between multiple blocks with the same `expiry_date`. - """ - - currency: Optional[str] = None - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] = None - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddVoidCreditLedgerEntryRequestParams(BaseModel): - amount: float - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - block_id: str - """The ID of the block to void.""" - - entry_type: Literal["void"] - - currency: Optional[str] = None - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] = None - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - void_reason: Optional[Literal["refund"]] = None - """Can only be specified when `entry_type=void`. The reason for the void.""" - - -class AddAmendmentCreditLedgerEntryRequestParams(BaseModel): - amount: float - """The number of credits to effect. - - Note that this is required for increment, decrement or void operations. - """ - - block_id: str - """The ID of the block to reverse a decrement from.""" - - entry_type: Literal["amendment"] - - currency: Optional[str] = None - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] = None - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -AddCreditLedgerEntryRequest: TypeAlias = Annotated[ - Union[ - AddIncrementCreditLedgerEntryRequestParams, - AddDecrementCreditLedgerEntryRequestParams, - AddExpirationChangeCreditLedgerEntryRequestParams, - AddVoidCreditLedgerEntryRequestParams, - AddAmendmentCreditLedgerEntryRequestParams, - ], - PropertyInfo(discriminator="entry_type"), -] diff --git a/src/orb/types/shared/add_credit_top_up_request.py b/src/orb/types/shared/add_credit_top_up_request.py deleted file mode 100644 index f58f4063..00000000 --- a/src/orb/types/shared/add_credit_top_up_request.py +++ /dev/null @@ -1,72 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AddCreditTopUpRequest", "InvoiceSettings"] - - -class InvoiceSettings(BaseModel): - auto_collection: bool - """ - Whether the credits purchase invoice should auto collect with the customer's - saved payment method. - """ - - net_terms: int - """ - 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. - """ - - memo: Optional[str] = None - """An optional memo to display on the invoice.""" - - require_successful_payment: Optional[bool] = None - """ - If true, new credit blocks created by this top-up will require that the - corresponding invoice is paid before they can be drawn down from. - """ - - -class AddCreditTopUpRequest(BaseModel): - amount: str - """The amount to increment when the threshold is reached.""" - - currency: str - """The currency or custom pricing unit to use for this top-up. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - invoice_settings: InvoiceSettings - """Settings for invoices generated by triggered top-ups.""" - - per_unit_cost_basis: str - """How much, in the customer's currency, to charge for each unit.""" - - threshold: str - """The threshold at which to trigger the top-up. - - If the balance is at or below this threshold, the top-up will be triggered. - """ - - active_from: Optional[datetime] = None - """The date from which the top-up is active. - - If unspecified, the top-up is active immediately. - """ - - expires_after: Optional[int] = None - """The number of days or months after which the top-up expires. - - If unspecified, it does not expire. - """ - - expires_after_unit: Optional[Literal["day", "month"]] = None - """The unit of expires_after.""" diff --git a/src/orb/types/shared/add_subscription_adjustment_params.py b/src/orb/types/shared/add_subscription_adjustment_params.py deleted file mode 100644 index 5cdadec9..00000000 --- a/src/orb/types/shared/add_subscription_adjustment_params.py +++ /dev/null @@ -1,131 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "AddSubscriptionAdjustmentParams", - "Adjustment", - "AdjustmentNewPercentageDiscount", - "AdjustmentNewUsageDiscount", - "AdjustmentNewAmountDiscount", - "AdjustmentNewMinimum", - "AdjustmentNewMaximum", -] - - -class AdjustmentNewPercentageDiscount(BaseModel): - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewUsageDiscount(BaseModel): - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewAmountDiscount(BaseModel): - adjustment_type: Literal["amount_discount"] - - amount_discount: str - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMinimum(BaseModel): - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMaximum(BaseModel): - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -Adjustment: TypeAlias = Annotated[ - Union[ - AdjustmentNewPercentageDiscount, - AdjustmentNewUsageDiscount, - AdjustmentNewAmountDiscount, - AdjustmentNewMinimum, - AdjustmentNewMaximum, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class AddSubscriptionAdjustmentParams(BaseModel): - adjustment: Adjustment - """The definition of a new adjustment to create and add to the subscription.""" - - end_date: Optional[datetime] = None - """The end date of the adjustment interval. - - This is the date that the adjustment will stop affecting prices on the - subscription. - """ - - plan_phase_order: Optional[int] = None - """The phase to add this adjustment to.""" - - start_date: Optional[datetime] = None - """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. - """ diff --git a/src/orb/types/shared/add_subscription_price_params.py b/src/orb/types/shared/add_subscription_price_params.py deleted file mode 100644 index 6d7ff840..00000000 --- a/src/orb/types/shared/add_subscription_price_params.py +++ /dev/null @@ -1,2615 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "AddSubscriptionPriceParams", - "AllocationPrice", - "Discount", - "Price", - "PriceNewSubscriptionUnitPrice", - "PriceNewSubscriptionUnitPriceUnitConfig", - "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackagePrice", - "PriceNewSubscriptionPackagePricePackageConfig", - "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixPrice", - "PriceNewSubscriptionMatrixPriceMatrixConfig", - "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPrice", - "PriceNewSubscriptionTieredPriceTieredConfig", - "PriceNewSubscriptionTieredPriceTieredConfigTier", - "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPrice", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBpsPrice", - "PriceNewSubscriptionBpsPriceBpsConfig", - "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPrice", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkPrice", - "PriceNewSubscriptionBulkPriceBulkConfig", - "PriceNewSubscriptionBulkPriceBulkConfigTier", - "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPrice", - "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePrice", - "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPrice", - "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPrice", - "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPrice", - "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPrice", - "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPrice", - "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPrice", - "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPrice", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPrice", - "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPrice", - "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePrice", - "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePrice", - "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePrice", - "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", -] - - -class AllocationPrice(BaseModel): - amount: str - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - """The cadence at which to allocate the amount to the customer.""" - - currency: str - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: bool - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class Discount(BaseModel): - discount_type: Literal["percentage", "usage", "amount"] - - amount_discount: Optional[str] = None - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] = None - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] = None - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class PriceNewSubscriptionUnitPriceUnitConfig(BaseModel): - unit_amount: str - """Rate per unit of usage""" - - -class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_config: PriceNewSubscriptionUnitPriceUnitConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackagePricePackageConfig(BaseModel): - package_amount: str - """A currency amount to rate usage by""" - - package_size: int - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_config: PriceNewSubscriptionPackagePricePackageConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(BaseModel): - dimension_values: List[Optional[str]] - """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. - """ - - unit_amount: str - """Unit price for the specified dimension_values""" - - -class PriceNewSubscriptionMatrixPriceMatrixConfig(BaseModel): - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue] - """Matrix values for specified matrix grouping keys""" - - -class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_config: PriceNewSubscriptionMatrixPriceMatrixConfig - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPriceTieredConfigTier(BaseModel): - first_unit: float - """Inclusive tier starting value""" - - unit_amount: str - """Amount per unit""" - - last_unit: Optional[float] = None - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class PriceNewSubscriptionTieredPriceTieredConfig(BaseModel): - tiers: List[PriceNewSubscriptionTieredPriceTieredConfigTier] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_config: PriceNewSubscriptionTieredPriceTieredConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Inclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(BaseModel): - tiers: List[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_bps_config: PriceNewSubscriptionTieredBpsPriceTieredBpsConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBpsPriceBpsConfig(BaseModel): - bps: float - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] = None - """Optional currency amount maximum to cap spend per event""" - - -class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPrice(BaseModel): - bps_config: PriceNewSubscriptionBpsPriceBpsConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(BaseModel): - bps: float - """Basis points to rate on""" - - maximum_amount: Optional[str] = None - """Upper bound for tier""" - - per_unit_maximum: Optional[str] = None - """The maximum amount to charge for any one event""" - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(BaseModel): - tiers: List[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPrice(BaseModel): - bulk_bps_config: PriceNewSubscriptionBulkBpsPriceBulkBpsConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkPriceBulkConfigTier(BaseModel): - unit_amount: str - """Amount per unit""" - - maximum_units: Optional[float] = None - """Upper bound for this tier""" - - -class PriceNewSubscriptionBulkPriceBulkConfig(BaseModel): - tiers: List[PriceNewSubscriptionBulkPriceBulkConfigTier] - """Bulk tiers for rating based on total usage volume""" - - -class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPrice(BaseModel): - bulk_config: PriceNewSubscriptionBulkPriceBulkConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - threshold_total_amount_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_package_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_minimum_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_percent_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_with_allocation_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_proration_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_proration_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPrice(BaseModel): - bulk_with_proration_config: Dict[str, object] - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Dict[str, object] - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Dict[str, object] - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -Price: TypeAlias = Annotated[ - Union[ - PriceNewSubscriptionUnitPrice, - PriceNewSubscriptionPackagePrice, - PriceNewSubscriptionMatrixPrice, - PriceNewSubscriptionTieredPrice, - PriceNewSubscriptionTieredBpsPrice, - PriceNewSubscriptionBpsPrice, - PriceNewSubscriptionBulkBpsPrice, - PriceNewSubscriptionBulkPrice, - PriceNewSubscriptionThresholdTotalAmountPrice, - PriceNewSubscriptionTieredPackagePrice, - PriceNewSubscriptionTieredWithMinimumPrice, - PriceNewSubscriptionUnitWithPercentPrice, - PriceNewSubscriptionPackageWithAllocationPrice, - PriceNewSubscriptionTierWithProrationPrice, - PriceNewSubscriptionUnitWithProrationPrice, - PriceNewSubscriptionGroupedAllocationPrice, - PriceNewSubscriptionGroupedWithProratedMinimumPrice, - PriceNewSubscriptionBulkWithProrationPrice, - PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, - PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, - PriceNewSubscriptionCumulativeGroupedBulkPrice, - PriceNewSubscriptionMaxGroupTieredPackagePrice, - PriceNewSubscriptionGroupedWithMeteredMinimumPrice, - PriceNewSubscriptionMatrixWithDisplayNamePrice, - PriceNewSubscriptionGroupedTieredPackagePrice, - None, - ], - PropertyInfo(discriminator="price_model_type"), -] - - -class AddSubscriptionPriceParams(BaseModel): - allocation_price: Optional[AllocationPrice] = None - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[List[Discount]] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for this price. - """ - - end_date: Optional[datetime] = None - """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. - """ - - external_price_id: Optional[str] = None - """The external price id of the price to add to the subscription.""" - - maximum_amount: Optional[str] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for this price. - """ - - minimum_amount: Optional[str] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for this price. - """ - - plan_phase_order: Optional[int] = None - """The phase to add this price to.""" - - price: Optional[Price] = None - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] = None - """The id of the price to add to the subscription.""" - - start_date: Optional[datetime] = None - """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. - """ diff --git a/src/orb/types/shared/create_customer_alert_request.py b/src/orb/types/shared/create_customer_alert_request.py deleted file mode 100644 index 02123e38..00000000 --- a/src/orb/types/shared/create_customer_alert_request.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["CreateCustomerAlertRequest", "Threshold"] - - -class Threshold(BaseModel): - value: float - """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. - """ - - -class CreateCustomerAlertRequest(BaseModel): - currency: str - """The case sensitive currency or custom pricing unit to use for this alert.""" - - type: Literal[ - "usage_exceeded", - "cost_exceeded", - "credit_balance_depleted", - "credit_balance_dropped", - "credit_balance_recovered", - ] - """The type of alert to create. This must be a valid alert type.""" - - thresholds: Optional[List[Threshold]] = None - """The thresholds that define the values at which the alert will be triggered.""" diff --git a/src/orb/types/shared/remove_subscription_adjustment_params.py b/src/orb/types/shared/remove_subscription_adjustment_params.py deleted file mode 100644 index 3821a7a2..00000000 --- a/src/orb/types/shared/remove_subscription_adjustment_params.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["RemoveSubscriptionAdjustmentParams"] - - -class RemoveSubscriptionAdjustmentParams(BaseModel): - adjustment_id: str - """The id of the adjustment to remove on the subscription.""" diff --git a/src/orb/types/shared/remove_subscription_price_params.py b/src/orb/types/shared/remove_subscription_price_params.py deleted file mode 100644 index fa18bb78..00000000 --- a/src/orb/types/shared/remove_subscription_price_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RemoveSubscriptionPriceParams"] - - -class RemoveSubscriptionPriceParams(BaseModel): - external_price_id: Optional[str] = None - """The external price id of the price to remove on the subscription.""" - - price_id: Optional[str] = None - """The id of the price to remove on the subscription.""" diff --git a/src/orb/types/shared/replace_subscription_adjustment_params.py b/src/orb/types/shared/replace_subscription_adjustment_params.py deleted file mode 100644 index 2d861159..00000000 --- a/src/orb/types/shared/replace_subscription_adjustment_params.py +++ /dev/null @@ -1,115 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "ReplaceSubscriptionAdjustmentParams", - "Adjustment", - "AdjustmentNewPercentageDiscount", - "AdjustmentNewUsageDiscount", - "AdjustmentNewAmountDiscount", - "AdjustmentNewMinimum", - "AdjustmentNewMaximum", -] - - -class AdjustmentNewPercentageDiscount(BaseModel): - adjustment_type: Literal["percentage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewUsageDiscount(BaseModel): - adjustment_type: Literal["usage_discount"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: float - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewAmountDiscount(BaseModel): - adjustment_type: Literal["amount_discount"] - - amount_discount: str - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMinimum(BaseModel): - adjustment_type: Literal["minimum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - item_id: str - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMaximum(BaseModel): - adjustment_type: Literal["maximum"] - - applies_to_price_ids: List[str] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: str - - is_invoice_level: Optional[bool] = None - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -Adjustment: TypeAlias = Annotated[ - Union[ - AdjustmentNewPercentageDiscount, - AdjustmentNewUsageDiscount, - AdjustmentNewAmountDiscount, - AdjustmentNewMinimum, - AdjustmentNewMaximum, - ], - PropertyInfo(discriminator="adjustment_type"), -] - - -class ReplaceSubscriptionAdjustmentParams(BaseModel): - adjustment: Adjustment - """The definition of a new adjustment to create and add to the subscription.""" - - replaces_adjustment_id: str - """The id of the adjustment on the plan to replace in the subscription.""" diff --git a/src/orb/types/shared/replace_subscription_price_params.py b/src/orb/types/shared/replace_subscription_price_params.py deleted file mode 100644 index 8bb18226..00000000 --- a/src/orb/types/shared/replace_subscription_price_params.py +++ /dev/null @@ -1,2603 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias - -from pydantic import Field as FieldInfo - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "ReplaceSubscriptionPriceParams", - "AllocationPrice", - "Discount", - "Price", - "PriceNewSubscriptionUnitPrice", - "PriceNewSubscriptionUnitPriceUnitConfig", - "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackagePrice", - "PriceNewSubscriptionPackagePricePackageConfig", - "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixPrice", - "PriceNewSubscriptionMatrixPriceMatrixConfig", - "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPrice", - "PriceNewSubscriptionTieredPriceTieredConfig", - "PriceNewSubscriptionTieredPriceTieredConfigTier", - "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPrice", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBpsPrice", - "PriceNewSubscriptionBpsPriceBpsConfig", - "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPrice", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkPrice", - "PriceNewSubscriptionBulkPriceBulkConfig", - "PriceNewSubscriptionBulkPriceBulkConfigTier", - "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPrice", - "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePrice", - "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPrice", - "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPrice", - "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPrice", - "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPrice", - "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPrice", - "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPrice", - "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPrice", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPrice", - "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPrice", - "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePrice", - "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePrice", - "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePrice", - "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", -] - - -class AllocationPrice(BaseModel): - amount: str - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] - """The cadence at which to allocate the amount to the customer.""" - - currency: str - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: bool - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class Discount(BaseModel): - discount_type: Literal["percentage", "usage", "amount"] - - amount_discount: Optional[str] = None - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] = None - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] = None - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class PriceNewSubscriptionUnitPriceUnitConfig(BaseModel): - unit_amount: str - """Rate per unit of usage""" - - -class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_config: PriceNewSubscriptionUnitPriceUnitConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackagePricePackageConfig(BaseModel): - package_amount: str - """A currency amount to rate usage by""" - - package_size: int - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_config: PriceNewSubscriptionPackagePricePackageConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(BaseModel): - dimension_values: List[Optional[str]] - """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. - """ - - unit_amount: str - """Unit price for the specified dimension_values""" - - -class PriceNewSubscriptionMatrixPriceMatrixConfig(BaseModel): - default_unit_amount: str - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: List[Optional[str]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: List[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue] - """Matrix values for specified matrix grouping keys""" - - -class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_config: PriceNewSubscriptionMatrixPriceMatrixConfig - - price_model_type: Literal["matrix"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPriceTieredConfigTier(BaseModel): - first_unit: float - """Inclusive tier starting value""" - - unit_amount: str - """Amount per unit""" - - last_unit: Optional[float] = None - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class PriceNewSubscriptionTieredPriceTieredConfig(BaseModel): - tiers: List[PriceNewSubscriptionTieredPriceTieredConfigTier] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_config: PriceNewSubscriptionTieredPriceTieredConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(BaseModel): - bps: float - """Per-event basis point rate""" - - minimum_amount: str - """Inclusive tier starting value""" - - maximum_amount: Optional[str] = None - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] = None - """Per unit maximum to charge""" - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(BaseModel): - tiers: List[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_bps_config: PriceNewSubscriptionTieredBpsPriceTieredBpsConfig - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBpsPriceBpsConfig(BaseModel): - bps: float - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] = None - """Optional currency amount maximum to cap spend per event""" - - -class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPrice(BaseModel): - bps_config: PriceNewSubscriptionBpsPriceBpsConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(BaseModel): - bps: float - """Basis points to rate on""" - - maximum_amount: Optional[str] = None - """Upper bound for tier""" - - per_unit_maximum: Optional[str] = None - """The maximum amount to charge for any one event""" - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(BaseModel): - tiers: List[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPrice(BaseModel): - bulk_bps_config: PriceNewSubscriptionBulkBpsPriceBulkBpsConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_bps"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkPriceBulkConfigTier(BaseModel): - unit_amount: str - """Amount per unit""" - - maximum_units: Optional[float] = None - """Upper bound for this tier""" - - -class PriceNewSubscriptionBulkPriceBulkConfig(BaseModel): - tiers: List[PriceNewSubscriptionBulkPriceBulkConfigTier] - """Bulk tiers for rating based on total usage volume""" - - -class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPrice(BaseModel): - bulk_config: PriceNewSubscriptionBulkPriceBulkConfig - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["threshold_total_amount"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - threshold_total_amount_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_package_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_minimum_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_percent"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_percent_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["package_with_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - package_with_allocation_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["tiered_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - tiered_with_proration_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["unit_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - unit_with_proration_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_allocation"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_prorated_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPrice(BaseModel): - bulk_with_proration_config: Dict[str, object] - - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["bulk_with_proration"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] = ( - None - ) - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_unit_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["scalable_matrix_with_tiered_pricing"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Dict[str, object] - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["cumulative_grouped_bulk"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Dict[str, object] - - price_model_type: Literal["max_group_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_with_metered_minimum"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration - ] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - item_id: str - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Dict[str, object] - - price_model_type: Literal["matrix_with_display_name"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] = ( - None - ) - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(BaseModel): - duration: int - """The duration of the billing period.""" - - duration_unit: Literal["day", "month"] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePrice(BaseModel): - cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: Dict[str, object] - - item_id: str - """The id of the item the price will be associated with.""" - - price_model_type: Literal["grouped_tiered_package"] = FieldInfo(alias="model_type") - - name: str - """The name of the price.""" - - billable_metric_id: Optional[str] = None - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] = None - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] = None - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] = None - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] = None - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] = None - """An alias for the price.""" - - fixed_price_quantity: Optional[float] = None - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] = None - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration - ] = None - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] = None - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -Price: TypeAlias = Annotated[ - Union[ - PriceNewSubscriptionUnitPrice, - PriceNewSubscriptionPackagePrice, - PriceNewSubscriptionMatrixPrice, - PriceNewSubscriptionTieredPrice, - PriceNewSubscriptionTieredBpsPrice, - PriceNewSubscriptionBpsPrice, - PriceNewSubscriptionBulkBpsPrice, - PriceNewSubscriptionBulkPrice, - PriceNewSubscriptionThresholdTotalAmountPrice, - PriceNewSubscriptionTieredPackagePrice, - PriceNewSubscriptionTieredWithMinimumPrice, - PriceNewSubscriptionUnitWithPercentPrice, - PriceNewSubscriptionPackageWithAllocationPrice, - PriceNewSubscriptionTierWithProrationPrice, - PriceNewSubscriptionUnitWithProrationPrice, - PriceNewSubscriptionGroupedAllocationPrice, - PriceNewSubscriptionGroupedWithProratedMinimumPrice, - PriceNewSubscriptionBulkWithProrationPrice, - PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, - PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, - PriceNewSubscriptionCumulativeGroupedBulkPrice, - PriceNewSubscriptionMaxGroupTieredPackagePrice, - PriceNewSubscriptionGroupedWithMeteredMinimumPrice, - PriceNewSubscriptionMatrixWithDisplayNamePrice, - PriceNewSubscriptionGroupedTieredPackagePrice, - None, - ], - PropertyInfo(discriminator="price_model_type"), -] - - -class ReplaceSubscriptionPriceParams(BaseModel): - replaces_price_id: str - """The id of the price on the plan to replace in the subscription.""" - - allocation_price: Optional[AllocationPrice] = None - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[List[Discount]] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for the replacement price. - """ - - external_price_id: Optional[str] = None - """The external price id of the price to add to the subscription.""" - - fixed_price_quantity: Optional[float] = None - """The new quantity of the price, if the price is a fixed price.""" - - maximum_amount: Optional[str] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for the replacement price. - """ - - minimum_amount: Optional[str] = None - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for the replacement price. - """ - - price: Optional[Price] = None - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] = None - """The id of the price to add to the subscription.""" diff --git a/src/orb/types/shared/update_price_request_params.py b/src/orb/types/shared/update_price_request_params.py deleted file mode 100644 index 766ade7d..00000000 --- a/src/orb/types/shared/update_price_request_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from ..._models import BaseModel - -__all__ = ["UpdatePriceRequestParams"] - - -class UpdatePriceRequestParams(BaseModel): - metadata: Optional[Dict[str, Optional[str]]] = None - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index 6b74220e..ef0fe3ec 100644 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -6,14 +6,3 @@ from .amount_discount import AmountDiscount as AmountDiscount from .percentage_discount import PercentageDiscount as PercentageDiscount from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate -from .add_subscription_price_params import AddSubscriptionPriceParams as AddSubscriptionPriceParams -from .add_credit_ledger_entry_request import AddCreditLedgerEntryRequest as AddCreditLedgerEntryRequest -from .remove_subscription_price_params import RemoveSubscriptionPriceParams as RemoveSubscriptionPriceParams -from .replace_subscription_price_params import ReplaceSubscriptionPriceParams as ReplaceSubscriptionPriceParams -from .add_subscription_adjustment_params import AddSubscriptionAdjustmentParams as AddSubscriptionAdjustmentParams -from .remove_subscription_adjustment_params import ( - RemoveSubscriptionAdjustmentParams as RemoveSubscriptionAdjustmentParams, -) -from .replace_subscription_adjustment_params import ( - ReplaceSubscriptionAdjustmentParams as ReplaceSubscriptionAdjustmentParams, -) diff --git a/src/orb/types/shared_params/add_credit_ledger_entry_request.py b/src/orb/types/shared_params/add_credit_ledger_entry_request.py deleted file mode 100644 index 7bf51ab8..00000000 --- a/src/orb/types/shared_params/add_credit_ledger_entry_request.py +++ /dev/null @@ -1,256 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union, Optional -from datetime import date, datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from ..._utils import PropertyInfo - -__all__ = [ - "AddCreditLedgerEntryRequest", - "AddIncrementCreditLedgerEntryRequestParams", - "AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings", - "AddDecrementCreditLedgerEntryRequestParams", - "AddExpirationChangeCreditLedgerEntryRequestParams", - "AddVoidCreditLedgerEntryRequestParams", - "AddAmendmentCreditLedgerEntryRequestParams", -] - - -class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): - auto_collection: Required[bool] - """ - Whether the credits purchase invoice should auto collect with the customer's - saved payment method. - """ - - net_terms: Required[int] - """ - 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. - """ - - memo: Optional[str] - """An optional memo to display on the invoice.""" - - require_successful_payment: bool - """ - If true, the new credit block will require that the corresponding invoice is - paid before it can be drawn down from. - """ - - -class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): - amount: Required[float] - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - entry_type: Required[Literal["increment"]] - - currency: Optional[str] - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """ - An ISO 8601 format date that denotes when this credit balance should become - available for use. - """ - - expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """An ISO 8601 format date that denotes when this credit balance should expire.""" - - invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] - """ - Passing `invoice_settings` automatically generates an invoice for the newly - added credits. If `invoice_settings` is passed, you must specify - per_unit_cost_basis, as the calculation of the invoice total is done on that - basis. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - per_unit_cost_basis: Optional[str] - """Can only be specified when entry_type=increment. - - How much, in the customer's currency, a customer paid for a single credit in - this block - """ - - -class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): - amount: Required[float] - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - entry_type: Required[Literal["decrement"]] - - currency: Optional[str] - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): - entry_type: Required[Literal["expiration_change"]] - - expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] - """An ISO 8601 format date that identifies the origination credit block to expire""" - - target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """ - A future date (specified in YYYY-MM-DD format) used for expiration change, - denoting when credits transferred (as part of a partial block expiration) should - expire. - """ - - amount: Optional[float] - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - block_id: Optional[str] - """ - The ID of the block affected by an expiration_change, used to differentiate - between multiple blocks with the same `expiry_date`. - """ - - currency: Optional[str] - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -class AddVoidCreditLedgerEntryRequestParams(TypedDict, total=False): - amount: Required[float] - """The number of credits to effect. - - Note that this is required for increment, decrement, void, or undo operations. - """ - - block_id: Required[str] - """The ID of the block to void.""" - - entry_type: Required[Literal["void"]] - - currency: Optional[str] - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - void_reason: Optional[Literal["refund"]] - """Can only be specified when `entry_type=void`. The reason for the void.""" - - -class AddAmendmentCreditLedgerEntryRequestParams(TypedDict, total=False): - amount: Required[float] - """The number of credits to effect. - - Note that this is required for increment, decrement or void operations. - """ - - block_id: Required[str] - """The ID of the block to reverse a decrement from.""" - - entry_type: Required[Literal["amendment"]] - - currency: Optional[str] - """The currency or custom pricing unit to use for this ledger entry. - - If this is a real-world currency, it must match the customer's invoicing - currency. - """ - - description: Optional[str] - """Optional metadata that can be specified when adding ledger results via the API. - - For example, this can be used to note an increment refers to trial credits, or - for noting corrections as a result of an incident, etc. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - -AddCreditLedgerEntryRequest: TypeAlias = Union[ - AddIncrementCreditLedgerEntryRequestParams, - AddDecrementCreditLedgerEntryRequestParams, - AddExpirationChangeCreditLedgerEntryRequestParams, - AddVoidCreditLedgerEntryRequestParams, - AddAmendmentCreditLedgerEntryRequestParams, -] diff --git a/src/orb/types/shared_params/add_subscription_adjustment_params.py b/src/orb/types/shared_params/add_subscription_adjustment_params.py deleted file mode 100644 index 5946cf33..00000000 --- a/src/orb/types/shared_params/add_subscription_adjustment_params.py +++ /dev/null @@ -1,129 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from ..._utils import PropertyInfo - -__all__ = [ - "AddSubscriptionAdjustmentParams", - "Adjustment", - "AdjustmentNewPercentageDiscount", - "AdjustmentNewUsageDiscount", - "AdjustmentNewAmountDiscount", - "AdjustmentNewMinimum", - "AdjustmentNewMaximum", -] - - -class AdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -Adjustment: TypeAlias = Union[ - AdjustmentNewPercentageDiscount, - AdjustmentNewUsageDiscount, - AdjustmentNewAmountDiscount, - AdjustmentNewMinimum, - AdjustmentNewMaximum, -] - - -class AddSubscriptionAdjustmentParams(TypedDict, total=False): - adjustment: Required[Adjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """The end date of the adjustment interval. - - This is the date that the adjustment will stop affecting prices on the - subscription. - """ - - plan_phase_order: Optional[int] - """The phase to add this adjustment to.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """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. - """ diff --git a/src/orb/types/shared_params/add_subscription_price_params.py b/src/orb/types/shared_params/add_subscription_price_params.py deleted file mode 100644 index 23c65730..00000000 --- a/src/orb/types/shared_params/add_subscription_price_params.py +++ /dev/null @@ -1,2576 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, List, Union, Iterable, Optional -from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict - -from ..._utils import PropertyInfo - -__all__ = [ - "AddSubscriptionPriceParams", - "AllocationPrice", - "Discount", - "Price", - "PriceNewSubscriptionUnitPrice", - "PriceNewSubscriptionUnitPriceUnitConfig", - "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackagePrice", - "PriceNewSubscriptionPackagePricePackageConfig", - "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixPrice", - "PriceNewSubscriptionMatrixPriceMatrixConfig", - "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPrice", - "PriceNewSubscriptionTieredPriceTieredConfig", - "PriceNewSubscriptionTieredPriceTieredConfigTier", - "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPrice", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBpsPrice", - "PriceNewSubscriptionBpsPriceBpsConfig", - "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPrice", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkPrice", - "PriceNewSubscriptionBulkPriceBulkConfig", - "PriceNewSubscriptionBulkPriceBulkConfigTier", - "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPrice", - "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePrice", - "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPrice", - "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPrice", - "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPrice", - "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPrice", - "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPrice", - "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPrice", - "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPrice", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPrice", - "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPrice", - "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePrice", - "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePrice", - "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePrice", - "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", -] - - -class AllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class Discount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class PriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[PriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[PriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """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. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class PriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[PriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class PriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[PriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[PriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[PriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[PriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class PriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[PriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["cumulative_grouped_bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Required[Dict[str, object]] - - model_type: Required[Literal["max_group_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_metered_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Required[Dict[str, object]] - - model_type: Required[Literal["matrix_with_display_name"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -Price: TypeAlias = Union[ - PriceNewSubscriptionUnitPrice, - PriceNewSubscriptionPackagePrice, - PriceNewSubscriptionMatrixPrice, - PriceNewSubscriptionTieredPrice, - PriceNewSubscriptionTieredBpsPrice, - PriceNewSubscriptionBpsPrice, - PriceNewSubscriptionBulkBpsPrice, - PriceNewSubscriptionBulkPrice, - PriceNewSubscriptionThresholdTotalAmountPrice, - PriceNewSubscriptionTieredPackagePrice, - PriceNewSubscriptionTieredWithMinimumPrice, - PriceNewSubscriptionUnitWithPercentPrice, - PriceNewSubscriptionPackageWithAllocationPrice, - PriceNewSubscriptionTierWithProrationPrice, - PriceNewSubscriptionUnitWithProrationPrice, - PriceNewSubscriptionGroupedAllocationPrice, - PriceNewSubscriptionGroupedWithProratedMinimumPrice, - PriceNewSubscriptionBulkWithProrationPrice, - PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, - PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, - PriceNewSubscriptionCumulativeGroupedBulkPrice, - PriceNewSubscriptionMaxGroupTieredPackagePrice, - PriceNewSubscriptionGroupedWithMeteredMinimumPrice, - PriceNewSubscriptionMatrixWithDisplayNamePrice, - PriceNewSubscriptionGroupedTieredPackagePrice, -] - - -class AddSubscriptionPriceParams(TypedDict, total=False): - allocation_price: Optional[AllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[Discount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for this price. - """ - - end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """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. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for this price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for this price. - """ - - plan_phase_order: Optional[int] - """The phase to add this price to.""" - - price: Optional[Price] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" - - start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """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. - """ diff --git a/src/orb/types/shared_params/remove_subscription_adjustment_params.py b/src/orb/types/shared_params/remove_subscription_adjustment_params.py deleted file mode 100644 index bb9a5d02..00000000 --- a/src/orb/types/shared_params/remove_subscription_adjustment_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RemoveSubscriptionAdjustmentParams"] - - -class RemoveSubscriptionAdjustmentParams(TypedDict, total=False): - adjustment_id: Required[str] - """The id of the adjustment to remove on the subscription.""" diff --git a/src/orb/types/shared_params/remove_subscription_price_params.py b/src/orb/types/shared_params/remove_subscription_price_params.py deleted file mode 100644 index e040a30b..00000000 --- a/src/orb/types/shared_params/remove_subscription_price_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import TypedDict - -__all__ = ["RemoveSubscriptionPriceParams"] - - -class RemoveSubscriptionPriceParams(TypedDict, total=False): - external_price_id: Optional[str] - """The external price id of the price to remove on the subscription.""" - - price_id: Optional[str] - """The id of the price to remove on the subscription.""" diff --git a/src/orb/types/shared_params/replace_subscription_adjustment_params.py b/src/orb/types/shared_params/replace_subscription_adjustment_params.py deleted file mode 100644 index c024bfad..00000000 --- a/src/orb/types/shared_params/replace_subscription_adjustment_params.py +++ /dev/null @@ -1,111 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = [ - "ReplaceSubscriptionAdjustmentParams", - "Adjustment", - "AdjustmentNewPercentageDiscount", - "AdjustmentNewUsageDiscount", - "AdjustmentNewAmountDiscount", - "AdjustmentNewMinimum", - "AdjustmentNewMaximum", -] - - -class AdjustmentNewPercentageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["percentage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - percentage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewUsageDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["usage_discount"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - usage_discount: Required[float] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewAmountDiscount(TypedDict, total=False): - adjustment_type: Required[Literal["amount_discount"]] - - amount_discount: Required[str] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMinimum(TypedDict, total=False): - adjustment_type: Required[Literal["minimum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - item_id: Required[str] - """The item ID that revenue from this minimum will be attributed to.""" - - minimum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -class AdjustmentNewMaximum(TypedDict, total=False): - adjustment_type: Required[Literal["maximum"]] - - applies_to_price_ids: Required[List[str]] - """The set of price IDs to which this adjustment applies.""" - - maximum_amount: Required[str] - - is_invoice_level: bool - """When false, this adjustment will be applied to a single price. - - Otherwise, it will be applied at the invoice level, possibly to multiple prices. - """ - - -Adjustment: TypeAlias = Union[ - AdjustmentNewPercentageDiscount, - AdjustmentNewUsageDiscount, - AdjustmentNewAmountDiscount, - AdjustmentNewMinimum, - AdjustmentNewMaximum, -] - - -class ReplaceSubscriptionAdjustmentParams(TypedDict, total=False): - adjustment: Required[Adjustment] - """The definition of a new adjustment to create and add to the subscription.""" - - replaces_adjustment_id: Required[str] - """The id of the adjustment on the plan to replace in the subscription.""" diff --git a/src/orb/types/shared_params/replace_subscription_price_params.py b/src/orb/types/shared_params/replace_subscription_price_params.py deleted file mode 100644 index 321efcca..00000000 --- a/src/orb/types/shared_params/replace_subscription_price_params.py +++ /dev/null @@ -1,2562 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = [ - "ReplaceSubscriptionPriceParams", - "AllocationPrice", - "Discount", - "Price", - "PriceNewSubscriptionUnitPrice", - "PriceNewSubscriptionUnitPriceUnitConfig", - "PriceNewSubscriptionUnitPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackagePrice", - "PriceNewSubscriptionPackagePricePackageConfig", - "PriceNewSubscriptionPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixPrice", - "PriceNewSubscriptionMatrixPriceMatrixConfig", - "PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", - "PriceNewSubscriptionMatrixPriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPrice", - "PriceNewSubscriptionTieredPriceTieredConfig", - "PriceNewSubscriptionTieredPriceTieredConfigTier", - "PriceNewSubscriptionTieredPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPrice", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfig", - "PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", - "PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBpsPrice", - "PriceNewSubscriptionBpsPriceBpsConfig", - "PriceNewSubscriptionBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPrice", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfig", - "PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", - "PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkPrice", - "PriceNewSubscriptionBulkPriceBulkConfig", - "PriceNewSubscriptionBulkPriceBulkConfigTier", - "PriceNewSubscriptionBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPrice", - "PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", - "PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePrice", - "PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPrice", - "PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPrice", - "PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPrice", - "PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPrice", - "PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPrice", - "PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPrice", - "PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPrice", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPrice", - "PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", - "PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPrice", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPrice", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", - "PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPrice", - "PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", - "PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePrice", - "PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPrice", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePrice", - "PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", - "PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePrice", - "PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", - "PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", -] - - -class AllocationPrice(TypedDict, total=False): - amount: Required[str] - """An amount of the currency to allocate to the customer at the specified cadence.""" - - cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] - """The cadence at which to allocate the amount to the customer.""" - - currency: Required[str] - """ - An ISO 4217 currency string or a custom pricing unit identifier in which to bill - this price. - """ - - expires_at_end_of_cadence: Required[bool] - """ - Whether the allocated amount should expire at the end of the cadence or roll - over to the next period. - """ - - -class Discount(TypedDict, total=False): - discount_type: Required[Literal["percentage", "usage", "amount"]] - - amount_discount: Optional[str] - """Only available if discount_type is `amount`.""" - - percentage_discount: Optional[float] - """Only available if discount_type is `percentage`. - - This is a number between 0 and 1. - """ - - usage_discount: Optional[float] - """Only available if discount_type is `usage`. - - Number of usage units that this discount is for - """ - - -class PriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): - unit_amount: Required[str] - """Rate per unit of usage""" - - -class PriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit"]] - - name: Required[str] - """The name of the price.""" - - unit_config: Required[PriceNewSubscriptionUnitPriceUnitConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): - package_amount: Required[str] - """A currency amount to rate usage by""" - - package_size: Required[int] - """An integer amount to represent package size. - - For example, 1000 here would divide usage by 1000 before multiplying by - package_amount in rating - """ - - -class PriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package"]] - - name: Required[str] - """The name of the price.""" - - package_config: Required[PriceNewSubscriptionPackagePricePackageConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): - dimension_values: Required[List[Optional[str]]] - """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. - """ - - unit_amount: Required[str] - """Unit price for the specified dimension_values""" - - -class PriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): - default_unit_amount: Required[str] - """Default per unit rate for any usage not bucketed into a specified matrix_value""" - - dimensions: Required[List[Optional[str]]] - """One or two event property values to evaluate matrix groups by""" - - matrix_values: Required[Iterable[PriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] - """Matrix values for specified matrix grouping keys""" - - -class PriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_config: Required[PriceNewSubscriptionMatrixPriceMatrixConfig] - - model_type: Required[Literal["matrix"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): - first_unit: Required[float] - """Inclusive tier starting value""" - - unit_amount: Required[str] - """Amount per unit""" - - last_unit: Optional[float] - """Exclusive tier ending value. If null, this is treated as the last tier""" - - -class PriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionTieredPriceTieredConfigTier]] - """Tiers for rating based on total usage quantities into the specified tier""" - - -class PriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered"]] - - name: Required[str] - """The name of the price.""" - - tiered_config: Required[PriceNewSubscriptionTieredPriceTieredConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Per-event basis point rate""" - - minimum_amount: Required[str] - """Inclusive tier starting value""" - - maximum_amount: Optional[str] - """Exclusive tier ending value""" - - per_unit_maximum: Optional[str] - """Per unit maximum to charge""" - - -class PriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] - """ - Tiers for a Graduated BPS pricing model, where usage is bucketed into specified - tiers - """ - - -class PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_bps"]] - - name: Required[str] - """The name of the price.""" - - tiered_bps_config: Required[PriceNewSubscriptionTieredBpsPriceTieredBpsConfig] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): - bps: Required[float] - """Basis point take rate per event""" - - per_unit_maximum: Optional[str] - """Optional currency amount maximum to cap spend per event""" - - -class PriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBpsPrice(TypedDict, total=False): - bps_config: Required[PriceNewSubscriptionBpsPriceBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): - bps: Required[float] - """Basis points to rate on""" - - maximum_amount: Optional[str] - """Upper bound for tier""" - - per_unit_maximum: Optional[str] - """The maximum amount to charge for any one event""" - - -class PriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] - """ - Tiers for a bulk BPS pricing model where all usage is aggregated to a single - tier based on total volume - """ - - -class PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): - bulk_bps_config: Required[PriceNewSubscriptionBulkBpsPriceBulkBpsConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_bps"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): - unit_amount: Required[str] - """Amount per unit""" - - maximum_units: Optional[float] - """Upper bound for this tier""" - - -class PriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): - tiers: Required[Iterable[PriceNewSubscriptionBulkPriceBulkConfigTier]] - """Bulk tiers for rating based on total usage volume""" - - -class PriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkPrice(TypedDict, total=False): - bulk_config: Required[PriceNewSubscriptionBulkPriceBulkConfig] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["threshold_total_amount"]] - - name: Required[str] - """The name of the price.""" - - threshold_total_amount_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_package"]] - - name: Required[str] - """The name of the price.""" - - tiered_package_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_minimum"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_minimum_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_percent"]] - - name: Required[str] - """The name of the price.""" - - unit_with_percent_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["package_with_allocation"]] - - name: Required[str] - """The name of the price.""" - - package_with_allocation_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["tiered_with_proration"]] - - name: Required[str] - """The name of the price.""" - - tiered_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["unit_with_proration"]] - - name: Required[str] - """The name of the price.""" - - unit_with_proration_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_allocation_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_allocation"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_prorated_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_prorated_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): - bulk_with_proration_config: Required[Dict[str, object]] - - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["bulk_with_proration"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] - - name: Required[str] - """The name of the price.""" - - scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration - ] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - cumulative_grouped_bulk_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["cumulative_grouped_bulk"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - max_group_tiered_package_config: Required[Dict[str, object]] - - model_type: Required[Literal["max_group_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_with_metered_minimum_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_with_metered_minimum"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[ - PriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration - ] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - matrix_with_display_name_config: Required[Dict[str, object]] - - model_type: Required[Literal["matrix_with_display_name"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -class PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): - duration: Required[int] - """The duration of the billing period.""" - - duration_unit: Required[Literal["day", "month"]] - """The unit of billing period duration.""" - - -class PriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): - cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] - """The cadence to bill for this price on.""" - - grouped_tiered_package_config: Required[Dict[str, object]] - - item_id: Required[str] - """The id of the item the price will be associated with.""" - - model_type: Required[Literal["grouped_tiered_package"]] - - name: Required[str] - """The name of the price.""" - - billable_metric_id: Optional[str] - """The id of the billable metric for the price. - - Only needed if the price is usage-based. - """ - - billed_in_advance: Optional[bool] - """ - If the Price represents a fixed cost, the price will be billed in-advance if - this is true, and in-arrears if this is false. - """ - - billing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration] - """ - For custom cadence: specifies the duration of the billing period in days or - months. - """ - - conversion_rate: Optional[float] - """The per unit conversion rate of the price currency to the invoicing currency.""" - - currency: Optional[str] - """ - An ISO 4217 currency string, or custom pricing unit identifier, in which this - price is billed. - """ - - external_price_id: Optional[str] - """An alias for the price.""" - - fixed_price_quantity: Optional[float] - """ - If the Price represents a fixed cost, this represents the quantity of units - applied. - """ - - invoice_grouping_key: Optional[str] - """The property used to group this price on an invoice""" - - invoicing_cycle_configuration: Optional[PriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration] - """Within each billing cycle, specifies the cadence at which invoices are produced. - - If unspecified, a single invoice is produced per billing cycle. - """ - - metadata: Optional[Dict[str, Optional[str]]] - """User-specified key/value pairs for the resource. - - Individual keys can be removed by setting the value to `null`, and the entire - metadata mapping can be cleared by setting `metadata` to `null`. - """ - - reference_id: Optional[str] - """ - A transient ID that can be used to reference this price when adding adjustments - in the same API call. - """ - - -Price: TypeAlias = Union[ - PriceNewSubscriptionUnitPrice, - PriceNewSubscriptionPackagePrice, - PriceNewSubscriptionMatrixPrice, - PriceNewSubscriptionTieredPrice, - PriceNewSubscriptionTieredBpsPrice, - PriceNewSubscriptionBpsPrice, - PriceNewSubscriptionBulkBpsPrice, - PriceNewSubscriptionBulkPrice, - PriceNewSubscriptionThresholdTotalAmountPrice, - PriceNewSubscriptionTieredPackagePrice, - PriceNewSubscriptionTieredWithMinimumPrice, - PriceNewSubscriptionUnitWithPercentPrice, - PriceNewSubscriptionPackageWithAllocationPrice, - PriceNewSubscriptionTierWithProrationPrice, - PriceNewSubscriptionUnitWithProrationPrice, - PriceNewSubscriptionGroupedAllocationPrice, - PriceNewSubscriptionGroupedWithProratedMinimumPrice, - PriceNewSubscriptionBulkWithProrationPrice, - PriceNewSubscriptionScalableMatrixWithUnitPricingPrice, - PriceNewSubscriptionScalableMatrixWithTieredPricingPrice, - PriceNewSubscriptionCumulativeGroupedBulkPrice, - PriceNewSubscriptionMaxGroupTieredPackagePrice, - PriceNewSubscriptionGroupedWithMeteredMinimumPrice, - PriceNewSubscriptionMatrixWithDisplayNamePrice, - PriceNewSubscriptionGroupedTieredPackagePrice, -] - - -class ReplaceSubscriptionPriceParams(TypedDict, total=False): - replaces_price_id: Required[str] - """The id of the price on the plan to replace in the subscription.""" - - allocation_price: Optional[AllocationPrice] - """The definition of a new allocation price to create and add to the subscription.""" - - discounts: Optional[Iterable[Discount]] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's discounts for the replacement price. - """ - - external_price_id: Optional[str] - """The external price id of the price to add to the subscription.""" - - fixed_price_quantity: Optional[float] - """The new quantity of the price, if the price is a fixed price.""" - - maximum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's maximum amount for the replacement price. - """ - - minimum_amount: Optional[str] - """[DEPRECATED] Use add_adjustments instead. - - The subscription's minimum amount for the replacement price. - """ - - price: Optional[Price] - """The definition of a new price to create and add to the subscription.""" - - price_id: Optional[str] - """The id of the price to add to the subscription.""" diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 3ef2b5ee..1caf93ce 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -4,28 +4,225 @@ from typing import Dict, List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -from .shared_params.add_subscription_price_params import AddSubscriptionPriceParams -from .shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams -from .shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams -from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams -from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams -from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams -__all__ = ["SubscriptionCreateParams", "BillingCycleAnchorConfiguration"] +__all__ = [ + "SubscriptionCreateParams", + "AddAdjustment", + "AddAdjustmentAdjustment", + "AddAdjustmentAdjustmentNewPercentageDiscount", + "AddAdjustmentAdjustmentNewUsageDiscount", + "AddAdjustmentAdjustmentNewAmountDiscount", + "AddAdjustmentAdjustmentNewMinimum", + "AddAdjustmentAdjustmentNewMaximum", + "AddPrice", + "AddPriceAllocationPrice", + "AddPriceDiscount", + "AddPricePrice", + "AddPricePriceNewSubscriptionUnitPrice", + "AddPricePriceNewSubscriptionUnitPriceUnitConfig", + "AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionPackagePrice", + "AddPricePriceNewSubscriptionPackagePricePackageConfig", + "AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixPrice", + "AddPricePriceNewSubscriptionMatrixPriceMatrixConfig", + "AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPrice", + "AddPricePriceNewSubscriptionTieredPriceTieredConfig", + "AddPricePriceNewSubscriptionTieredPriceTieredConfigTier", + "AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredBpsPrice", + "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBpsPrice", + "AddPricePriceNewSubscriptionBpsPriceBpsConfig", + "AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkBpsPrice", + "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkPrice", + "AddPricePriceNewSubscriptionBulkPriceBulkConfig", + "AddPricePriceNewSubscriptionBulkPriceBulkConfigTier", + "AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionThresholdTotalAmountPrice", + "AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPackagePrice", + "AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredWithMinimumPrice", + "AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithPercentPrice", + "AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionPackageWithAllocationPrice", + "AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTierWithProrationPrice", + "AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithProrationPrice", + "AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedAllocationPrice", + "AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkWithProrationPrice", + "AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedTieredPackagePrice", + "AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", + "BillingCycleAnchorConfiguration", + "RemoveAdjustment", + "RemovePrice", + "ReplaceAdjustment", + "ReplaceAdjustmentAdjustment", + "ReplaceAdjustmentAdjustmentNewPercentageDiscount", + "ReplaceAdjustmentAdjustmentNewUsageDiscount", + "ReplaceAdjustmentAdjustmentNewAmountDiscount", + "ReplaceAdjustmentAdjustmentNewMinimum", + "ReplaceAdjustmentAdjustmentNewMaximum", + "ReplacePrice", + "ReplacePriceAllocationPrice", + "ReplacePriceDiscount", + "ReplacePricePrice", + "ReplacePricePriceNewSubscriptionUnitPrice", + "ReplacePricePriceNewSubscriptionUnitPriceUnitConfig", + "ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackagePrice", + "ReplacePricePriceNewSubscriptionPackagePricePackageConfig", + "ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixPrice", + "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig", + "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPrice", + "ReplacePricePriceNewSubscriptionTieredPriceTieredConfig", + "ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier", + "ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredBpsPrice", + "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBpsPrice", + "ReplacePricePriceNewSubscriptionBpsPriceBpsConfig", + "ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkBpsPrice", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkPrice", + "ReplacePricePriceNewSubscriptionBulkPriceBulkConfig", + "ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier", + "ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPackagePrice", + "ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPrice", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithPercentPrice", + "ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPrice", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTierWithProrationPrice", + "ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithProrationPrice", + "ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedAllocationPrice", + "ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkWithProrationPrice", + "ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] class SubscriptionCreateParams(TypedDict, total=False): - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] + add_adjustments: Optional[Iterable[AddAdjustment]] """Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] + add_prices: Optional[Iterable[AddPrice]] """Additional prices to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -126,28 +323,28 @@ class SubscriptionCreateParams(TypedDict, total=False): price_overrides: Optional[Iterable[object]] """Optionally provide a list of overrides for prices on the plan""" - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] + remove_adjustments: Optional[Iterable[RemoveAdjustment]] """Plan adjustments to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] + remove_prices: Optional[Iterable[RemovePrice]] """Plan prices to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] + replace_adjustments: Optional[Iterable[ReplaceAdjustment]] """Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] + replace_prices: Optional[Iterable[ReplacePrice]] """Plan prices to be replaced with additional prices on the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -174,25 +371,5278 @@ class SubscriptionCreateParams(TypedDict, total=False): """ +class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +AddAdjustmentAdjustment: TypeAlias = Union[ + AddAdjustmentAdjustmentNewPercentageDiscount, + AddAdjustmentAdjustmentNewUsageDiscount, + AddAdjustmentAdjustmentNewAmountDiscount, + AddAdjustmentAdjustmentNewMinimum, + AddAdjustmentAdjustmentNewMaximum, +] + + +class AddAdjustment(TypedDict, total=False): + adjustment: Required[AddAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the subscription.""" + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The end date of the adjustment interval. + + This is the date that the adjustment will stop affecting prices on the + subscription. + """ + + plan_phase_order: Optional[int] + """The phase to add this adjustment to.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + +class AddPriceAllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class AddPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class AddPricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[AddPricePriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[AddPricePriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """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. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class AddPricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[AddPricePriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class AddPricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[AddPricePriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[AddPricePriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class AddPricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[AddPricePriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPricePrice: TypeAlias = Union[ + AddPricePriceNewSubscriptionUnitPrice, + AddPricePriceNewSubscriptionPackagePrice, + AddPricePriceNewSubscriptionMatrixPrice, + AddPricePriceNewSubscriptionTieredPrice, + AddPricePriceNewSubscriptionTieredBpsPrice, + AddPricePriceNewSubscriptionBpsPrice, + AddPricePriceNewSubscriptionBulkBpsPrice, + AddPricePriceNewSubscriptionBulkPrice, + AddPricePriceNewSubscriptionThresholdTotalAmountPrice, + AddPricePriceNewSubscriptionTieredPackagePrice, + AddPricePriceNewSubscriptionTieredWithMinimumPrice, + AddPricePriceNewSubscriptionUnitWithPercentPrice, + AddPricePriceNewSubscriptionPackageWithAllocationPrice, + AddPricePriceNewSubscriptionTierWithProrationPrice, + AddPricePriceNewSubscriptionUnitWithProrationPrice, + AddPricePriceNewSubscriptionGroupedAllocationPrice, + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice, + AddPricePriceNewSubscriptionBulkWithProrationPrice, + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice, + AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice, + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice, + AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice, + AddPricePriceNewSubscriptionGroupedTieredPackagePrice, +] + + +class AddPrice(TypedDict, total=False): + allocation_price: Optional[AddPriceAllocationPrice] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[AddPriceDiscount]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for this price. + """ + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for this price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for this price. + """ + + plan_phase_order: Optional[int] + """The phase to add this price to.""" + + price: Optional[AddPricePrice] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + class BillingCycleAnchorConfiguration(TypedDict, total=False): day: Required[int] """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. + 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. + """ + + month: Optional[int] + """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). + """ + + year: Optional[int] + """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.). + """ + + +class RemoveAdjustment(TypedDict, total=False): + adjustment_id: Required[str] + """The id of the adjustment to remove on the subscription.""" + + +class RemovePrice(TypedDict, total=False): + external_price_id: Optional[str] + """The external price id of the price to remove on the subscription.""" + + price_id: Optional[str] + """The id of the price to remove on the subscription.""" + + +class ReplaceAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +ReplaceAdjustmentAdjustment: TypeAlias = Union[ + ReplaceAdjustmentAdjustmentNewPercentageDiscount, + ReplaceAdjustmentAdjustmentNewUsageDiscount, + ReplaceAdjustmentAdjustmentNewAmountDiscount, + ReplaceAdjustmentAdjustmentNewMinimum, + ReplaceAdjustmentAdjustmentNewMaximum, +] + + +class ReplaceAdjustment(TypedDict, total=False): + adjustment: Required[ReplaceAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the subscription.""" + + replaces_adjustment_id: Required[str] + """The id of the adjustment on the plan to replace in the subscription.""" + + +class ReplacePriceAllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class ReplacePriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class ReplacePricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[ReplacePricePriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[ReplacePricePriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """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. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class ReplacePricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[ReplacePricePriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[ReplacePricePriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class ReplacePricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[ReplacePricePriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. """ - month: Optional[int] - """The month on which the billing cycle is anchored (e.g. + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" - a quarterly price anchored in February would have cycles starting February, May, - August, and November). + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. """ - year: Optional[int] - """The year on which the billing cycle is anchored (e.g. + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +ReplacePricePrice: TypeAlias = Union[ + ReplacePricePriceNewSubscriptionUnitPrice, + ReplacePricePriceNewSubscriptionPackagePrice, + ReplacePricePriceNewSubscriptionMatrixPrice, + ReplacePricePriceNewSubscriptionTieredPrice, + ReplacePricePriceNewSubscriptionTieredBpsPrice, + ReplacePricePriceNewSubscriptionBpsPrice, + ReplacePricePriceNewSubscriptionBulkBpsPrice, + ReplacePricePriceNewSubscriptionBulkPrice, + ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice, + ReplacePricePriceNewSubscriptionTieredPackagePrice, + ReplacePricePriceNewSubscriptionTieredWithMinimumPrice, + ReplacePricePriceNewSubscriptionUnitWithPercentPrice, + ReplacePricePriceNewSubscriptionPackageWithAllocationPrice, + ReplacePricePriceNewSubscriptionTierWithProrationPrice, + ReplacePricePriceNewSubscriptionUnitWithProrationPrice, + ReplacePricePriceNewSubscriptionGroupedAllocationPrice, + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice, + ReplacePricePriceNewSubscriptionBulkWithProrationPrice, + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice, + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice, + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice, + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice, + ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice, +] + + +class ReplacePrice(TypedDict, total=False): + replaces_price_id: Required[str] + """The id of the price on the plan to replace in the subscription.""" + + allocation_price: Optional[ReplacePriceAllocationPrice] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[ReplacePriceDiscount]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for the replacement price. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + fixed_price_quantity: Optional[float] + """The new quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for the replacement price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for the replacement price. + """ + + price: Optional[ReplacePricePrice] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription.""" diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index ae687f1b..2961e733 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -2,32 +2,229 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -from .shared_params.add_subscription_price_params import AddSubscriptionPriceParams -from .shared_params.remove_subscription_price_params import RemoveSubscriptionPriceParams -from .shared_params.replace_subscription_price_params import ReplaceSubscriptionPriceParams -from .shared_params.add_subscription_adjustment_params import AddSubscriptionAdjustmentParams -from .shared_params.remove_subscription_adjustment_params import RemoveSubscriptionAdjustmentParams -from .shared_params.replace_subscription_adjustment_params import ReplaceSubscriptionAdjustmentParams -__all__ = ["SubscriptionSchedulePlanChangeParams", "BillingCycleAnchorConfiguration"] +__all__ = [ + "SubscriptionSchedulePlanChangeParams", + "AddAdjustment", + "AddAdjustmentAdjustment", + "AddAdjustmentAdjustmentNewPercentageDiscount", + "AddAdjustmentAdjustmentNewUsageDiscount", + "AddAdjustmentAdjustmentNewAmountDiscount", + "AddAdjustmentAdjustmentNewMinimum", + "AddAdjustmentAdjustmentNewMaximum", + "AddPrice", + "AddPriceAllocationPrice", + "AddPriceDiscount", + "AddPricePrice", + "AddPricePriceNewSubscriptionUnitPrice", + "AddPricePriceNewSubscriptionUnitPriceUnitConfig", + "AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionPackagePrice", + "AddPricePriceNewSubscriptionPackagePricePackageConfig", + "AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixPrice", + "AddPricePriceNewSubscriptionMatrixPriceMatrixConfig", + "AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPrice", + "AddPricePriceNewSubscriptionTieredPriceTieredConfig", + "AddPricePriceNewSubscriptionTieredPriceTieredConfigTier", + "AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredBpsPrice", + "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBpsPrice", + "AddPricePriceNewSubscriptionBpsPriceBpsConfig", + "AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkBpsPrice", + "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkPrice", + "AddPricePriceNewSubscriptionBulkPriceBulkConfig", + "AddPricePriceNewSubscriptionBulkPriceBulkConfigTier", + "AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionThresholdTotalAmountPrice", + "AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPackagePrice", + "AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredWithMinimumPrice", + "AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithPercentPrice", + "AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionPackageWithAllocationPrice", + "AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionTierWithProrationPrice", + "AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithProrationPrice", + "AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedAllocationPrice", + "AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkWithProrationPrice", + "AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedTieredPackagePrice", + "AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", + "BillingCycleAnchorConfiguration", + "RemoveAdjustment", + "RemovePrice", + "ReplaceAdjustment", + "ReplaceAdjustmentAdjustment", + "ReplaceAdjustmentAdjustmentNewPercentageDiscount", + "ReplaceAdjustmentAdjustmentNewUsageDiscount", + "ReplaceAdjustmentAdjustmentNewAmountDiscount", + "ReplaceAdjustmentAdjustmentNewMinimum", + "ReplaceAdjustmentAdjustmentNewMaximum", + "ReplacePrice", + "ReplacePriceAllocationPrice", + "ReplacePriceDiscount", + "ReplacePricePrice", + "ReplacePricePriceNewSubscriptionUnitPrice", + "ReplacePricePriceNewSubscriptionUnitPriceUnitConfig", + "ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackagePrice", + "ReplacePricePriceNewSubscriptionPackagePricePackageConfig", + "ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixPrice", + "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig", + "ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue", + "ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPrice", + "ReplacePricePriceNewSubscriptionTieredPriceTieredConfig", + "ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier", + "ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredBpsPrice", + "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig", + "ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier", + "ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBpsPrice", + "ReplacePricePriceNewSubscriptionBpsPriceBpsConfig", + "ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkBpsPrice", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier", + "ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkPrice", + "ReplacePricePriceNewSubscriptionBulkPriceBulkConfig", + "ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier", + "ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPackagePrice", + "ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPrice", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithPercentPrice", + "ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPrice", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTierWithProrationPrice", + "ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithProrationPrice", + "ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedAllocationPrice", + "ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkWithProrationPrice", + "ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration", + "ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration", +] class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): change_option: Required[Literal["requested_date", "end_of_subscription_term", "immediate"]] - add_adjustments: Optional[Iterable[AddSubscriptionAdjustmentParams]] + add_adjustments: Optional[Iterable[AddAdjustment]] """Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - add_prices: Optional[Iterable[AddSubscriptionPriceParams]] + add_prices: Optional[Iterable[AddPrice]] """Additional prices to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -128,28 +325,28 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): price_overrides: Optional[Iterable[object]] """Optionally provide a list of overrides for prices on the plan""" - remove_adjustments: Optional[Iterable[RemoveSubscriptionAdjustmentParams]] + remove_adjustments: Optional[Iterable[RemoveAdjustment]] """Plan adjustments to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - remove_prices: Optional[Iterable[RemoveSubscriptionPriceParams]] + remove_prices: Optional[Iterable[RemovePrice]] """Plan prices to be removed from the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_adjustments: Optional[Iterable[ReplaceSubscriptionAdjustmentParams]] + replace_adjustments: Optional[Iterable[ReplaceAdjustment]] """Plan adjustments to be replaced with additional adjustments on the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) """ - replace_prices: Optional[Iterable[ReplaceSubscriptionPriceParams]] + replace_prices: Optional[Iterable[ReplacePrice]] """Plan prices to be replaced with additional prices on the subscription. (Only available for accounts that have migrated off of legacy subscription @@ -174,25 +371,5278 @@ class SubscriptionSchedulePlanChangeParams(TypedDict, total=False): """ +class AddAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class AddAdjustmentAdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +AddAdjustmentAdjustment: TypeAlias = Union[ + AddAdjustmentAdjustmentNewPercentageDiscount, + AddAdjustmentAdjustmentNewUsageDiscount, + AddAdjustmentAdjustmentNewAmountDiscount, + AddAdjustmentAdjustmentNewMinimum, + AddAdjustmentAdjustmentNewMaximum, +] + + +class AddAdjustment(TypedDict, total=False): + adjustment: Required[AddAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the subscription.""" + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """The end date of the adjustment interval. + + This is the date that the adjustment will stop affecting prices on the + subscription. + """ + + plan_phase_order: Optional[int] + """The phase to add this adjustment to.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + +class AddPriceAllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class AddPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class AddPricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[AddPricePriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[AddPricePriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """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. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class AddPricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[AddPricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[AddPricePriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class AddPricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[AddPricePriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[AddPricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[AddPricePriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[AddPricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class AddPricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[AddPricePriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[AddPricePriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[AddPricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPricePriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + AddPricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPricePrice: TypeAlias = Union[ + AddPricePriceNewSubscriptionUnitPrice, + AddPricePriceNewSubscriptionPackagePrice, + AddPricePriceNewSubscriptionMatrixPrice, + AddPricePriceNewSubscriptionTieredPrice, + AddPricePriceNewSubscriptionTieredBpsPrice, + AddPricePriceNewSubscriptionBpsPrice, + AddPricePriceNewSubscriptionBulkBpsPrice, + AddPricePriceNewSubscriptionBulkPrice, + AddPricePriceNewSubscriptionThresholdTotalAmountPrice, + AddPricePriceNewSubscriptionTieredPackagePrice, + AddPricePriceNewSubscriptionTieredWithMinimumPrice, + AddPricePriceNewSubscriptionUnitWithPercentPrice, + AddPricePriceNewSubscriptionPackageWithAllocationPrice, + AddPricePriceNewSubscriptionTierWithProrationPrice, + AddPricePriceNewSubscriptionUnitWithProrationPrice, + AddPricePriceNewSubscriptionGroupedAllocationPrice, + AddPricePriceNewSubscriptionGroupedWithProratedMinimumPrice, + AddPricePriceNewSubscriptionBulkWithProrationPrice, + AddPricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + AddPricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + AddPricePriceNewSubscriptionCumulativeGroupedBulkPrice, + AddPricePriceNewSubscriptionMaxGroupTieredPackagePrice, + AddPricePriceNewSubscriptionGroupedWithMeteredMinimumPrice, + AddPricePriceNewSubscriptionMatrixWithDisplayNamePrice, + AddPricePriceNewSubscriptionGroupedTieredPackagePrice, +] + + +class AddPrice(TypedDict, total=False): + allocation_price: Optional[AddPriceAllocationPrice] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[AddPriceDiscount]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for this price. + """ + + end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for this price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for this price. + """ + + plan_phase_order: Optional[int] + """The phase to add this price to.""" + + price: Optional[AddPricePrice] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription.""" + + start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """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. + """ + + class BillingCycleAnchorConfiguration(TypedDict, total=False): day: Required[int] """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. + 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. + """ + + month: Optional[int] + """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). + """ + + year: Optional[int] + """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.). + """ + + +class RemoveAdjustment(TypedDict, total=False): + adjustment_id: Required[str] + """The id of the adjustment to remove on the subscription.""" + + +class RemovePrice(TypedDict, total=False): + external_price_id: Optional[str] + """The external price id of the price to remove on the subscription.""" + + price_id: Optional[str] + """The id of the price to remove on the subscription.""" + + +class ReplaceAdjustmentAdjustmentNewPercentageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["percentage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + percentage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewUsageDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["usage_discount"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + usage_discount: Required[float] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewAmountDiscount(TypedDict, total=False): + adjustment_type: Required[Literal["amount_discount"]] + + amount_discount: Required[str] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewMinimum(TypedDict, total=False): + adjustment_type: Required[Literal["minimum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + item_id: Required[str] + """The item ID that revenue from this minimum will be attributed to.""" + + minimum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +class ReplaceAdjustmentAdjustmentNewMaximum(TypedDict, total=False): + adjustment_type: Required[Literal["maximum"]] + + applies_to_price_ids: Required[List[str]] + """The set of price IDs to which this adjustment applies.""" + + maximum_amount: Required[str] + + is_invoice_level: bool + """When false, this adjustment will be applied to a single price. + + Otherwise, it will be applied at the invoice level, possibly to multiple prices. + """ + + +ReplaceAdjustmentAdjustment: TypeAlias = Union[ + ReplaceAdjustmentAdjustmentNewPercentageDiscount, + ReplaceAdjustmentAdjustmentNewUsageDiscount, + ReplaceAdjustmentAdjustmentNewAmountDiscount, + ReplaceAdjustmentAdjustmentNewMinimum, + ReplaceAdjustmentAdjustmentNewMaximum, +] + + +class ReplaceAdjustment(TypedDict, total=False): + adjustment: Required[ReplaceAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the subscription.""" + + replaces_adjustment_id: Required[str] + """The id of the adjustment on the plan to replace in the subscription.""" + + +class ReplacePriceAllocationPrice(TypedDict, total=False): + amount: Required[str] + """An amount of the currency to allocate to the customer at the specified cadence.""" + + cadence: Required[Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"]] + """The cadence at which to allocate the amount to the customer.""" + + currency: Required[str] + """ + An ISO 4217 currency string or a custom pricing unit identifier in which to bill + this price. + """ + + expires_at_end_of_cadence: Required[bool] + """ + Whether the allocated amount should expire at the end of the cadence or roll + over to the next period. + """ + + +class ReplacePriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class ReplacePricePriceNewSubscriptionUnitPriceUnitConfig(TypedDict, total=False): + unit_amount: Required[str] + """Rate per unit of usage""" + + +class ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit"]] + + name: Required[str] + """The name of the price.""" + + unit_config: Required[ReplacePricePriceNewSubscriptionUnitPriceUnitConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionPackagePricePackageConfig(TypedDict, total=False): + package_amount: Required[str] + """A currency amount to rate usage by""" + + package_size: Required[int] + """An integer amount to represent package size. + + For example, 1000 here would divide usage by 1000 before multiplying by + package_amount in rating + """ + + +class ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package"]] + + name: Required[str] + """The name of the price.""" + + package_config: Required[ReplacePricePriceNewSubscriptionPackagePricePackageConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue(TypedDict, total=False): + dimension_values: Required[List[Optional[str]]] + """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. + """ + + unit_amount: Required[str] + """Unit price for the specified dimension_values""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig(TypedDict, total=False): + default_unit_amount: Required[str] + """Default per unit rate for any usage not bucketed into a specified matrix_value""" + + dimensions: Required[List[Optional[str]]] + """One or two event property values to evaluate matrix groups by""" + + matrix_values: Required[Iterable[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfigMatrixValue]] + """Matrix values for specified matrix grouping keys""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_config: Required[ReplacePricePriceNewSubscriptionMatrixPriceMatrixConfig] + + model_type: Required[Literal["matrix"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier(TypedDict, total=False): + first_unit: Required[float] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + last_unit: Optional[float] + """Exclusive tier ending value. If null, this is treated as the last tier""" + + +class ReplacePricePriceNewSubscriptionTieredPriceTieredConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredPriceTieredConfigTier]] + """Tiers for rating based on total usage quantities into the specified tier""" + + +class ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered"]] + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[ReplacePricePriceNewSubscriptionTieredPriceTieredConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Per-event basis point rate""" + + minimum_amount: Required[str] + """Inclusive tier starting value""" + + maximum_amount: Optional[str] + """Exclusive tier ending value""" + + per_unit_maximum: Optional[str] + """Per unit maximum to charge""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfigTier]] + """ + Tiers for a Graduated BPS pricing model, where usage is bucketed into specified + tiers + """ + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredBpsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_bps"]] + + name: Required[str] + """The name of the price.""" + + tiered_bps_config: Required[ReplacePricePriceNewSubscriptionTieredBpsPriceTieredBpsConfig] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBpsPriceBpsConfig(TypedDict, total=False): + bps: Required[float] + """Basis point take rate per event""" + + per_unit_maximum: Optional[str] + """Optional currency amount maximum to cap spend per event""" + + +class ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBpsPrice(TypedDict, total=False): + bps_config: Required[ReplacePricePriceNewSubscriptionBpsPriceBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier(TypedDict, total=False): + bps: Required[float] + """Basis points to rate on""" + + maximum_amount: Optional[str] + """Upper bound for tier""" + + per_unit_maximum: Optional[str] + """The maximum amount to charge for any one event""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfigTier]] + """ + Tiers for a bulk BPS pricing model where all usage is aggregated to a single + tier based on total volume + """ + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkBpsPrice(TypedDict, total=False): + bulk_bps_config: Required[ReplacePricePriceNewSubscriptionBulkBpsPriceBulkBpsConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_bps"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier(TypedDict, total=False): + unit_amount: Required[str] + """Amount per unit""" + + maximum_units: Optional[float] + """Upper bound for this tier""" + + +class ReplacePricePriceNewSubscriptionBulkPriceBulkConfig(TypedDict, total=False): + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionBulkPriceBulkConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkPrice(TypedDict, total=False): + bulk_config: Required[ReplacePricePriceNewSubscriptionBulkPriceBulkConfig] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["threshold_total_amount"]] + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_package"]] + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionTieredPackagePriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_minimum"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredWithMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTieredWithMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_percent"]] + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ReplacePricePriceNewSubscriptionUnitWithPercentPriceBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithPercentPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["package_with_allocation"]] + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionPackageWithAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionPackageWithAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionTierWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTierWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionTierWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["unit_with_proration"]] + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionUnitWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_allocation"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedAllocationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedAllocationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[Dict[str, object]] + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_proration"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionBulkWithProrationPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionBulkWithProrationPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration( + TypedDict, total=False +): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[Dict[str, object]] + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. """ - month: Optional[int] - """The month on which the billing cycle is anchored (e.g. + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ - a quarterly price anchored in February would have cycles starting February, May, - August, and November). + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. """ - year: Optional[int] - """The year on which the billing cycle is anchored (e.g. + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" - a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, - 2023, 2025, etc.). + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_bulk"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + max_group_tiered_package_config: Required[Dict[str, object]] + + model_type: Required[Literal["max_group_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_metered_minimum"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + matrix_with_display_name_config: Required[Dict[str, object]] + + model_type: Required[Literal["matrix_with_display_name"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[Dict[str, object]] + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_tiered_package"]] + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceBillingCycleConfiguration + ] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. """ + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[ + ReplacePricePriceNewSubscriptionGroupedTieredPackagePriceInvoicingCycleConfiguration + ] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + + metadata: Optional[Dict[str, Optional[str]]] + """User-specified key/value pairs for the resource. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +ReplacePricePrice: TypeAlias = Union[ + ReplacePricePriceNewSubscriptionUnitPrice, + ReplacePricePriceNewSubscriptionPackagePrice, + ReplacePricePriceNewSubscriptionMatrixPrice, + ReplacePricePriceNewSubscriptionTieredPrice, + ReplacePricePriceNewSubscriptionTieredBpsPrice, + ReplacePricePriceNewSubscriptionBpsPrice, + ReplacePricePriceNewSubscriptionBulkBpsPrice, + ReplacePricePriceNewSubscriptionBulkPrice, + ReplacePricePriceNewSubscriptionThresholdTotalAmountPrice, + ReplacePricePriceNewSubscriptionTieredPackagePrice, + ReplacePricePriceNewSubscriptionTieredWithMinimumPrice, + ReplacePricePriceNewSubscriptionUnitWithPercentPrice, + ReplacePricePriceNewSubscriptionPackageWithAllocationPrice, + ReplacePricePriceNewSubscriptionTierWithProrationPrice, + ReplacePricePriceNewSubscriptionUnitWithProrationPrice, + ReplacePricePriceNewSubscriptionGroupedAllocationPrice, + ReplacePricePriceNewSubscriptionGroupedWithProratedMinimumPrice, + ReplacePricePriceNewSubscriptionBulkWithProrationPrice, + ReplacePricePriceNewSubscriptionScalableMatrixWithUnitPricingPrice, + ReplacePricePriceNewSubscriptionScalableMatrixWithTieredPricingPrice, + ReplacePricePriceNewSubscriptionCumulativeGroupedBulkPrice, + ReplacePricePriceNewSubscriptionMaxGroupTieredPackagePrice, + ReplacePricePriceNewSubscriptionGroupedWithMeteredMinimumPrice, + ReplacePricePriceNewSubscriptionMatrixWithDisplayNamePrice, + ReplacePricePriceNewSubscriptionGroupedTieredPackagePrice, +] + + +class ReplacePrice(TypedDict, total=False): + replaces_price_id: Required[str] + """The id of the price on the plan to replace in the subscription.""" + + allocation_price: Optional[ReplacePriceAllocationPrice] + """The definition of a new allocation price to create and add to the subscription.""" + + discounts: Optional[Iterable[ReplacePriceDiscount]] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's discounts for the replacement price. + """ + + external_price_id: Optional[str] + """The external price id of the price to add to the subscription.""" + + fixed_price_quantity: Optional[float] + """The new quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's maximum amount for the replacement price. + """ + + minimum_amount: Optional[str] + """[DEPRECATED] Use add_adjustments instead. + + The subscription's minimum amount for the replacement price. + """ + + price: Optional[ReplacePricePrice] + """The definition of a new price to create and add to the subscription.""" + + price_id: Optional[str] + """The id of the price to add to the subscription."""