inttegro.purchase_intent
Models, requests, and enums for the Inttegro purchase intent resource.
The primary returned object is inttegro.purchase_intent.PurchaseIntent. 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 purchase intent resource. 2 3The primary returned object is ``inttegro.purchase_intent.PurchaseIntent``. 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 .cancel_request import CancelRequest as CancelRequest 10 from .create_request import CreateRequest as CreateRequest 11 from .create_request_presentation import CreateRequestPresentation as CreateRequestPresentation 12 from .create_request_presentation_buy_page import CreateRequestPresentationBuyPage as CreateRequestPresentationBuyPage 13 from .create_request_presentation_buy_page_text import CreateRequestPresentationBuyPageText as CreateRequestPresentationBuyPageText 14 from .create_request_price import CreateRequestPrice as CreateRequestPrice 15 from .create_request_price_original import CreateRequestPriceOriginal as CreateRequestPriceOriginal 16 from .create_request_product import CreateRequestProduct as CreateRequestProduct 17 from .create_request_quantity import CreateRequestQuantity as CreateRequestQuantity 18 from .create_request_usage import CreateRequestUsage as CreateRequestUsage 19 from .lookup_request import LookupRequest as LookupRequest 20 from .merchant import Merchant as Merchant 21 from .original_price import OriginalPrice as OriginalPrice 22 from .page import Page as Page 23 from .page_request import PageRequest as PageRequest 24 from .page_response import PageResponse as PageResponse 25 from .price import Price as Price 26 from .presentation import Presentation as Presentation 27 from .presentation_buy_page import PresentationBuyPage as PresentationBuyPage 28 from .presentation_buy_page_text import PresentationBuyPageText as PresentationBuyPageText 29 from .product import Product as Product 30 from .product_attributes_item import ProductAttributesItem as ProductAttributesItem 31 from .purchase_intent import PurchaseIntent as PurchaseIntent 32 from .quantity import Quantity as Quantity 33 from .response import Response as Response 34 from .status import Status as Status 35 from .update_request import UpdateRequest as UpdateRequest 36 from .update_request_presentation import UpdateRequestPresentation as UpdateRequestPresentation 37 from .update_request_presentation_buy_page import UpdateRequestPresentationBuyPage as UpdateRequestPresentationBuyPage 38 from .update_request_presentation_buy_page_text import UpdateRequestPresentationBuyPageText as UpdateRequestPresentationBuyPageText 39 from .update_request_quantity import UpdateRequestQuantity as UpdateRequestQuantity 40 from .usage import Usage as Usage 41 from .usage_order import UsageOrder as UsageOrder 42 from .variant import Variant as Variant 43 from .variant_axis import VariantAxis as VariantAxis 44 from .variant_set import VariantSet as VariantSet 45 46 47_EXPORTS: dict[str, tuple[str, str]] = { 48 "CancelRequest": ("inttegro.purchase_intent.cancel_request", "CancelRequest"), 49 "CreateRequest": ("inttegro.purchase_intent.create_request", "CreateRequest"), 50 "CreateRequestPresentation": ("inttegro.purchase_intent.create_request_presentation", "CreateRequestPresentation"), 51 "CreateRequestPresentationBuyPage": ("inttegro.purchase_intent.create_request_presentation_buy_page", "CreateRequestPresentationBuyPage"), 52 "CreateRequestPresentationBuyPageText": ("inttegro.purchase_intent.create_request_presentation_buy_page_text", "CreateRequestPresentationBuyPageText"), 53 "CreateRequestPrice": ("inttegro.purchase_intent.create_request_price", "CreateRequestPrice"), 54 "CreateRequestPriceOriginal": ("inttegro.purchase_intent.create_request_price_original", "CreateRequestPriceOriginal"), 55 "CreateRequestProduct": ("inttegro.purchase_intent.create_request_product", "CreateRequestProduct"), 56 "CreateRequestQuantity": ("inttegro.purchase_intent.create_request_quantity", "CreateRequestQuantity"), 57 "CreateRequestUsage": ("inttegro.purchase_intent.create_request_usage", "CreateRequestUsage"), 58 "LookupRequest": ("inttegro.purchase_intent.lookup_request", "LookupRequest"), 59 "Merchant": ("inttegro.purchase_intent.merchant", "Merchant"), 60 "OriginalPrice": ("inttegro.purchase_intent.original_price", "OriginalPrice"), 61 "Page": ("inttegro.purchase_intent.page", "Page"), 62 "PageRequest": ("inttegro.purchase_intent.page_request", "PageRequest"), 63 "PageResponse": ("inttegro.purchase_intent.page_response", "PageResponse"), 64 "Price": ("inttegro.purchase_intent.price", "Price"), 65 "Presentation": ("inttegro.purchase_intent.presentation", "Presentation"), 66 "PresentationBuyPage": ("inttegro.purchase_intent.presentation_buy_page", "PresentationBuyPage"), 67 "PresentationBuyPageText": ("inttegro.purchase_intent.presentation_buy_page_text", "PresentationBuyPageText"), 68 "Product": ("inttegro.purchase_intent.product", "Product"), 69 "ProductAttributesItem": ("inttegro.purchase_intent.product_attributes_item", "ProductAttributesItem"), 70 "PurchaseIntent": ("inttegro.purchase_intent.purchase_intent", "PurchaseIntent"), 71 "Quantity": ("inttegro.purchase_intent.quantity", "Quantity"), 72 "Response": ("inttegro.purchase_intent.response", "Response"), 73 "Status": ("inttegro.purchase_intent.status", "Status"), 74 "UpdateRequest": ("inttegro.purchase_intent.update_request", "UpdateRequest"), 75 "UpdateRequestPresentation": ("inttegro.purchase_intent.update_request_presentation", "UpdateRequestPresentation"), 76 "UpdateRequestPresentationBuyPage": ("inttegro.purchase_intent.update_request_presentation_buy_page", "UpdateRequestPresentationBuyPage"), 77 "UpdateRequestPresentationBuyPageText": ("inttegro.purchase_intent.update_request_presentation_buy_page_text", "UpdateRequestPresentationBuyPageText"), 78 "UpdateRequestQuantity": ("inttegro.purchase_intent.update_request_quantity", "UpdateRequestQuantity"), 79 "Usage": ("inttegro.purchase_intent.usage", "Usage"), 80 "UsageOrder": ("inttegro.purchase_intent.usage_order", "UsageOrder"), 81 "Variant": ("inttegro.purchase_intent.variant", "Variant"), 82 "VariantAxis": ("inttegro.purchase_intent.variant_axis", "VariantAxis"), 83 "VariantSet": ("inttegro.purchase_intent.variant_set", "VariantSet"), 84} 85 86__all__ = [ 87 "CancelRequest", 88 "CreateRequest", 89 "CreateRequestPresentation", 90 "CreateRequestPresentationBuyPage", 91 "CreateRequestPresentationBuyPageText", 92 "CreateRequestPrice", 93 "CreateRequestPriceOriginal", 94 "CreateRequestProduct", 95 "CreateRequestQuantity", 96 "CreateRequestUsage", 97 "LookupRequest", 98 "Merchant", 99 "OriginalPrice", 100 "Page", 101 "PageRequest", 102 "PageResponse", 103 "Price", 104 "Presentation", 105 "PresentationBuyPage", 106 "PresentationBuyPageText", 107 "Product", 108 "ProductAttributesItem", 109 "PurchaseIntent", 110 "Quantity", 111 "Response", 112 "Status", 113 "UpdateRequest", 114 "UpdateRequestPresentation", 115 "UpdateRequestPresentationBuyPage", 116 "UpdateRequestPresentationBuyPageText", 117 "UpdateRequestQuantity", 118 "Usage", 119 "UsageOrder", 120 "Variant", 121 "VariantAxis", 122 "VariantSet", 123] 124 125 126def __getattr__(name: str) -> Any: 127 """Load a public resource type on first access.""" 128 try: 129 module_name, attribute_name = _EXPORTS[name] 130 except KeyError: 131 raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None 132 value = getattr(import_module(module_name), attribute_name) 133 globals()[name] = value 134 return value
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CancelRequest(ApiRequest): 14 """Parameters accepted by the cancel 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: ``CancelPurchaseIntentRequest``. 21 """ 22 id: str | UnsetType = field(default=UNSET) 23 """Purchase intent ID to cancel. Send this or purchase_intent_id. Optional. Python type: ``str``; wire name: ``id``; JSON type: string. Constraints: minimum length 1""" 24 purchase_intent_id: str | UnsetType = field(default=UNSET) 25 """Alias for id. If both are present, this value takes precedence. Optional. Python type: ``str``; wire name: ``purchase_intent_id``; JSON type: string. Constraints: minimum length 1"""
Parameters accepted by the cancel 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: CancelPurchaseIntentRequest.
Purchase intent ID to cancel. Send this or purchase_intent_id. Optional. Python type: str; wire name: id; JSON type: string. Constraints: minimum length 1
Alias for id. If both are present, this value takes precedence. Optional. Python type: str; wire name: purchase_intent_id; JSON type: string. Constraints: minimum length 1
13@dataclass(frozen=True, slots=True, kw_only=True) 14class CreateRequest(ApiRequest): 15 """Parameters accepted by the create request operation. 16 17 This is an immutable, keyword-only request object. ``to_dict()`` uses 18 the documented wire names, omits fields left as ``UNSET``, serializes 19 string-backed enums by value, and requires timezone-aware datetimes. 20 21 API contract schema: ``CreatePurchaseIntentRequest``. 22 """ 23 product: CreatePurchaseIntentRequestProduct | UnsetType = field(default=UNSET) 24 """Product selection with optional variant-set configuration. Use this instead of product_id. Optional. Python type: ``CreatePurchaseIntentRequestProduct``; wire name: ``product``; JSON type: object""" 25 product_id: str | UnsetType = field(default=UNSET) 26 """App-owned product ID to sell through the Buy link when not using product. Optional. Python type: ``str``; wire name: ``product_id``; JSON type: string""" 27 price: CreatePurchaseIntentRequestPrice | UnsetType = field(default=UNSET) 28 """Price selection for the Buy link. Send exactly one of id or nominal and at most one of original or original_id. Optional. Python type: ``CreatePurchaseIntentRequestPrice``; wire name: ``price``; JSON type: object""" 29 price_id: str | UnsetType = field(default=UNSET) 30 """Active, unarchived app-owned price ID that belongs to the selected product. Optional. Python type: ``str``; wire name: ``price_id``; JSON type: string""" 31 usage: CreatePurchaseIntentRequestUsage | UnsetType = field(default=UNSET) 32 """Optional link-use policy. Omit to create a reusable Buy link. Optional. Python type: ``CreatePurchaseIntentRequestUsage``; wire name: ``usage``; JSON type: object""" 33 expires_at: datetime | UnsetType = field(default=UNSET) 34 """Future RFC3339 timestamp after which the Buy link stops accepting purchases. Optional. Python type: ``datetime``; wire name: ``expires_at``; JSON type: string (date-time)""" 35 presentation: CreatePurchaseIntentRequestPresentation | UnsetType = field(default=UNSET) 36 """Optional merchant-authored copy for the hosted Buy page. Optional. Python type: ``CreatePurchaseIntentRequestPresentation``; wire name: ``presentation``; JSON type: object""" 37 quantity: CreatePurchaseIntentRequestQuantity 38 """Quantity bounds the Buy link should enforce. Omit max when the Buy link has no upper quantity bound. When present, max must be greater than or equal to min. Required. Python type: ``CreatePurchaseIntentRequestQuantity``; wire name: ``quantity``; JSON type: object"""
Parameters accepted by the create 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: CreatePurchaseIntentRequest.
Product selection with optional variant-set configuration. Use this instead of product_id. Optional. Python type: CreatePurchaseIntentRequestProduct; wire name: product; JSON type: object
App-owned product ID to sell through the Buy link when not using product. Optional. Python type: str; wire name: product_id; JSON type: string
Price selection for the Buy link. Send exactly one of id or nominal and at most one of original or original_id. Optional. Python type: CreatePurchaseIntentRequestPrice; wire name: price; JSON type: object
Active, unarchived app-owned price ID that belongs to the selected product. Optional. Python type: str; wire name: price_id; JSON type: string
Optional link-use policy. Omit to create a reusable Buy link. Optional. Python type: CreatePurchaseIntentRequestUsage; wire name: usage; JSON type: object
Future RFC3339 timestamp after which the Buy link stops accepting purchases. Optional. Python type: datetime; wire name: expires_at; JSON type: string (date-time)
Optional merchant-authored copy for the hosted Buy page. Optional. Python type: CreatePurchaseIntentRequestPresentation; wire name: presentation; JSON type: object
Quantity bounds the Buy link should enforce. Omit max when the Buy link has no upper quantity bound. When present, max must be greater than or equal to min. Required. Python type: CreatePurchaseIntentRequestQuantity; wire name: quantity; JSON type: object
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CreateRequestPresentation(ApiRequest): 14 """Customer-facing presentation settings for a new purchase intent.""" 15 16 buy_page: CreateRequestPresentationBuyPage
Customer-facing presentation settings for a new purchase intent.
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CreateRequestPresentationBuyPage(ApiRequest): 14 """Presentation settings for the hosted Buy page.""" 15 16 text: CreateRequestPresentationBuyPageText
Presentation settings for the hosted Buy page.
9@dataclass(frozen=True, slots=True, kw_only=True) 10class CreateRequestPresentationBuyPageText(ApiRequest): 11 """Optional text overrides for a new hosted Buy page.""" 12 13 checkout_section_title: str | UnsetType = field(default=UNSET) 14 amount_field_label: str | UnsetType = field(default=UNSET) 15 primary_action_label: str | UnsetType = field(default=UNSET)
Optional text overrides for a new hosted Buy page.
13@dataclass(frozen=True, slots=True, kw_only=True) 14class CreateRequestPrice(ApiRequest): 15 """Price selection for the Buy link. Send exactly one of id or nominal and at most one of original or original_id. 16 17 This is an immutable, keyword-only request object. ``to_dict()`` uses 18 the documented wire names, omits fields left as ``UNSET``, serializes 19 string-backed enums by value, and requires timezone-aware datetimes. 20 21 API contract schema: ``CreatePurchaseIntentRequestPrice``. 22 """ 23 id: str | UnsetType = field(default=UNSET) 24 """Active, unarchived app-owned price ID that belongs to the selected product. Optional. Python type: ``str``; wire name: ``id``; JSON type: string""" 25 nominal: PriceParams | UnsetType = field(default=UNSET) 26 """Inline offer amount when no price ID is provided. Optional. Python type: ``PriceParams``; wire name: ``nominal``; JSON type: object (PriceParams)""" 27 original: CreatePurchaseIntentRequestPriceOriginal | UnsetType = field(default=UNSET) 28 """Optional original price used for comparison display. Optional. Python type: ``CreatePurchaseIntentRequestPriceOriginal``; wire name: ``original``; JSON type: object""" 29 original_id: str | UnsetType = field(default=UNSET) 30 """App-owned comparison price ID when not using original.id. Optional. Python type: ``str``; wire name: ``original_id``; JSON type: string"""
Price selection for the Buy link. Send exactly one of id or nominal and at most one of original or original_id.
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: CreatePurchaseIntentRequestPrice.
Active, unarchived app-owned price ID that belongs to the selected product. Optional. Python type: str; wire name: id; JSON type: string
Inline offer amount when no price ID is provided. Optional. Python type: PriceParams; wire name: nominal; JSON type: object (PriceParams)
Optional original price used for comparison display. Optional. Python type: CreatePurchaseIntentRequestPriceOriginal; wire name: original; JSON type: object
App-owned comparison price ID when not using original.id. Optional. Python type: str; wire name: original_id; JSON type: string
13@dataclass(frozen=True, slots=True, kw_only=True) 14class CreateRequestPriceOriginal(ApiRequest): 15 """Optional original price used for comparison display. 16 17 This is an immutable, keyword-only request object. ``to_dict()`` uses 18 the documented wire names, omits fields left as ``UNSET``, serializes 19 string-backed enums by value, and requires timezone-aware datetimes. 20 21 API contract schema: ``CreatePurchaseIntentRequestPriceOriginal``. 22 """ 23 id: str | UnsetType = field(default=UNSET) 24 """App-owned comparison price ID that belongs to the selected product. Optional. Python type: ``str``; wire name: ``id``; JSON type: string""" 25 nominal: PriceParams | UnsetType = field(default=UNSET) 26 """Inline original price amount. Optional. Python type: ``PriceParams``; wire name: ``nominal``; JSON type: object (PriceParams)"""
Optional original price used for comparison display.
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: CreatePurchaseIntentRequestPriceOriginal.
App-owned comparison price ID that belongs to the selected product. Optional. Python type: str; wire name: id; JSON type: string
Inline original price amount. Optional. Python type: PriceParams; wire name: nominal; JSON type: object (PriceParams)
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CreateRequestProduct(ApiRequest): 14 """Product selection with optional variant-set configuration. Use this instead of product_id. 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: ``CreatePurchaseIntentRequestProduct``. 21 """ 22 variant_set_id: str | UnsetType = field(default=UNSET) 23 """Optional variant set ID the hosted checkout may use for sibling product selection. Optional. Python type: ``str``; wire name: ``variant_set_id``; JSON type: string""" 24 id: str 25 """Product ID to sell through the Buy link. Required. Python type: ``str``; wire name: ``id``; JSON type: string"""
Product selection with optional variant-set configuration. Use this instead of product_id.
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: CreatePurchaseIntentRequestProduct.
Optional variant set ID the hosted checkout may use for sibling product selection. Optional. Python type: str; wire name: variant_set_id; JSON type: string
Product ID to sell through the Buy link. Required. Python type: str; wire name: id; JSON type: string
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CreateRequestQuantity(ApiRequest): 14 """Quantity bounds the Buy link should enforce. Omit max when the Buy link has no upper quantity bound. When present, max must be greater than or equal to min. 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: ``CreatePurchaseIntentRequestQuantity``. 21 """ 22 max: int | UnsetType = field(default=UNSET) 23 """Optional maximum quantity the customer can buy. It must be greater than or equal to min. Optional. Python type: ``int``; wire name: ``max``; JSON type: integer. Constraints: minimum 1""" 24 min: int 25 """Minimum quantity the customer can buy. Required. Python type: ``int``; wire name: ``min``; JSON type: integer. Constraints: minimum 1"""
Quantity bounds the Buy link should enforce. Omit max when the Buy link has no upper quantity bound. When present, max must be greater than or equal to min.
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: CreatePurchaseIntentRequestQuantity.
Optional maximum quantity the customer can buy. It must be greater than or equal to min. Optional. Python type: int; wire name: max; JSON type: integer. Constraints: minimum 1
Minimum quantity the customer can buy. Required. Python type: int; wire name: min; JSON type: integer. Constraints: minimum 1
12@dataclass(frozen=True, slots=True, kw_only=True) 13class CreateRequestUsage(ApiRequest): 14 """Optional link-use policy. Omit to create a reusable Buy link. 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: ``CreatePurchaseIntentRequestUsage``. 21 """ 22 single_use: bool | UnsetType = field(default=UNSET) 23 """Creating the first order consumes the Buy link. Optional. Python type: ``bool``; wire name: ``single_use``; JSON type: boolean""" 24 multi_use: bool | UnsetType = field(default=UNSET) 25 """The Buy link may create multiple orders. Optional. Python type: ``bool``; wire name: ``multi_use``; JSON type: boolean"""
Optional link-use policy. Omit to create a reusable Buy link.
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: CreatePurchaseIntentRequestUsage.
Creating the first order consumes the Buy link. Optional. Python type: bool; wire name: single_use; JSON type: boolean
The Buy link may create multiple orders. Optional. Python type: bool; wire name: multi_use; JSON type: boolean
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: ``LookupPurchaseIntentRequest``. 21 """ 22 id: str 23 """Purchase intent ID to look up. Required. Python type: ``str``; wire name: ``id``; JSON type: string. Constraints: minimum length 1"""
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: LookupPurchaseIntentRequest.
Purchase intent ID to look up. Required. Python type: str; wire name: id; JSON type: string. Constraints: minimum length 1
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Merchant(ApiModel): 14 """Merchant identity captured for the hosted checkout. Individual fields are omitted when unavailable. 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: ``PurchaseIntentMerchant``. 23 """ 24 app_name: str | None = field(init=False) 25 """The app name associated with this merchant. Optional; nullable. Python type: ``str | None``; wire name: ``app_name``; JSON type: string""" 26 organization_id: str | None = field(init=False) 27 """Identifier of the related organization. Optional; nullable. Python type: ``str | None``; wire name: ``organization_id``; JSON type: string""" 28 organization_name: str | None = field(init=False) 29 """The organization name associated with this merchant. Optional; nullable. Python type: ``str | None``; wire name: ``organization_name``; JSON type: string"""
Merchant identity captured for the hosted checkout. Individual fields are omitted when unavailable.
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: PurchaseIntentMerchant.
The app name associated with this merchant. Optional; nullable. Python type: str | None; wire name: app_name; JSON type: string
Identifier of the related organization. Optional; nullable. Python type: str | None; wire name: organization_id; JSON type: string
The organization name associated with this merchant. Optional; nullable. Python type: str | None; wire name: organization_name; JSON type: string
13@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 14class OriginalPrice(ApiModel): 15 """Typed original price data in the purchase intent resource namespace. 16 17 Instances are immutable API responses. ``from_dict()`` decodes nested 18 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 19 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 20 Fields not returned by the API remain absent and can still be queried 21 through mapping-style access. 22 23 API contract schema: ``PurchaseIntentOriginalPrice``. 24 """ 25 active: bool = field(init=False) 26 """Whether the resolved comparison price is active. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 27 id: str | None = field(init=False) 28 """Catalog price ID when the comparison price is not inline. Optional; nullable. Python type: ``str | None``; wire name: ``id``; JSON type: string""" 29 label: str | None = field(init=False) 30 """Catalog price label when available. Optional; nullable. Python type: ``str | None``; wire name: ``label``; JSON type: string""" 31 nominal: Amount = field(init=False) 32 """Monetary nominal, represented by a currency and an integer minor-unit value. Required. Python type: ``Amount``; wire name: ``nominal``; JSON type: object (Amount)"""
Typed original price data in the purchase intent 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: PurchaseIntentOriginalPrice.
Whether the resolved comparison price is active. Required. Python type: bool; wire name: active; JSON type: boolean
Catalog price ID when the comparison price is not inline. Optional; nullable. Python type: str | None; wire name: id; JSON type: string
Catalog price label when available. Optional; nullable. Python type: str | None; wire name: label; JSON type: string
Monetary nominal, represented by a currency and an integer minor-unit value. Required. Python type: Amount; wire name: nominal; JSON type: object (Amount)
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: ``PurchaseIntentPage``. 23 """ 24 number: int = field(init=False) 25 """One-based page number returned. Required. Python type: ``int``; wire name: ``number``; JSON type: integer""" 26 purchase_intents: list[PurchaseIntent] = field(init=False) 27 """The purchase intents associated with this page. Required. Python type: ``list[PurchaseIntent]``; wire name: ``purchase_intents``; JSON type: array of object (PurchaseIntent) values""" 28 size: int = field(init=False) 29 """Number of purchase intents actually returned. Required. Python type: ``int``; wire name: ``size``; JSON type: integer"""
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: PurchaseIntentPage.
One-based page number returned. Required. Python type: int; wire name: number; JSON type: integer
The purchase intents associated with this page. Required. Python type: list[PurchaseIntent]; wire name: purchase_intents; JSON type: array of object (PurchaseIntent) values
Number of purchase intents actually returned. Required. Python type: int; 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: ``PagePurchaseIntentsRequest``. 21 """ 22 page_number: int 23 """One-based page number to retrieve. Required. Python type: ``int``; wire name: ``page_number``; JSON type: integer. Constraints: minimum 1; maximum 10""" 24 page_size: int 25 """Maximum number of purchase intents to return on this page. Required. Python type: ``int``; wire name: ``page_size``; JSON type: integer. Constraints: minimum 1; maximum 256"""
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: PagePurchaseIntentsRequest.
One-based page number to retrieve. Required. Python type: int; wire name: page_number; JSON type: integer. Constraints: minimum 1; maximum 10
Maximum number of purchase intents to return on this page. Required. Python type: int; wire name: page_size; JSON type: integer. Constraints: minimum 1; maximum 256
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: ``PagePurchaseIntentsResponse``. 23 """ 24 page: PurchaseIntentPage = field(init=False) 25 """Numeric page used by this operation. Required. Python type: ``PurchaseIntentPage``; wire name: ``page``; JSON type: object"""
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: PagePurchaseIntentsResponse.
13@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 14class Price(ApiModel): 15 """Typed price data in the purchase intent resource namespace. 16 17 Instances are immutable API responses. ``from_dict()`` decodes nested 18 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 19 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 20 Fields not returned by the API remain absent and can still be queried 21 through mapping-style access. 22 23 API contract schema: ``PurchaseIntentPrice``. 24 """ 25 active: bool = field(init=False) 26 """Whether the resolved price can be used. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 27 id: str | None = field(init=False) 28 """Catalog price ID when the offer price is not inline. Optional; nullable. Python type: ``str | None``; wire name: ``id``; JSON type: string""" 29 label: str | None = field(init=False) 30 """Catalog price label when available. Optional; nullable. Python type: ``str | None``; wire name: ``label``; JSON type: string""" 31 nominal: Amount = field(init=False) 32 """Monetary nominal, represented by a currency and an integer minor-unit value. Required. Python type: ``Amount``; wire name: ``nominal``; JSON type: object (Amount)""" 33 original: PurchaseIntentOriginalPrice | None = field(init=False) 34 """The original associated with this price. Optional; nullable. Python type: ``PurchaseIntentOriginalPrice | None``; wire name: ``original``; JSON type: object (PurchaseIntentOriginalPrice)"""
Typed price data in the purchase intent 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: PurchaseIntentPrice.
Whether the resolved price can be used. Required. Python type: bool; wire name: active; JSON type: boolean
Catalog price ID when the offer price is not inline. Optional; nullable. Python type: str | None; wire name: id; JSON type: string
Catalog price label when available. Optional; nullable. Python type: str | None; wire name: label; JSON type: string
Monetary nominal, represented by a currency and an integer minor-unit value. Required. Python type: Amount; wire name: nominal; JSON type: object (Amount)
The original associated with this price. Optional; nullable. Python type: PurchaseIntentOriginalPrice | None; wire name: original; JSON type: object (PurchaseIntentOriginalPrice)
10@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 11class Presentation(ApiModel): 12 """Customer-facing presentation settings for a purchase intent.""" 13 14 buy_page: PresentationBuyPage | None = field(init=False)
Customer-facing presentation settings for a purchase intent.
10@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 11class PresentationBuyPage(ApiModel): 12 """Presentation settings returned for the hosted Buy page.""" 13 14 text: PresentationBuyPageText | None = field(init=False)
Presentation settings returned for the hosted Buy page.
9@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 10class PresentationBuyPageText(ApiModel): 11 """Current merchant-authored text for the hosted Buy page.""" 12 13 checkout_section_title: str | None = field(init=False) 14 amount_field_label: str | None = field(init=False) 15 primary_action_label: str | None = field(init=False)
Current merchant-authored text for the hosted Buy page.
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 15class Product(ApiModel): 16 """Typed product data in the purchase intent 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: ``PurchaseIntentProduct``. 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[PurchaseIntentProductAttributesItem] | None = field(init=False) 35 """Product attributes. Optional; nullable. Python type: ``list[PurchaseIntentProductAttributesItem] | 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)""" 64 prices: list[ProductPriceSummary] | None = field(init=False) 65 """Non-archived catalog prices currently attached to the product. Optional; nullable. Python type: ``list[ProductPriceSummary] | None``; wire name: ``prices``; JSON type: array of object (ProductPriceSummary) values""" 66 variant_set_id: str | None = field(init=False) 67 """Variant set configured for this Buy link. Optional; nullable. Python type: ``str | None``; wire name: ``variant_set_id``; JSON type: string"""
Typed product data in the purchase intent 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: PurchaseIntentProduct.
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[PurchaseIntentProductAttributesItem] | 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)
Non-archived catalog prices currently attached to the product. Optional; nullable. Python type: list[ProductPriceSummary] | None; wire name: prices; JSON type: array of object (ProductPriceSummary) values
Variant set configured for this Buy link. Optional; nullable. Python type: str | None; wire name: variant_set_id; JSON type: string
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class ProductAttributesItem(ApiModel): 14 """Typed product attributes item data in the purchase intent 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: ``PurchaseIntentProductAttributesItem``. 23 """ 24 name: str = field(init=False) 25 """Human-readable name of the product attributes item. Required. Python type: ``str``; wire name: ``name``; JSON type: string. Constraints: maximum length 100""" 26 value: str = field(init=False) 27 """The value associated with this product attributes item. Required. Python type: ``str``; wire name: ``value``; JSON type: string. Constraints: maximum length 500"""
Typed product attributes item data in the purchase intent 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: PurchaseIntentProductAttributesItem.
Human-readable name of the product attributes item. Required. Python type: str; wire name: name; JSON type: string. Constraints: maximum length 100
The value associated with this product attributes item. Required. Python type: str; wire name: value; JSON type: string. Constraints: maximum length 500
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 15class PurchaseIntent(ApiModel): 16 """Typed purchase intent data in the purchase intent 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 allow_variants: bool = field(init=False) 25 """Whether the intent was configured with a variant set. Required. Python type: ``bool``; wire name: ``allow_variants``; JSON type: boolean""" 26 created_at: datetime = field(init=False) 27 """Creation timestamp. Required. Python type: ``datetime``; wire name: ``created_at``; JSON type: string (date-time)""" 28 expires_at: datetime | None = field(init=False) 29 """Timestamp at or after which the Buy link is expired. Optional; nullable. Python type: ``datetime | None``; wire name: ``expires_at``; JSON type: string (date-time)""" 30 id: str = field(init=False) 31 """Unique purchase intent identifier with sale_ prefix. Append it to https://pages.inttegro.com/buy/ to build the hosted Buy link. Required. Python type: ``str``; wire name: ``id``; JSON type: string""" 32 inactive_at: datetime | None = field(init=False) 33 """When the Buy link was explicitly canceled. Optional; nullable. Python type: ``datetime | None``; wire name: ``inactive_at``; JSON type: string (date-time)""" 34 merchant: PurchaseIntentMerchant | None = field(init=False) 35 """Merchant identity captured for the hosted checkout. Individual fields are omitted when unavailable. Optional; nullable. Python type: ``PurchaseIntentMerchant | None``; wire name: ``merchant``; JSON type: object (PurchaseIntentMerchant)""" 36 price: PurchaseIntentPrice | None = field(init=False) 37 """The price associated with this purchase intent. Optional; nullable. Python type: ``PurchaseIntentPrice | None``; wire name: ``price``; JSON type: object (PurchaseIntentPrice)""" 38 presentation: PurchaseIntentPresentation | None = field(init=False) 39 """Merchant-authored Buy page presentation settings. Optional; nullable. Python type: ``PurchaseIntentPresentation | None``; wire name: ``presentation``; JSON type: object""" 40 product: PurchaseIntentProduct | None = field(init=False) 41 """The product associated with this purchase intent. Optional; nullable. Python type: ``PurchaseIntentProduct | None``; wire name: ``product``; JSON type: object (PurchaseIntentProduct)""" 42 quantity: PurchaseIntentQuantity = field(init=False) 43 """Quantity bounds enforced by the hosted checkout. max is omitted when the offer has no upper bound. Required. Python type: ``PurchaseIntentQuantity``; wire name: ``quantity``; JSON type: object""" 44 status: Literal['active', 'expired', 'inactive', 'used'] = field(init=False) 45 """Effective lifecycle state derived from expiry, cancellation, and single-use order creation. Required. Python type: ``Literal['active', 'expired', 'inactive', 'used']``; wire name: ``status``; JSON type: string. Constraints: allowed values ``active``, ``expired``, ``inactive``, ``used``""" 46 updated_at: datetime | None = field(init=False) 47 """Last mutation timestamp. Optional; nullable. Python type: ``datetime | None``; wire name: ``updated_at``; JSON type: string (date-time)""" 48 usage: PurchaseIntentUsage = field(init=False) 49 """Exactly one of multi_use or single_use is returned as true. Order is present after a single-use intent is consumed. Required. Python type: ``PurchaseIntentUsage``; wire name: ``usage``; JSON type: object (PurchaseIntentUsage)""" 50 variant_set: PurchaseIntentVariantSet | None = field(init=False) 51 """The variant set associated with this purchase intent. Optional; nullable. Python type: ``PurchaseIntentVariantSet | None``; wire name: ``variant_set``; JSON type: object (PurchaseIntentVariantSet)""" 52 53 def is_active(self) -> bool: 54 """Whether the purchase intent is currently active.""" 55 return self.status == "active" 56 57 def is_single_use(self) -> bool: 58 """Whether the purchase intent can create at most one order.""" 59 return getattr(self.usage, "single_use", False) is True 60 61 def used_order_id(self) -> str | None: 62 """Return the order ID that consumed a single-use purchase intent.""" 63 if not self.is_single_use(): 64 return None 65 order = getattr(self.usage, "order", None) 66 order_id = getattr(order, "id", None) 67 return order_id if order_id else None
Typed purchase intent data in the purchase intent 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.
Whether the intent was configured with a variant set. Required. Python type: bool; wire name: allow_variants; JSON type: boolean
Creation timestamp. Required. Python type: datetime; wire name: created_at; JSON type: string (date-time)
Timestamp at or after which the Buy link is expired. Optional; nullable. Python type: datetime | None; wire name: expires_at; JSON type: string (date-time)
Unique purchase intent identifier with sale_ prefix. Append it to https://pages.inttegro.com/buy/ to build the hosted Buy link. Required. Python type: str; wire name: id; JSON type: string
When the Buy link was explicitly canceled. Optional; nullable. Python type: datetime | None; wire name: inactive_at; JSON type: string (date-time)
Merchant identity captured for the hosted checkout. Individual fields are omitted when unavailable. Optional; nullable. Python type: PurchaseIntentMerchant | None; wire name: merchant; JSON type: object (PurchaseIntentMerchant)
The price associated with this purchase intent. Optional; nullable. Python type: PurchaseIntentPrice | None; wire name: price; JSON type: object (PurchaseIntentPrice)
Merchant-authored Buy page presentation settings. Optional; nullable. Python type: PurchaseIntentPresentation | None; wire name: presentation; JSON type: object
The product associated with this purchase intent. Optional; nullable. Python type: PurchaseIntentProduct | None; wire name: product; JSON type: object (PurchaseIntentProduct)
Quantity bounds enforced by the hosted checkout. max is omitted when the offer has no upper bound. Required. Python type: PurchaseIntentQuantity; wire name: quantity; JSON type: object
Effective lifecycle state derived from expiry, cancellation, and single-use order creation. Required. Python type: Literal['active', 'expired', 'inactive', 'used']; wire name: status; JSON type: string. Constraints: allowed values active, expired, inactive, used
Last mutation timestamp. Optional; nullable. Python type: datetime | None; wire name: updated_at; JSON type: string (date-time)
Exactly one of multi_use or single_use is returned as true. Order is present after a single-use intent is consumed. Required. Python type: PurchaseIntentUsage; wire name: usage; JSON type: object (PurchaseIntentUsage)
The variant set associated with this purchase intent. Optional; nullable. Python type: PurchaseIntentVariantSet | None; wire name: variant_set; JSON type: object (PurchaseIntentVariantSet)
53 def is_active(self) -> bool: 54 """Whether the purchase intent is currently active.""" 55 return self.status == "active"
Whether the purchase intent is currently active.
57 def is_single_use(self) -> bool: 58 """Whether the purchase intent can create at most one order.""" 59 return getattr(self.usage, "single_use", False) is True
Whether the purchase intent can create at most one order.
61 def used_order_id(self) -> str | None: 62 """Return the order ID that consumed a single-use purchase intent.""" 63 if not self.is_single_use(): 64 return None 65 order = getattr(self.usage, "order", None) 66 order_id = getattr(order, "id", None) 67 return order_id if order_id else None
Return the order ID that consumed a single-use purchase intent.
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Quantity(ApiModel): 14 """Quantity bounds enforced by the hosted checkout. max is omitted when the offer has no upper bound. 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: ``PurchaseIntentQuantity``. 23 """ 24 min: int = field(init=False) 25 """Minimum quantity the hosted checkout allows. Required. Python type: ``int``; wire name: ``min``; JSON type: integer. Constraints: minimum 1""" 26 max: int | None = field(init=False) 27 """Optional maximum quantity the hosted checkout allows. It is always greater than or equal to min when present. Optional; nullable. Python type: ``int | None``; wire name: ``max``; JSON type: integer. Constraints: minimum 1"""
Quantity bounds enforced by the hosted checkout. max is omitted when the offer has no upper bound.
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: PurchaseIntentQuantity.
Minimum quantity the hosted checkout allows. Required. Python type: int; wire name: min; JSON type: integer. Constraints: minimum 1
Optional maximum quantity the hosted checkout allows. It is always greater than or equal to min when present. Optional; nullable. Python type: int | None; wire name: max; JSON type: integer. Constraints: minimum 1
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: ``PurchaseIntentResponse``. 23 """ 24 purchase_intent: PurchaseIntent = field(init=False) 25 """The purchase intent associated with this response. Required. Python type: ``PurchaseIntent``; wire name: ``purchase_intent``; JSON type: object (PurchaseIntent)"""
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: PurchaseIntentResponse.
The purchase intent associated with this response. Required. Python type: PurchaseIntent; wire name: purchase_intent; JSON type: object (PurchaseIntent)
11class Status(WireEnum): 12 """Effective lifecycle state derived from expiry, cancellation, and single-use order creation. 13 14 Members are strings as well as enum values, so they compare naturally 15 with API payloads and serialize to the lowercase wire value shown below. 16 17 API contract schema: ``PurchaseIntentStatus``. 18 """ 19 ACTIVE = "active" 20 """Wire value ``active`` (active) for effective lifecycle state derived from expiry, cancellation, and single-use order creation""" 21 EXPIRED = "expired" 22 """Wire value ``expired`` (expired) for effective lifecycle state derived from expiry, cancellation, and single-use order creation""" 23 INACTIVE = "inactive" 24 """Wire value ``inactive`` (inactive) for effective lifecycle state derived from expiry, cancellation, and single-use order creation""" 25 USED = "used" 26 """Wire value ``used`` (used) for effective lifecycle state derived from expiry, cancellation, and single-use order creation"""
Effective lifecycle state derived from expiry, cancellation, and single-use order creation.
Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.
API contract schema: PurchaseIntentStatus.
Wire value active (active) for effective lifecycle state derived from expiry, cancellation, and single-use order creation
Wire value expired (expired) for effective lifecycle state derived from expiry, cancellation, and single-use order creation
Wire value inactive (inactive) for effective lifecycle state derived from expiry, cancellation, and single-use order creation
Wire value used (used) for effective lifecycle state derived from expiry, cancellation, and single-use order creation
13@dataclass(frozen=True, slots=True, kw_only=True) 14class UpdateRequest(ApiRequest): 15 """Parameters accepted by the update request operation. 16 17 This is an immutable, keyword-only request object. ``to_dict()`` uses 18 the documented wire names, omits fields left as ``UNSET``, serializes 19 string-backed enums by value, and requires timezone-aware datetimes. 20 21 API contract schema: ``UpdatePurchaseIntentRequest``. 22 """ 23 expires_at: datetime | None | UnsetType = field(default=UNSET) 24 """RFC3339 expiry timestamp, including a past time for immediate expiry, or null to clear expiry. Optional; nullable. Python type: ``datetime | None``; wire name: ``expires_at``; JSON type: string (date-time)""" 25 id: str | UnsetType = field(default=UNSET) 26 """Purchase intent ID to update. Send this or purchase_intent_id. Optional. Python type: ``str``; wire name: ``id``; JSON type: string. Constraints: minimum length 1""" 27 quantity: UpdatePurchaseIntentRequestQuantity | UnsetType = field(default=UNSET) 28 """Replacement quantity bounds. Omit the object to preserve the current bounds. Within the object, min is required and omitting max removes the upper bound. When present, max must be greater than or equal to min. Optional. Python type: ``UpdatePurchaseIntentRequestQuantity``; wire name: ``quantity``; JSON type: object""" 29 purchase_intent_id: str | UnsetType = field(default=UNSET) 30 """Alias for id. If both are present, this value takes precedence. Optional. Python type: ``str``; wire name: ``purchase_intent_id``; JSON type: string. Constraints: minimum length 1""" 31 reactivate: bool | UnsetType = field(default=UNSET) 32 """Clears the state that prevents new purchases. For canceled Buy links this removes inactive_at. For expired Buy links this clears an existing elapsed expires_at value. It does not remove the order claim from a used single-use intent. Optional. Python type: ``bool``; wire name: ``reactivate``; JSON type: boolean""" 33 presentation: UpdatePurchaseIntentRequestPresentation | UnsetType = field(default=UNSET) 34 """Sparse hosted Buy page copy update. Optional. Python type: ``UpdatePurchaseIntentRequestPresentation``; wire name: ``presentation``; JSON type: object"""
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: UpdatePurchaseIntentRequest.
RFC3339 expiry timestamp, including a past time for immediate expiry, or null to clear expiry. Optional; nullable. Python type: datetime | None; wire name: expires_at; JSON type: string (date-time)
Purchase intent ID to update. Send this or purchase_intent_id. Optional. Python type: str; wire name: id; JSON type: string. Constraints: minimum length 1
Replacement quantity bounds. Omit the object to preserve the current bounds. Within the object, min is required and omitting max removes the upper bound. When present, max must be greater than or equal to min. Optional. Python type: UpdatePurchaseIntentRequestQuantity; wire name: quantity; JSON type: object
Alias for id. If both are present, this value takes precedence. Optional. Python type: str; wire name: purchase_intent_id; JSON type: string. Constraints: minimum length 1
Clears the state that prevents new purchases. For canceled Buy links this removes inactive_at. For expired Buy links this clears an existing elapsed expires_at value. It does not remove the order claim from a used single-use intent. Optional. Python type: bool; wire name: reactivate; JSON type: boolean
Sparse hosted Buy page copy update. Optional. Python type: UpdatePurchaseIntentRequestPresentation; wire name: presentation; JSON type: object
12@dataclass(frozen=True, slots=True, kw_only=True) 13class UpdateRequestPresentation(ApiRequest): 14 """Customer-facing presentation changes for a purchase intent.""" 15 16 buy_page: UpdateRequestPresentationBuyPage
Customer-facing presentation changes for a purchase intent.
12@dataclass(frozen=True, slots=True, kw_only=True) 13class UpdateRequestPresentationBuyPage(ApiRequest): 14 """Changes to the hosted Buy page presentation.""" 15 16 text: UpdateRequestPresentationBuyPageText
Changes to the hosted Buy page presentation.
9@dataclass(frozen=True, slots=True, kw_only=True) 10class UpdateRequestPresentationBuyPageText(ApiRequest): 11 """Sparse text changes for the hosted Buy page.""" 12 13 checkout_section_title: str | None | UnsetType = field(default=UNSET) 14 amount_field_label: str | None | UnsetType = field(default=UNSET) 15 primary_action_label: str | None | UnsetType = field(default=UNSET)
Sparse text changes for the hosted Buy page.
12@dataclass(frozen=True, slots=True, kw_only=True) 13class UpdateRequestQuantity(ApiRequest): 14 """Replacement quantity bounds. Omit the object to preserve the current bounds. Within the object, min is required and omitting max removes the upper bound. When present, max must be greater than or equal to min. 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: ``UpdatePurchaseIntentRequestQuantity``. 21 """ 22 max: int | UnsetType = field(default=UNSET) 23 """Optional maximum quantity the customer can buy. It must be greater than or equal to min. Optional. Python type: ``int``; wire name: ``max``; JSON type: integer. Constraints: minimum 1""" 24 min: int 25 """Minimum quantity the customer can buy. Required. Python type: ``int``; wire name: ``min``; JSON type: integer. Constraints: minimum 1"""
Replacement quantity bounds. Omit the object to preserve the current bounds. Within the object, min is required and omitting max removes the upper bound. When present, max must be greater than or equal to min.
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: UpdatePurchaseIntentRequestQuantity.
Optional maximum quantity the customer can buy. It must be greater than or equal to min. Optional. Python type: int; wire name: max; JSON type: integer. Constraints: minimum 1
Minimum quantity the customer can buy. Required. Python type: int; wire name: min; JSON type: integer. Constraints: minimum 1
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Usage(ApiModel): 14 """Exactly one of multi_use or single_use is returned as true. Order is present after a single-use intent is consumed. 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: ``PurchaseIntentUsage``. 23 """ 24 multi_use: bool | None = field(init=False) 25 """Whether multi use. Optional; nullable. Python type: ``bool | None``; wire name: ``multi_use``; JSON type: boolean""" 26 order: PurchaseIntentUsageOrder | None = field(init=False) 27 """The order associated with this usage. Optional; nullable. Python type: ``PurchaseIntentUsageOrder | None``; wire name: ``order``; JSON type: object (PurchaseIntentUsageOrder)""" 28 single_use: bool | None = field(init=False) 29 """Whether single use. Optional; nullable. Python type: ``bool | None``; wire name: ``single_use``; JSON type: boolean"""
Exactly one of multi_use or single_use is returned as true. Order is present after a single-use intent is consumed.
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: PurchaseIntentUsage.
Whether multi use. Optional; nullable. Python type: bool | None; wire name: multi_use; JSON type: boolean
The order associated with this usage. Optional; nullable. Python type: PurchaseIntentUsageOrder | None; wire name: order; JSON type: object (PurchaseIntentUsageOrder)
Whether single use. Optional; nullable. Python type: bool | None; wire name: single_use; JSON type: boolean
13@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 14class UsageOrder(ApiModel): 15 """Typed usage order data in the purchase intent resource namespace. 16 17 Instances are immutable API responses. ``from_dict()`` decodes nested 18 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 19 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 20 Fields not returned by the API remain absent and can still be queried 21 through mapping-style access. 22 23 API contract schema: ``PurchaseIntentUsageOrder``. 24 """ 25 created_at: datetime = field(init=False) 26 """When order creation consumed the single-use Buy link. Required. Python type: ``datetime``; wire name: ``created_at``; JSON type: string (date-time)""" 27 id: str = field(init=False) 28 """Order that consumed the Buy link. Required. Python type: ``str``; wire name: ``id``; JSON type: string"""
Typed usage order data in the purchase intent 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: PurchaseIntentUsageOrder.
When order creation consumed the single-use Buy link. Required. Python type: datetime; wire name: created_at; JSON type: string (date-time)
Order that consumed the Buy link. Required. Python type: str; wire name: id; JSON type: string
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Variant(ApiModel): 14 """Typed variant data in the purchase intent 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: ``PurchaseIntentVariant``. 23 """ 24 active: bool = field(init=False) 25 """Whether the variant is active. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 26 position: int | None = field(init=False) 27 """The position associated with this variant. Optional; nullable. Python type: ``int | None``; wire name: ``position``; JSON type: integer""" 28 price: PurchaseIntentPrice | None = field(init=False) 29 """The price associated with this variant. Optional; nullable. Python type: ``PurchaseIntentPrice | None``; wire name: ``price``; JSON type: object (PurchaseIntentPrice)""" 30 product: PurchaseIntentProduct | None = field(init=False) 31 """The product associated with this variant. Optional; nullable. Python type: ``PurchaseIntentProduct | None``; wire name: ``product``; JSON type: object (PurchaseIntentProduct)""" 32 product_id: str = field(init=False) 33 """Identifier of the related product. Required. Python type: ``str``; wire name: ``product_id``; JSON type: string""" 34 variant_values: dict[str, str] = field(init=False) 35 """Product variant attribute selections keyed by attribute name. Required. Python type: ``dict[str, str]``; wire name: ``variant_values``; JSON type: object (VariantValues)"""
Typed variant data in the purchase intent 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: PurchaseIntentVariant.
Whether the variant is active. Required. Python type: bool; wire name: active; JSON type: boolean
The position associated with this variant. Optional; nullable. Python type: int | None; wire name: position; JSON type: integer
The price associated with this variant. Optional; nullable. Python type: PurchaseIntentPrice | None; wire name: price; JSON type: object (PurchaseIntentPrice)
The product associated with this variant. Optional; nullable. Python type: PurchaseIntentProduct | None; wire name: product; JSON type: object (PurchaseIntentProduct)
Identifier of the related product. Required. Python type: str; wire name: product_id; JSON type: string
Product variant attribute selections keyed by attribute name. Required. Python type: dict[str, str]; wire name: variant_values; JSON type: object (VariantValues)
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class VariantAxis(ApiModel): 14 """Typed variant axis data in the purchase intent 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: ``PurchaseIntentVariantAxis``. 23 """ 24 key: str = field(init=False) 25 """The key associated with this variant axi. Required. Python type: ``str``; wire name: ``key``; JSON type: string""" 26 label: str = field(init=False) 27 """The label associated with this variant axi. Required. Python type: ``str``; wire name: ``label``; JSON type: string""" 28 position: int = field(init=False) 29 """The position associated with this variant axi. Required. Python type: ``int``; wire name: ``position``; JSON type: integer"""
Typed variant axis data in the purchase intent 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: PurchaseIntentVariantAxis.
The key associated with this variant axi. Required. Python type: str; wire name: key; JSON type: string
The label associated with this variant axi. Required. Python type: str; wire name: label; JSON type: string
The position associated with this variant axi. Required. Python type: int; wire name: position; JSON type: integer
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class VariantSet(ApiModel): 14 """Typed variant set data in the purchase intent 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: ``PurchaseIntentVariantSet``. 23 """ 24 active: bool = field(init=False) 25 """Whether the variant set is active. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean""" 26 default_product_id: str | None = field(init=False) 27 """Identifier of the related default product. Optional; nullable. Python type: ``str | None``; wire name: ``default_product_id``; JSON type: string""" 28 description: str | None = field(init=False) 29 """Human-readable description of the variant set. Optional; nullable. Python type: ``str | None``; wire name: ``description``; JSON type: string""" 30 id: str = field(init=False) 31 """Unique identifier for this variant set. Required. Python type: ``str``; wire name: ``id``; JSON type: string""" 32 name: str = field(init=False) 33 """Human-readable name of the variant set. Required. Python type: ``str``; wire name: ``name``; JSON type: string""" 34 reference: str | None = field(init=False) 35 """Merchant-defined external reference for the variant set. Optional; nullable. Python type: ``str | None``; wire name: ``reference``; JSON type: string""" 36 variant_axes: list[PurchaseIntentVariantAxis] = field(init=False) 37 """The variant axes associated with this variant set. Required. Python type: ``list[PurchaseIntentVariantAxis]``; wire name: ``variant_axes``; JSON type: array of object (PurchaseIntentVariantAxis) values""" 38 variants: list[PurchaseIntentVariant] = field(init=False) 39 """The variants associated with this variant set. Required. Python type: ``list[PurchaseIntentVariant]``; wire name: ``variants``; JSON type: array of object (PurchaseIntentVariant) values"""
Typed variant set data in the purchase intent 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: PurchaseIntentVariantSet.
Whether the variant set is active. Required. Python type: bool; wire name: active; JSON type: boolean
Identifier of the related default product. Optional; nullable. Python type: str | None; wire name: default_product_id; JSON type: string
Human-readable description of the variant set. Optional; nullable. Python type: str | None; wire name: description; JSON type: string
Unique identifier for this variant set. Required. Python type: str; wire name: id; JSON type: string
Human-readable name of the variant set. Required. Python type: str; wire name: name; JSON type: string
Merchant-defined external reference for the variant set. Optional; nullable. Python type: str | None; wire name: reference; JSON type: string
The variant axes associated with this variant set. Required. Python type: list[PurchaseIntentVariantAxis]; wire name: variant_axes; JSON type: array of object (PurchaseIntentVariantAxis) values