inttegro.price
Models, requests, and enums for the Inttegro price resource.
The primary returned object is inttegro.price.Price. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK.
1"""Models, requests, and enums for the Inttegro price resource. 2 3The primary returned object is ``inttegro.price.Price``. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK.""" 4 5from importlib import import_module 6from typing import TYPE_CHECKING, Any 7 8if TYPE_CHECKING: 9 from .action_request import ActionRequest as ActionRequest 10 from .embedded_product import EmbeddedProduct as EmbeddedProduct 11 from .embedded_product_attributes_item import EmbeddedProductAttributesItem as EmbeddedProductAttributesItem 12 from .customer_selected_amount import CustomerSelectedAmount as CustomerSelectedAmount 13 from .customer_selected_amount_params import CustomerSelectedAmountParams as CustomerSelectedAmountParams 14 from .inline import Inline as Inline 15 from .inline_params import InlineParams as InlineParams 16 from .lookup_request import LookupRequest as LookupRequest 17 from .page import Page as Page 18 from .page_item import PageItem as PageItem 19 from .page_request import PageRequest as PageRequest 20 from .page_response import PageResponse as PageResponse 21 from .params import Params as Params 22 from .price import Price as Price 23 from .response import Response as Response 24 from .suggested_amount import SuggestedAmount as SuggestedAmount 25 from .suggested_amount_params import SuggestedAmountParams as SuggestedAmountParams 26 from .type import Type as Type 27 from .update_request import UpdateRequest as UpdateRequest 28 29 30_EXPORTS: dict[str, tuple[str, str]] = { 31 "ActionRequest": ("inttegro.price.action_request", "ActionRequest"), 32 "EmbeddedProduct": ("inttegro.price.embedded_product", "EmbeddedProduct"), 33 "EmbeddedProductAttributesItem": ("inttegro.price.embedded_product_attributes_item", "EmbeddedProductAttributesItem"), 34 "CustomerSelectedAmount": ("inttegro.price.customer_selected_amount", "CustomerSelectedAmount"), 35 "CustomerSelectedAmountParams": ("inttegro.price.customer_selected_amount_params", "CustomerSelectedAmountParams"), 36 "Inline": ("inttegro.price.inline", "Inline"), 37 "InlineParams": ("inttegro.price.inline_params", "InlineParams"), 38 "LookupRequest": ("inttegro.price.lookup_request", "LookupRequest"), 39 "Page": ("inttegro.price.page", "Page"), 40 "PageItem": ("inttegro.price.page_item", "PageItem"), 41 "PageRequest": ("inttegro.price.page_request", "PageRequest"), 42 "PageResponse": ("inttegro.price.page_response", "PageResponse"), 43 "Params": ("inttegro.price.params", "Params"), 44 "Price": ("inttegro.price.price", "Price"), 45 "Response": ("inttegro.price.response", "Response"), 46 "SuggestedAmount": ("inttegro.price.suggested_amount", "SuggestedAmount"), 47 "SuggestedAmountParams": ("inttegro.price.suggested_amount_params", "SuggestedAmountParams"), 48 "Type": ("inttegro.price.type", "Type"), 49 "UpdateRequest": ("inttegro.price.update_request", "UpdateRequest"), 50} 51 52__all__ = [ 53 "ActionRequest", 54 "EmbeddedProduct", 55 "EmbeddedProductAttributesItem", 56 "CustomerSelectedAmount", 57 "CustomerSelectedAmountParams", 58 "Inline", 59 "InlineParams", 60 "LookupRequest", 61 "Page", 62 "PageItem", 63 "PageRequest", 64 "PageResponse", 65 "Params", 66 "Price", 67 "Response", 68 "SuggestedAmount", 69 "SuggestedAmountParams", 70 "Type", 71 "UpdateRequest", 72] 73 74 75def __getattr__(name: str) -> Any: 76 """Load a public resource type on first access.""" 77 try: 78 module_name, attribute_name = _EXPORTS[name] 79 except KeyError: 80 raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None 81 value = getattr(import_module(module_name), attribute_name) 82 globals()[name] = value 83 return value
12@dataclass(frozen=True, slots=True, kw_only=True) 13class ActionRequest(ApiRequest): 14 """Parameters accepted by the action request operation. 15 16 This is an immutable, keyword-only request object. ``to_dict()`` uses 17 the documented wire names, omits fields left as ``UNSET``, serializes 18 string-backed enums by value, and requires timezone-aware datetimes. 19 20 API contract schema: ``PriceActionRequest``. 21 """ 22 price_id: str 23 """Price ID to perform the action on. Required. Python type: ``str``; wire name: ``price_id``; JSON type: string"""
Parameters accepted by the action request operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: PriceActionRequest.
Price ID to perform the action on. Required. Python type: str; wire name: price_id; JSON type: string
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 15class EmbeddedProduct(ApiModel): 16 """Typed embedded product data in the price resource namespace. 17 18 Instances are immutable API responses. ``from_dict()`` decodes nested 19 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 20 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 21 Fields not returned by the API remain absent and can still be queried 22 through mapping-style access. 23 24 API contract schema: ``PriceEmbeddedProduct``. 25 """ 26 id: str = field(init=False) 27 """Unique product identifier with prod_ prefix. Required. Python type: ``str``; wire name: ``id``; JSON type: string""" 28 about: str | None = field(init=False) 29 """Full product description. Optional; nullable. Python type: ``str | None``; wire name: ``about``; JSON type: string""" 30 active: bool = field(init=False) 31 """Whether product is published and available. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 32 archived_at: datetime | None = field(init=False) 33 """Archive timestamp (if archived). Optional; nullable. Python type: ``datetime | None``; wire name: ``archived_at``; JSON type: string (date-time)""" 34 attributes: list[PriceEmbeddedProductAttributesItem] | None = field(init=False) 35 """Product attributes. Optional; nullable. Python type: ``list[PriceEmbeddedProductAttributesItem] | None``; wire name: ``attributes``; JSON type: array of object values""" 36 category: str | None = field(init=False) 37 """Product category. Optional; nullable. Python type: ``str | None``; wire name: ``category``; JSON type: string""" 38 created_at: datetime = field(init=False) 39 """Product creation timestamp. Required. Python type: ``datetime``; wire name: ``created_at``; JSON type: string (date-time)""" 40 custom_data: CustomData | None = field(init=False) 41 """Merchant-defined string values attached to a resource. SDKs expose this as a semantic collection rather than a raw map. Optional; nullable. Python type: ``CustomData | None``; wire name: ``custom_data``; JSON type: object (CustomData)""" 42 description: str | None = field(init=False) 43 """Short description. Optional; nullable. Python type: ``str | None``; wire name: ``description``; JSON type: string""" 44 dimensions: ProductDimensions | None = field(init=False) 45 """Product dimensions and size metadata. Optional; nullable. Python type: ``ProductDimensions | None``; wire name: ``dimensions``; JSON type: object (ProductDimensions)""" 46 media: ProductMedia | None = field(init=False) 47 """Product media assets. Optional; nullable. Python type: ``ProductMedia | None``; wire name: ``media``; JSON type: object (ProductMedia)""" 48 name: str = field(init=False) 49 """Product name. Required. Python type: ``str``; wire name: ``name``; JSON type: string""" 50 published_at: datetime | None = field(init=False) 51 """When the product was published. Optional; nullable. Python type: ``datetime | None``; wire name: ``published_at``; JSON type: string (date-time)""" 52 reference: str | None = field(init=False) 53 """External reference or SKU. Optional; nullable. Python type: ``str | None``; wire name: ``reference``; JSON type: string""" 54 shipment: ProductShipment | None = field(init=False) 55 """Shipment and fulfillment details. Optional; nullable. Python type: ``ProductShipment | None``; wire name: ``shipment``; JSON type: object (ProductShipment)""" 56 tax_code: str | None = field(init=False) 57 """Tax classification code. Optional; nullable. Python type: ``str | None``; wire name: ``tax_code``; JSON type: string""" 58 type: Literal['physical', 'digital', 'service', 'voucher', 'custom', 'cause'] = field(init=False) 59 """Product type. Required. Python type: ``Literal['physical', 'digital', 'service', 'voucher', 'custom', 'cause']``; wire name: ``type``; JSON type: string. Constraints: allowed values ``physical``, ``digital``, ``service``, ``voucher``, ``custom``, ``cause``""" 60 unit_dim: str | None = field(init=False) 61 """Unit dimension label. Optional; nullable. Python type: ``str | None``; wire name: ``unit_dim``; JSON type: string""" 62 updated_at: datetime | None = field(init=False) 63 """Last update timestamp. Optional; nullable. Python type: ``datetime | None``; wire name: ``updated_at``; JSON type: string (date-time)"""
Typed embedded product data in the price resource namespace.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: PriceEmbeddedProduct.
Unique product identifier with prod_ prefix. Required. Python type: str; wire name: id; JSON type: string
Full product description. Optional; nullable. Python type: str | None; wire name: about; JSON type: string
Whether product is published and available. Required. Python type: bool; wire name: active; JSON type: boolean
Archive timestamp (if archived). Optional; nullable. Python type: datetime | None; wire name: archived_at; JSON type: string (date-time)
Product attributes. Optional; nullable. Python type: list[PriceEmbeddedProductAttributesItem] | None; wire name: attributes; JSON type: array of object values
Product category. Optional; nullable. Python type: str | None; wire name: category; JSON type: string
Product creation timestamp. Required. Python type: datetime; wire name: created_at; JSON type: string (date-time)
Merchant-defined string values attached to a resource. SDKs expose this as a semantic collection rather than a raw map. Optional; nullable. Python type: CustomData | None; wire name: custom_data; JSON type: object (CustomData)
Short description. Optional; nullable. Python type: str | None; wire name: description; JSON type: string
Product dimensions and size metadata. Optional; nullable. Python type: ProductDimensions | None; wire name: dimensions; JSON type: object (ProductDimensions)
Product media assets. Optional; nullable. Python type: ProductMedia | None; wire name: media; JSON type: object (ProductMedia)
When the product was published. Optional; nullable. Python type: datetime | None; wire name: published_at; JSON type: string (date-time)
External reference or SKU. Optional; nullable. Python type: str | None; wire name: reference; JSON type: string
Shipment and fulfillment details. Optional; nullable. Python type: ProductShipment | None; wire name: shipment; JSON type: object (ProductShipment)
Tax classification code. Optional; nullable. Python type: str | None; wire name: tax_code; JSON type: string
Product type. Required. Python type: Literal['physical', 'digital', 'service', 'voucher', 'custom', 'cause']; wire name: type; JSON type: string. Constraints: allowed values physical, digital, service, voucher, custom, cause
Unit dimension label. Optional; nullable. Python type: str | None; wire name: unit_dim; JSON type: string
Last update timestamp. Optional; nullable. Python type: datetime | None; wire name: updated_at; JSON type: string (date-time)
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class EmbeddedProductAttributesItem(ApiModel): 14 """Typed embedded product attributes item data in the price resource namespace. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``PriceEmbeddedProductAttributesItem``. 23 """ 24 name: str = field(init=False) 25 """Attribute name. Required. Python type: ``str``; wire name: ``name``; JSON type: string""" 26 value: str = field(init=False) 27 """Attribute value. Required. Python type: ``str``; wire name: ``value``; JSON type: string"""
Typed embedded product attributes item data in the price resource namespace.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: PriceEmbeddedProductAttributesItem.
13@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 14class CustomerSelectedAmount(ApiModel): 15 """Persisted currency, range, and suggestions for a selected amount.""" 16 17 currency: Currency = field(init=False) 18 minimum: int = field(init=False) 19 maximum: int | None = field(init=False) 20 suggested_amounts: list[SuggestedAmount] | None = field(init=False)
Persisted currency, range, and suggestions for a selected amount.
13@dataclass(frozen=True, slots=True, kw_only=True) 14class CustomerSelectedAmountParams(ApiRequest): 15 """Currency, range, and optional conveniences for a selected amount.""" 16 17 currency: Currency 18 minimum: int 19 maximum: int | UnsetType = field(default=UNSET) 20 suggested_amounts: list[SuggestedAmountParams] | UnsetType = field(default=UNSET)
Currency, range, and optional conveniences for a selected amount.
9@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 10class Inline(Amount): 11 """A currency amount embedded directly in another API resource. 12 13 This response type has the same ``currency`` and integer minor-unit 14 ``value`` semantics as :class:`inttegro.money.Amount`. It is named 15 ``Inline`` to distinguish embedded money from the catalog 16 :class:`inttegro.price.Price` resource. 17 """
A currency amount embedded directly in another API resource.
This response type has the same currency and integer minor-unit
value semantics as inttegro.money.Amount. It is named
Inline to distinguish embedded money from the catalog
inttegro.price.Price resource.
Inherited Members
9@dataclass(frozen=True, slots=True, kw_only=True) 10class InlineParams(AmountParams): 11 """A currency amount supplied inline in another request. 12 13 Use this type where an operation accepts price data directly rather than a 14 ``price_id`` referencing :class:`inttegro.price.Price`. ``value`` is an 15 integer minor-unit amount, such as ``5000`` for GHS 50.00. 16 """
A currency amount supplied inline in another request.
Use this type where an operation accepts price data directly rather than a
price_id referencing inttegro.price.Price. value is an
integer minor-unit amount, such as 5000 for GHS 50.00.
Inherited Members
12@dataclass(frozen=True, slots=True, kw_only=True) 13class LookupRequest(ApiRequest): 14 """Parameters accepted by the lookup request operation. 15 16 This is an immutable, keyword-only request object. ``to_dict()`` uses 17 the documented wire names, omits fields left as ``UNSET``, serializes 18 string-backed enums by value, and requires timezone-aware datetimes. 19 20 API contract schema: ``LookupPriceRequest``. 21 """ 22 price_id: str 23 """Price ID to perform the action on. Required. Python type: ``str``; wire name: ``price_id``; JSON type: string"""
Parameters accepted by the lookup request operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: LookupPriceRequest.
Price ID to perform the action on. Required. Python type: str; wire name: price_id; JSON type: string
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Page(ApiModel): 14 """One page of page resources. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``PricePage``. 23 """ 24 number: int | None = field(init=False) 25 """The page number returned. Optional; nullable. Python type: ``int | None``; wire name: ``number``; JSON type: integer""" 26 size: int | None = field(init=False) 27 """The number of prices in this page. Optional; nullable. Python type: ``int | None``; wire name: ``size``; JSON type: integer""" 28 prices: list[PricePageItem] | None = field(init=False) 29 """The prices associated with this page. Optional; nullable. Python type: ``list[PricePageItem] | None``; wire name: ``prices``; JSON type: array of object (PricePageItem) values"""
One page of page resources.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: PricePage.
The page number returned. Optional; nullable. Python type: int | None; wire name: number; JSON type: integer
The number of prices in this page. Optional; nullable. Python type: int | None; wire name: size; JSON type: integer
12@dataclass(frozen=True, slots=True, kw_only=True) 13class PageRequest(ApiRequest): 14 """Parameters accepted by the page request operation. 15 16 This is an immutable, keyword-only request object. ``to_dict()`` uses 17 the documented wire names, omits fields left as ``UNSET``, serializes 18 string-backed enums by value, and requires timezone-aware datetimes. 19 20 API contract schema: ``PricePageRequest``. 21 """ 22 page_number: int | UnsetType = field(default=UNSET) 23 """Page index to fetch. Omit it or send 0 to request page 1; otherwise use 1 through 10. Optional. Python type: ``int``; wire name: ``page_number``; JSON type: integer. Constraints: minimum 0; maximum 10""" 24 page_size: int | UnsetType = field(default=UNSET) 25 """Number of prices per page (1-256). Optional. Python type: ``int``; wire name: ``page_size``; JSON type: integer. Constraints: minimum 1; maximum 256""" 26 product_id: str | UnsetType = field(default=UNSET) 27 """Optional product ID to scope the page to a single product. Optional. Python type: ``str``; wire name: ``product_id``; JSON type: string"""
Parameters accepted by the page request operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: PricePageRequest.
Page index to fetch. Omit it or send 0 to request page 1; otherwise use 1 through 10. Optional. Python type: int; wire name: page_number; JSON type: integer. Constraints: minimum 0; maximum 10
Number of prices per page (1-256). Optional. Python type: int; wire name: page_size; JSON type: integer. Constraints: minimum 1; maximum 256
Optional product ID to scope the page to a single product. Optional. Python type: str; wire name: product_id; JSON type: string
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class PageResponse(ApiModel): 14 """Typed response returned by the page operation. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``PricePageResponse``. 23 """ 24 page: PricePage | None = field(init=False) 25 """Numeric page used by this operation. Optional; nullable. Python type: ``PricePage | None``; wire name: ``page``; JSON type: object""" 26 error: Error | None = field(init=False) 27 """Standard error response structure returned by all API endpoints. Provides machine-readable codes, human-readable messages, and actionable guidance for resolution. Optional; nullable. Python type: ``Error | None``; wire name: ``error``; JSON type: object (Error)"""
Typed response returned by the page operation.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: PricePageResponse.
Numeric page used by this operation. Optional; nullable. Python type: PricePage | None; wire name: page; JSON type: object
Standard error response structure returned by all API endpoints. Provides machine-readable codes, human-readable messages, and actionable guidance for resolution. Optional; nullable. Python type: Error | None; wire name: error; JSON type: object (Error)
15@dataclass(frozen=True, slots=True, kw_only=True) 16class Params(ApiRequest): 17 """Parameters accepted by the params operation. 18 19 This is an immutable, keyword-only request object. ``to_dict()`` uses 20 the documented wire names, omits fields left as ``UNSET``, serializes 21 string-backed enums by value, and requires timezone-aware datetimes. 22 23 API contract schema: ``CatalogPriceParams``. 24 """ 25 product_id: str | UnsetType = field(default=UNSET) 26 """Product ID to associate with the price. Optional for fixed prices, required for customer-selected prices, and immutable once set. Python type: ``str``; wire name: ``product_id``; JSON type: string""" 27 label: str | UnsetType = field(default=UNSET) 28 """Short label for this price (max 100 characters). Optional. Python type: ``str``; wire name: ``label``; JSON type: string""" 29 about: str | UnsetType = field(default=UNSET) 30 """Longer description of this price (max 500 characters). Optional. Python type: ``str``; wire name: ``about``; JSON type: string""" 31 type: Type | UnsetType = field(default=UNSET) 32 """Price definition discriminator. Required by the tagged definition. Python type: ``Type``; wire name: ``type``; JSON type: string (PriceType)""" 33 fixed_amount: AmountParams | UnsetType = field(default=UNSET) 34 """Fixed price amount. Required when ``type`` is ``fixed_amount``. Python type: ``AmountParams``; wire name: ``fixed_amount``; JSON type: object (AmountParams)""" 35 customer_selected_amount: CustomerSelectedAmountParams | UnsetType = field(default=UNSET) 36 """Customer-selected price policy. Required when ``type`` is ``customer_selected_amount``. Python type: ``CustomerSelectedAmountParams``; wire name: ``customer_selected_amount``; JSON type: object (CustomerSelectedAmountParams)""" 37 38 def __post_init__(self) -> None: 39 fixed = ( 40 self.type == Type.FIXED_AMOUNT 41 and self.fixed_amount is not UNSET 42 and self.customer_selected_amount is UNSET 43 ) 44 selected = ( 45 self.type == Type.CUSTOMER_SELECTED_AMOUNT 46 and self.customer_selected_amount is not UNSET 47 and self.fixed_amount is UNSET 48 and self.product_id is not UNSET 49 and bool(self.product_id) 50 ) 51 if sum((fixed, selected)) != 1: 52 raise ValueError("provide exactly one valid catalog price definition")
Parameters accepted by the params operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: CatalogPriceParams.
Product ID to associate with the price. Optional for fixed prices, required for customer-selected prices, and immutable once set. Python type: str; wire name: product_id; JSON type: string
Short label for this price (max 100 characters). Optional. Python type: str; wire name: label; JSON type: string
Longer description of this price (max 500 characters). Optional. Python type: str; wire name: about; JSON type: string
Fixed price amount. Required when type is fixed_amount. Python type: AmountParams; wire name: fixed_amount; JSON type: object (AmountParams)
Customer-selected price policy. Required when type is customer_selected_amount. Python type: CustomerSelectedAmountParams; wire name: customer_selected_amount; JSON type: object (CustomerSelectedAmountParams)
16@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 17class Price(ApiModel): 18 """Typed price data in the price resource namespace. 19 20 Instances are immutable API responses. ``from_dict()`` decodes nested 21 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 22 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 23 Fields not returned by the API remain absent and can still be queried 24 through mapping-style access. 25 26 API contract schema: ``CatalogPrice``. 27 """ 28 id: str = field(init=False) 29 """Unique price identifier with pr_ prefix. Required. Python type: ``str``; wire name: ``id``; JSON type: string""" 30 label: str | None = field(init=False) 31 """Short label for this price. Optional; nullable. Python type: ``str | None``; wire name: ``label``; JSON type: string""" 32 about: str | None = field(init=False) 33 """Longer description of this price. Optional; nullable. Python type: ``str | None``; wire name: ``about``; JSON type: string""" 34 active: bool = field(init=False) 35 """Whether this price is active and usable in new flows. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 36 type: Type = field(init=False) 37 """Price definition discriminator. Required. Python type: ``Type``; wire name: ``type``; JSON type: string (PriceType)""" 38 fixed_amount: Amount | None = field(init=False) 39 """Fixed amount present only for fixed prices. Python type: ``Amount | None``; wire name: ``fixed_amount``; JSON type: object (Amount)""" 40 customer_selected_amount: CustomerSelectedAmount | None = field(init=False) 41 """Selection policy present only for customer-selected prices. Python type: ``CustomerSelectedAmount | None``; wire name: ``customer_selected_amount``; JSON type: object (CustomerSelectedAmount)""" 42 product_id: str | None = field(init=False) 43 """Product ID when the operation returns the relationship by reference. Optional; nullable. Python type: ``str | None``; wire name: ``product_id``; JSON type: string""" 44 product: PriceEmbeddedProduct | None = field(init=False) 45 """Embedded product details, if this price belongs to a product. Optional; nullable. Python type: ``PriceEmbeddedProduct | None``; wire name: ``product``; JSON type: object (PriceEmbeddedProduct)""" 46 created_at: datetime = field(init=False) 47 """Price creation timestamp. Required. Python type: ``datetime``; wire name: ``created_at``; JSON type: string (date-time)""" 48 updated_at: datetime | None = field(init=False) 49 """Last update timestamp. Optional; nullable. Python type: ``datetime | None``; wire name: ``updated_at``; JSON type: string (date-time)""" 50 archived_at: datetime | None = field(init=False) 51 """Archive timestamp (if archived). Optional; nullable. Python type: ``datetime | None``; wire name: ``archived_at``; JSON type: string (date-time)"""
Typed price data in the price resource namespace.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: CatalogPrice.
Unique price identifier with pr_ prefix. Required. Python type: str; wire name: id; JSON type: string
Short label for this price. Optional; nullable. Python type: str | None; wire name: label; JSON type: string
Longer description of this price. Optional; nullable. Python type: str | None; wire name: about; JSON type: string
Whether this price is active and usable in new flows. Required. Python type: bool; wire name: active; JSON type: boolean
Fixed amount present only for fixed prices. Python type: Amount | None; wire name: fixed_amount; JSON type: object (Amount)
Selection policy present only for customer-selected prices. Python type: CustomerSelectedAmount | None; wire name: customer_selected_amount; JSON type: object (CustomerSelectedAmount)
Product ID when the operation returns the relationship by reference. Optional; nullable. Python type: str | None; wire name: product_id; JSON type: string
Embedded product details, if this price belongs to a product. Optional; nullable. Python type: PriceEmbeddedProduct | None; wire name: product; JSON type: object (PriceEmbeddedProduct)
Price creation timestamp. Required. Python type: datetime; wire name: created_at; JSON type: string (date-time)
Last update timestamp. Optional; nullable. Python type: datetime | None; wire name: updated_at; JSON type: string (date-time)
Archive timestamp (if archived). Optional; nullable. Python type: datetime | None; wire name: archived_at; JSON type: string (date-time)
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Response(ApiModel): 14 """Typed response returned by the response operation. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``PriceResponse``. 23 """ 24 price: CatalogPrice | None = field(init=False) 25 """The price associated with this response. Optional; nullable. Python type: ``CatalogPrice | None``; wire name: ``price``; JSON type: object (CatalogPrice)""" 26 error: Error | None = field(init=False) 27 """Standard error response structure returned by all API endpoints. Provides machine-readable codes, human-readable messages, and actionable guidance for resolution. Optional; nullable. Python type: ``Error | None``; wire name: ``error``; JSON type: object (Error)"""
Typed response returned by the response operation.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: PriceResponse.
The price associated with this response. Optional; nullable. Python type: CatalogPrice | None; wire name: price; JSON type: object (CatalogPrice)
Standard error response structure returned by all API endpoints. Provides machine-readable codes, human-readable messages, and actionable guidance for resolution. Optional; nullable. Python type: Error | None; wire name: error; JSON type: object (Error)
11@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 12class SuggestedAmount(ApiModel): 13 """A convenient amount choice returned with a catalog price.""" 14 15 id: str = field(init=False) 16 value: int = field(init=False) 17 recommended: bool | None = field(init=False)
A convenient amount choice returned with a catalog price.
11@dataclass(frozen=True, slots=True, kw_only=True) 12class SuggestedAmountParams(ApiRequest): 13 """A convenient amount choice; suggestions do not restrict valid amounts.""" 14 15 id: str 16 value: int 17 recommended: bool | UnsetType = field(default=UNSET)
A convenient amount choice; suggestions do not restrict valid amounts.
9class Type(WireEnum): 10 """Definition carried by a catalog price.""" 11 12 FIXED_AMOUNT = "fixed_amount" 13 CUSTOMER_SELECTED_AMOUNT = "customer_selected_amount"
Definition carried by a catalog price.
12@dataclass(frozen=True, slots=True, kw_only=True) 13class UpdateRequest(ApiRequest): 14 """Parameters accepted by the update request operation. 15 16 This is an immutable, keyword-only request object. ``to_dict()`` uses 17 the documented wire names, omits fields left as ``UNSET``, serializes 18 string-backed enums by value, and requires timezone-aware datetimes. 19 20 API contract schema: ``UpdatePriceRequest``. 21 """ 22 label: str | UnsetType = field(default=UNSET) 23 """Optional short label for the new price. Optional. Python type: ``str``; wire name: ``label``; JSON type: string. Constraints: maximum length 100""" 24 about: str | UnsetType = field(default=UNSET) 25 """Optional internal description for the new price. Optional. Python type: ``str``; wire name: ``about``; JSON type: string. Constraints: maximum length 500""" 26 price_id: str 27 """Identifier of the related price. Required. Python type: ``str``; wire name: ``price_id``; JSON type: string"""
Parameters accepted by the update request operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: UpdatePriceRequest.
Optional short label for the new price. Optional. Python type: str; wire name: label; JSON type: string. Constraints: maximum length 100
Optional internal description for the new price. Optional. Python type: str; wire name: about; JSON type: string. Constraints: maximum length 500
Identifier of the related price. Required. Python type: str; wire name: price_id; JSON type: string