diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 18d760ff0..759dc3b52 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -1af5aa444ea8141a2d2b8d86e76c73f788f65e09 +656489921ee220b536bc00fc1c8ee7ed528f24e2 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 30723023b..bd44999eb 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2277 \ No newline at end of file +v2290 \ No newline at end of file diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 61b0acc08..00cdb7396 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-05-27.preview" + CURRENT = "2026-06-03.preview" diff --git a/stripe/_delegated_checkout_service.py b/stripe/_delegated_checkout_service.py index c149dab13..955ec67dc 100644 --- a/stripe/_delegated_checkout_service.py +++ b/stripe/_delegated_checkout_service.py @@ -5,11 +5,13 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.delegated_checkout._order_service import OrderService from stripe.delegated_checkout._requested_session_service import ( RequestedSessionService, ) _subservices = { + "orders": ["stripe.delegated_checkout._order_service", "OrderService"], "requested_sessions": [ "stripe.delegated_checkout._requested_session_service", "RequestedSessionService", @@ -18,6 +20,7 @@ class DelegatedCheckoutService(StripeService): + orders: "OrderService" requested_sessions: "RequestedSessionService" def __init__(self, requestor): diff --git a/stripe/_event_notification_handler.py b/stripe/_event_notification_handler.py index 79693ea2b..2bcee71b2 100644 --- a/stripe/_event_notification_handler.py +++ b/stripe/_event_notification_handler.py @@ -1230,6 +1230,9 @@ from stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event import ( V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, ) + from stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event import ( + V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification, + ) # event-notification-types: The end of the section generated from our OpenAPI spec # internal type to represent any EventNotification subclass @@ -6604,4 +6607,17 @@ def on_v2_signals_account_signal_fraudulent_merchant_ready( ) return func + def on_v2_signals_account_signal_merchant_delinquency_ready( + self, + func: "Callable[[V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2SignalsAccountSignalMerchantDelinquencyReadyEvent` (`v2.signals.account_signal.merchant_delinquency_ready`) event notification. + """ + self._register( + "v2.signals.account_signal.merchant_delinquency_ready", + func, + ) + return func + # event-notification-registration-methods: The end of the section generated from our OpenAPI spec diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index a8af42f2a..582ae994f 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -117,6 +117,11 @@ "CustomerCashBalanceTransaction", ), "customer_session": ("stripe._customer_session", "CustomerSession"), + "delegated_checkout.order": ("stripe.delegated_checkout._order", "Order"), + "delegated_checkout.order_event": ( + "stripe.delegated_checkout._order_event", + "OrderEvent", + ), "delegated_checkout.requested_session": ( "stripe.delegated_checkout._requested_session", "RequestedSession", @@ -476,6 +481,11 @@ "stripe.v2.billing._collection_setting_version", "CollectionSettingVersion", ), + "v2.billing.contract": ("stripe.v2.billing._contract", "Contract"), + "v2.billing.contract_license_pricing_quantity_change": ( + "stripe.v2.billing._contract_license_pricing_quantity_change", + "ContractLicensePricingQuantityChange", + ), "v2.billing.custom_pricing_unit": ( "stripe.v2.billing._custom_pricing_unit", "CustomPricingUnit", @@ -716,6 +726,10 @@ "stripe.v2.reporting._report_run", "ReportRun", ), + "v2.signals.account_signal": ( + "stripe.v2.signals._account_signal", + "AccountSignal", + ), "v2.tax.manual_rule": ("stripe.v2.tax._manual_rule", "ManualRule"), # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 565c5c8d0..e9c13ebd0 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -3140,7 +3140,9 @@ class DateOfBirth(StripeObject): } account_funding: Optional[AccountFunding] - transaction_type: Optional[Literal["account_funding"]] + transaction_type: Optional[ + Literal["account_funding", "debt_repayment"] + ] """ The type of money services transaction. """ @@ -3733,6 +3735,10 @@ class DepositOptions(StripeObject): """ The blockchain networks to support for deposits. Learn more about [supported networks and tokens](https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support). """ + static_address: Optional[bool] + """ + If true, provisions a permanent per-customer deposit address reused across PaymentIntents. + """ deposit_options: Optional[DepositOptions] mode: Optional[Literal["default", "deposit"]] diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 2886f24f5..1aa49eba0 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -81,7 +81,7 @@ class AutomaticSurcharge(StripeObject): """ Indicates whether automatic surcharge is enabled for the payment link. """ - provider: Optional[Literal["interpayments", "yeeld"]] + provider: Optional[Literal["interpayments", "proserv", "yeeld"]] """ The surcharge provider used for this payment link. """ diff --git a/stripe/_payment_location.py b/stripe/_payment_location.py index 889ea3e73..e5c116928 100644 --- a/stripe/_payment_location.py +++ b/stripe/_payment_location.py @@ -111,7 +111,7 @@ class SupportedIssuers(StripeObject): """ capability_settings: Optional[CapabilitySettings] """ - The capability settings for the location. Only applicable for locations with requested Payment Location Capabilities. + The capability settings for the location. Only applicable for locations with requested payment location capabilities. """ deleted: Optional[Literal[True]] """ diff --git a/stripe/_payment_location_capability.py b/stripe/_payment_location_capability.py index 1aa07fbc7..d8df22027 100644 --- a/stripe/_payment_location_capability.py +++ b/stripe/_payment_location_capability.py @@ -25,7 +25,7 @@ class PaymentLocationCapability( UpdateableAPIResource["PaymentLocationCapability"], ): """ - A Payment Location Capability represents a capability for a Stripe account at a Payment Location. + A `payment_location` capability represents a capability for a Stripe account at a payment location. """ OBJECT_NAME: ClassVar[Literal["payment_location_capability"]] = ( @@ -72,7 +72,7 @@ class Error(StripeObject): account: str """ - The account for which the capability enables functionality. + The account that the capability enables functionality for. """ capability: Literal["fr_meal_vouchers_conecs_payments"] """ @@ -84,7 +84,7 @@ class Error(StripeObject): """ location: str """ - The payment location for which the capability enables functionality. + The payment location that the capability enables functionality for. """ object: Literal["payment_location_capability"] """ @@ -96,7 +96,7 @@ class Error(StripeObject): """ requested_at: Optional[int] """ - Time at which the capability was requested. Measured in seconds since the Unix epoch. + Time when the capability was requested. Measured in seconds since the Unix epoch. """ requirements: Requirements status: Literal["active", "inactive", "pending", "unrequested"] @@ -109,7 +109,7 @@ def list( cls, **params: Unpack["PaymentLocationCapabilityListParams"] ) -> ListObject["PaymentLocationCapability"]: """ - Returns a list of PaymentLocationCapability objects associated with the location. + List all payment location capabilities associated with the payment location. """ result = cls._static_request( "get", @@ -129,7 +129,7 @@ async def list_async( cls, **params: Unpack["PaymentLocationCapabilityListParams"] ) -> ListObject["PaymentLocationCapability"]: """ - Returns a list of PaymentLocationCapability objects associated with the location. + List all payment location capabilities associated with the payment location. """ result = await cls._static_request_async( "get", @@ -149,7 +149,7 @@ def modify( cls, id: str, **params: Unpack["PaymentLocationCapabilityModifyParams"] ) -> "PaymentLocationCapability": """ - Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter. + Updates a payment_location capability. Request or remove a payment_location capability by updating its requested parameter. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -166,7 +166,7 @@ async def modify_async( cls, id: str, **params: Unpack["PaymentLocationCapabilityModifyParams"] ) -> "PaymentLocationCapability": """ - Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter. + Updates a payment_location capability. Request or remove a payment_location capability by updating its requested parameter. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( @@ -185,7 +185,7 @@ def retrieve( **params: Unpack["PaymentLocationCapabilityRetrieveParams"], ) -> "PaymentLocationCapability": """ - Retrieves information about the specified Payment Location Capability. + Retrieves a payment_location capability """ instance = cls(id, **params) instance.refresh() @@ -198,7 +198,7 @@ async def retrieve_async( **params: Unpack["PaymentLocationCapabilityRetrieveParams"], ) -> "PaymentLocationCapability": """ - Retrieves information about the specified Payment Location Capability. + Retrieves a payment_location capability """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/_payment_location_capability_service.py b/stripe/_payment_location_capability_service.py index 8cf20a816..5ea8c8b8b 100644 --- a/stripe/_payment_location_capability_service.py +++ b/stripe/_payment_location_capability_service.py @@ -27,7 +27,7 @@ def list( options: Optional["RequestOptions"] = None, ) -> "ListObject[PaymentLocationCapability]": """ - Returns a list of PaymentLocationCapability objects associated with the location. + List all payment location capabilities associated with the payment location. """ return cast( "ListObject[PaymentLocationCapability]", @@ -46,7 +46,7 @@ async def list_async( options: Optional["RequestOptions"] = None, ) -> "ListObject[PaymentLocationCapability]": """ - Returns a list of PaymentLocationCapability objects associated with the location. + List all payment location capabilities associated with the payment location. """ return cast( "ListObject[PaymentLocationCapability]", @@ -66,7 +66,7 @@ def retrieve( options: Optional["RequestOptions"] = None, ) -> "PaymentLocationCapability": """ - Retrieves information about the specified Payment Location Capability. + Retrieves a payment_location capability """ return cast( "PaymentLocationCapability", @@ -88,7 +88,7 @@ async def retrieve_async( options: Optional["RequestOptions"] = None, ) -> "PaymentLocationCapability": """ - Retrieves information about the specified Payment Location Capability. + Retrieves a payment_location capability """ return cast( "PaymentLocationCapability", @@ -110,7 +110,7 @@ def update( options: Optional["RequestOptions"] = None, ) -> "PaymentLocationCapability": """ - Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter. + Updates a payment_location capability. Request or remove a payment_location capability by updating its requested parameter. """ return cast( "PaymentLocationCapability", @@ -132,7 +132,7 @@ async def update_async( options: Optional["RequestOptions"] = None, ) -> "PaymentLocationCapability": """ - Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter. + Updates a payment_location capability. Request or remove a payment_location capability by updating its requested parameter. """ return cast( "PaymentLocationCapability", diff --git a/stripe/_person.py b/stripe/_person.py index 45385f18b..c8e89969d 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -130,6 +130,32 @@ class AddressKanji(StripeObject): Town/cho-me. """ + class BirthAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + class Dob(StripeObject): day: Optional[int] """ @@ -676,6 +702,7 @@ class Document(StripeObject): """ The Kanji variation of the person's address (Japan only). """ + birth_address: Optional[BirthAddress] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -811,6 +838,7 @@ def retrieve(cls, id, **params): "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, + "birth_address": BirthAddress, "dob": Dob, "future_requirements": FutureRequirements, "registered_address": RegisteredAddress, diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index a3e9ddd64..f5bbc983f 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -16,8 +16,9 @@ from stripe.v2._orchestrated_commerce_service import ( OrchestratedCommerceService, ) - from stripe.v2._payment_service import PaymentService + from stripe.v2._payments_service import PaymentsService from stripe.v2._reporting_service import ReportingService + from stripe.v2._signals_service import SignalsService from stripe.v2._tax_service import TaxService from stripe.v2._test_helper_service import TestHelperService @@ -37,8 +38,9 @@ "stripe.v2._orchestrated_commerce_service", "OrchestratedCommerceService", ], - "payments": ["stripe.v2._payment_service", "PaymentService"], + "payments": ["stripe.v2._payments_service", "PaymentsService"], "reporting": ["stripe.v2._reporting_service", "ReportingService"], + "signals": ["stripe.v2._signals_service", "SignalsService"], "tax": ["stripe.v2._tax_service", "TaxService"], "test_helpers": ["stripe.v2._test_helper_service", "TestHelperService"], } @@ -54,8 +56,9 @@ class V2Services(StripeService): money_management: "MoneyManagementService" network: "NetworkService" orchestrated_commerce: "OrchestratedCommerceService" - payments: "PaymentService" + payments: "PaymentsService" reporting: "ReportingService" + signals: "SignalsService" tax: "TaxService" test_helpers: "TestHelperService" diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index ccd65b670..0df866c89 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -116,7 +116,7 @@ class AutomaticSurcharge(StripeObject): """ Indicates whether automatic surcharge is enabled for the session. """ - provider: Optional[Literal["interpayments", "yeeld"]] + provider: Optional[Literal["interpayments", "proserv", "yeeld"]] """ The surcharge provider used for this session. """ diff --git a/stripe/delegated_checkout/__init__.py b/stripe/delegated_checkout/__init__.py index ce23d2930..9208b2d5c 100644 --- a/stripe/delegated_checkout/__init__.py +++ b/stripe/delegated_checkout/__init__.py @@ -4,19 +4,34 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.delegated_checkout._order import Order as Order + from stripe.delegated_checkout._order_event import OrderEvent as OrderEvent + from stripe.delegated_checkout._order_service import ( + OrderService as OrderService, + ) from stripe.delegated_checkout._requested_session import ( RequestedSession as RequestedSession, ) + from stripe.delegated_checkout._requested_session_order_service import ( + RequestedSessionOrderService as RequestedSessionOrderService, + ) from stripe.delegated_checkout._requested_session_service import ( RequestedSessionService as RequestedSessionService, ) # name -> (import_target, is_submodule) _import_map = { + "Order": ("stripe.delegated_checkout._order", False), + "OrderEvent": ("stripe.delegated_checkout._order_event", False), + "OrderService": ("stripe.delegated_checkout._order_service", False), "RequestedSession": ( "stripe.delegated_checkout._requested_session", False, ), + "RequestedSessionOrderService": ( + "stripe.delegated_checkout._requested_session_order_service", + False, + ), "RequestedSessionService": ( "stripe.delegated_checkout._requested_session_service", False, diff --git a/stripe/delegated_checkout/_order.py b/stripe/delegated_checkout/_order.py new file mode 100644 index 000000000..cb6d69a5e --- /dev/null +++ b/stripe/delegated_checkout/_order.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.delegated_checkout._order_event import OrderEvent + from stripe.params.delegated_checkout._order_retrieve_params import ( + OrderRetrieveParams, + ) + + +class Order(APIResource["Order"]): + """ + An order represents the post-checkout lifecycle of a delegated checkout purchase. + """ + + OBJECT_NAME: ClassVar[Literal["delegated_checkout.order"]] = ( + "delegated_checkout.order" + ) + + class LineItem(StripeObject): + class ProductDetails(StripeObject): + description: Optional[str] + """ + The item description. + """ + images: Optional[List[str]] + """ + The item images. + """ + title: str + """ + The item title. + """ + + class Quantity(StripeObject): + current: int + """ + The current quantity. + """ + ordered: int + """ + The ordered quantity. + """ + shipped: int + """ + The shipped quantity. + """ + + class Totals(StripeObject): + base_amount: Optional[int] + """ + The base amount for the line item. + """ + discount: Optional[int] + """ + The discount amount for the line item. + """ + subtotal: Optional[int] + """ + The subtotal amount for the line item. + """ + tax: Optional[int] + """ + The tax amount for the line item. + """ + total: Optional[int] + """ + The total amount for the line item. + """ + + key: str + """ + The order line item key. + """ + product_details: ProductDetails + quantity: Quantity + sku_id: str + """ + The SKU ID of the line item. + """ + totals: Optional[Totals] + """ + The totals for this line item. + """ + unit_amount: int + """ + The line item unit amount. + """ + _inner_class_types = { + "product_details": ProductDetails, + "quantity": Quantity, + "totals": Totals, + } + + class Totals(StripeObject): + discount: Optional[int] + """ + The discount amount for the order. + """ + fulfillment: Optional[int] + """ + The fulfillment amount for the order. + """ + subtotal: Optional[int] + """ + The subtotal amount for the order. + """ + tax: Optional[int] + """ + The tax amount for the order. + """ + total: Optional[int] + """ + The total amount for the order. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + id: str + """ + Unique identifier for the object. + """ + latest_order_event: Optional["OrderEvent"] + """ + The latest order event for this order. + """ + line_items: List[LineItem] + """ + The line items in this order. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + object: Literal["delegated_checkout.order"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + permalink_url: Optional[str] + """ + The permalink URL for this order. + """ + requested_session: str + """ + The requested session associated with this order. + """ + seller_reference: Optional[str] + """ + The seller reference for this order. + """ + totals: Optional[Totals] + """ + The totals for this order. + """ + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["OrderRetrieveParams"] + ) -> "Order": + """ + Retrieves a delegated checkout order. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["OrderRetrieveParams"] + ) -> "Order": + """ + Retrieves a delegated checkout order. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"line_items": LineItem, "totals": Totals} diff --git a/stripe/delegated_checkout/_order_event.py b/stripe/delegated_checkout/_order_event.py new file mode 100644 index 000000000..28dd9366a --- /dev/null +++ b/stripe/delegated_checkout/_order_event.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class OrderEvent(StripeObject): + """ + An order event represents a change to a delegated checkout order. + """ + + OBJECT_NAME: ClassVar[Literal["delegated_checkout.order_event"]] = ( + "delegated_checkout.order_event" + ) + + class Adjustment(StripeObject): + class LineItem(StripeObject): + key: str + """ + The line item key. + """ + quantity: int + """ + The quantity associated with the order event. + """ + + amount: Optional[int] + """ + The amount associated with the adjustment. + """ + currency: Optional[str] + """ + The currency associated with the adjustment amount. + """ + description: str + """ + The description of the adjustment. + """ + line_items: Optional[List[LineItem]] + """ + The line items associated with the adjustment. + """ + status: Literal["completed", "failed", "pending"] + """ + The status of the adjustment. + """ + type: Literal[ + "cancellation", + "credit", + "dispute", + "original_payment_refund", + "return", + "store_credit_refund", + ] + """ + The type of adjustment. + """ + _inner_class_types = {"line_items": LineItem} + + class Fulfillment(StripeObject): + class LineItem(StripeObject): + key: str + """ + The line item key. + """ + quantity: int + """ + The quantity associated with the order event. + """ + + carrier: Optional[str] + """ + The carrier for the fulfillment. + """ + delivered_at: Optional[int] + """ + Time at which the fulfillment was delivered. Measured in seconds since the Unix epoch. + """ + line_items: List[LineItem] + """ + The line items associated with the fulfillment. + """ + shipped_at: Optional[int] + """ + Time at which the fulfillment shipped. Measured in seconds since the Unix epoch. + """ + status: Literal[ + "confirmed", + "delivered", + "fulfilled", + "pending", + "returned", + "shipped", + ] + """ + The status of the fulfillment. + """ + tracking_number: Optional[str] + """ + The tracking number for the fulfillment. + """ + tracking_url: Optional[str] + """ + The tracking URL for the fulfillment. + """ + _inner_class_types = {"line_items": LineItem} + + adjustment: Optional[Adjustment] + """ + The adjustment details for this order event. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + fulfillment: Optional[Fulfillment] + """ + The fulfillment details for this order event. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + object: Literal["delegated_checkout.order_event"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + occurred_at: int + """ + Time at which this event occurred. Measured in seconds since the Unix epoch. + """ + order: str + """ + The delegated checkout order associated with this order event. + """ + requested_session: str + """ + The requested session associated with this order event. + """ + type: Literal["adjustment", "fulfillment"] + """ + The type of order event. + """ + _inner_class_types = {"adjustment": Adjustment, "fulfillment": Fulfillment} diff --git a/stripe/delegated_checkout/_order_service.py b/stripe/delegated_checkout/_order_service.py new file mode 100644 index 000000000..fe84d8399 --- /dev/null +++ b/stripe/delegated_checkout/_order_service.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.delegated_checkout._order import Order + from stripe.params.delegated_checkout._order_retrieve_params import ( + OrderRetrieveParams, + ) + + +class OrderService(StripeService): + def retrieve( + self, + order_id: str, + params: Optional["OrderRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Order": + """ + Retrieves a delegated checkout order. + """ + return cast( + "Order", + self._request( + "get", + "/v1/delegated_checkout/orders/{order_id}".format( + order_id=sanitize_id(order_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + order_id: str, + params: Optional["OrderRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Order": + """ + Retrieves a delegated checkout order. + """ + return cast( + "Order", + await self._request_async( + "get", + "/v1/delegated_checkout/orders/{order_id}".format( + order_id=sanitize_id(order_id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/delegated_checkout/_requested_session.py b/stripe/delegated_checkout/_requested_session.py index 5ef11d412..b81ac6fdd 100644 --- a/stripe/delegated_checkout/_requested_session.py +++ b/stripe/delegated_checkout/_requested_session.py @@ -2,6 +2,7 @@ # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id @@ -10,6 +11,7 @@ if TYPE_CHECKING: from stripe._profile import Profile + from stripe.delegated_checkout._order import Order from stripe.params.delegated_checkout._requested_session_confirm_params import ( RequestedSessionConfirmParams, ) @@ -19,6 +21,9 @@ from stripe.params.delegated_checkout._requested_session_expire_params import ( RequestedSessionExpireParams, ) + from stripe.params.delegated_checkout._requested_session_list_orders_params import ( + RequestedSessionListOrdersParams, + ) from stripe.params.delegated_checkout._requested_session_modify_params import ( RequestedSessionModifyParams, ) @@ -1111,6 +1116,122 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_list_orders( + cls, + requested_session: str, + **params: Unpack["RequestedSessionListOrdersParams"], + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + ListObject["Order"], + cls._static_request( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(requested_session) + ), + params=params, + ), + ) + + @overload + @staticmethod + def list_orders( + requested_session: str, + **params: Unpack["RequestedSessionListOrdersParams"], + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + ... + + @overload + def list_orders( + self, **params: Unpack["RequestedSessionListOrdersParams"] + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + ... + + @class_method_variant("_cls_list_orders") + def list_orders( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RequestedSessionListOrdersParams"] + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + ListObject["Order"], + self._request( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_list_orders_async( + cls, + requested_session: str, + **params: Unpack["RequestedSessionListOrdersParams"], + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + ListObject["Order"], + await cls._static_request_async( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(requested_session) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_orders_async( + requested_session: str, + **params: Unpack["RequestedSessionListOrdersParams"], + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + ... + + @overload + async def list_orders_async( + self, **params: Unpack["RequestedSessionListOrdersParams"] + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + ... + + @class_method_variant("_cls_list_orders_async") + async def list_orders_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RequestedSessionListOrdersParams"] + ) -> ListObject["Order"]: + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + ListObject["Order"], + await self._request_async( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["RequestedSessionModifyParams"] diff --git a/stripe/delegated_checkout/_requested_session_order_service.py b/stripe/delegated_checkout/_requested_session_order_service.py new file mode 100644 index 000000000..1144e65e6 --- /dev/null +++ b/stripe/delegated_checkout/_requested_session_order_service.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.delegated_checkout._order import Order + from stripe.params.delegated_checkout._requested_session_order_list_params import ( + RequestedSessionOrderListParams, + ) + + +class RequestedSessionOrderService(StripeService): + def list( + self, + requested_session: str, + params: Optional["RequestedSessionOrderListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Order]": + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + "ListObject[Order]", + self._request( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(requested_session), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + requested_session: str, + params: Optional["RequestedSessionOrderListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Order]": + """ + Lists orders for a delegated checkout requested session. + """ + return cast( + "ListObject[Order]", + await self._request_async( + "get", + "/v1/delegated_checkout/requested_sessions/{requested_session}/orders".format( + requested_session=sanitize_id(requested_session), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/delegated_checkout/_requested_session_service.py b/stripe/delegated_checkout/_requested_session_service.py index 94a8d31ab..cf23843d0 100644 --- a/stripe/delegated_checkout/_requested_session_service.py +++ b/stripe/delegated_checkout/_requested_session_service.py @@ -3,11 +3,15 @@ from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Optional, cast +from importlib import import_module from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: from stripe._request_options import RequestOptions from stripe.delegated_checkout._requested_session import RequestedSession + from stripe.delegated_checkout._requested_session_order_service import ( + RequestedSessionOrderService, + ) from stripe.params.delegated_checkout._requested_session_confirm_params import ( RequestedSessionConfirmParams, ) @@ -24,8 +28,36 @@ RequestedSessionUpdateParams, ) +_subservices = { + "orders": [ + "stripe.delegated_checkout._requested_session_order_service", + "RequestedSessionOrderService", + ], +} + class RequestedSessionService(StripeService): + orders: "RequestedSessionOrderService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() + def retrieve( self, requested_session: str, diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index 5f097dcba..8d3f2270c 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -1639,6 +1639,10 @@ V2SignalsAccountSignalFraudulentMerchantReadyEvent as V2SignalsAccountSignalFraudulentMerchantReadyEvent, V2SignalsAccountSignalFraudulentMerchantReadyEventNotification as V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, ) + from stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event import ( + V2SignalsAccountSignalMerchantDelinquencyReadyEvent as V2SignalsAccountSignalMerchantDelinquencyReadyEvent, + V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification as V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification, + ) # name -> (import_target, is_submodule) _import_map = { @@ -4780,6 +4784,14 @@ "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", False, ), + "V2SignalsAccountSignalMerchantDelinquencyReadyEvent": ( + "stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event", + False, + ), + "V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification": ( + "stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index fe3418fee..3ae0f001e 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -1225,6 +1225,9 @@ from stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event import ( V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, ) + from stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event import ( + V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification, + ) _V2_EVENT_CLASS_LOOKUP = { @@ -2852,6 +2855,10 @@ "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", "V2SignalsAccountSignalFraudulentMerchantReadyEvent", ), + "v2.signals.account_signal.merchant_delinquency_ready": ( + "stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event", + "V2SignalsAccountSignalMerchantDelinquencyReadyEvent", + ), } @@ -4491,6 +4498,10 @@ def get_v2_event_class(type_: str): "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", "V2SignalsAccountSignalFraudulentMerchantReadyEventNotification", ), + "v2.signals.account_signal.merchant_delinquency_ready": ( + "stripe.events._v2_signals_account_signal_merchant_delinquency_ready_event", + "V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification", + ), } @@ -4912,4 +4923,5 @@ def get_v2_event_notification_class(type_: str): "V2ReportingReportRunSucceededEventNotification", "V2ReportingReportRunUpdatedEventNotification", "V2SignalsAccountSignalFraudulentMerchantReadyEventNotification", + "V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification", ] diff --git a/stripe/events/_v2_signals_account_signal_merchant_delinquency_ready_event.py b/stripe/events/_v2_signals_account_signal_merchant_delinquency_ready_event.py new file mode 100644 index 000000000..aee96f5e8 --- /dev/null +++ b/stripe/events/_v2_signals_account_signal_merchant_delinquency_ready_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.signals._account_signal import AccountSignal + + +class V2SignalsAccountSignalMerchantDelinquencyReadyEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.signals.account_signal.merchant_delinquency_ready" + type: Literal["v2.signals.account_signal.merchant_delinquency_ready"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2SignalsAccountSignalMerchantDelinquencyReadyEvent": + return cast( + "V2SignalsAccountSignalMerchantDelinquencyReadyEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "AccountSignal": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2SignalsAccountSignalMerchantDelinquencyReadyEvent": + return cast( + "V2SignalsAccountSignalMerchantDelinquencyReadyEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "AccountSignal": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2SignalsAccountSignalMerchantDelinquencyReadyEvent(Event): + LOOKUP_TYPE = "v2.signals.account_signal.merchant_delinquency_ready" + type: Literal["v2.signals.account_signal.merchant_delinquency_ready"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "AccountSignal": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "AccountSignal", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index c2723cb70..de4218ef1 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -811,6 +811,12 @@ class Visa(StripeObject): """ A unique reference ID from the network to represent the card account number. """ + token_decision_recommendation: Optional[ + Literal["approve", "decline", "recommend_id_and_v"] + ] + """ + Stripe's recommendation to the network for this token activation request, derived from the same risk signals used for the activation decision. + """ token_reference_id: str """ The network-unique identifier for the token. @@ -911,6 +917,25 @@ class WalletProvider(StripeObject): The hashed ID derived from the device ID from the card network associated with the token. """ network_data: Optional[NetworkData] + provisioning_decision: Optional[ + Literal["approve", "approve_pending_id_and_v", "decline"] + ] + """ + The decision made during token provisioning. + """ + token_type: Optional[ + Literal[ + "card_on_file", + "cloud_based", + "commerce_platform", + "commercial_virtual_account", + "secure_element", + "static_credential", + ] + ] + """ + The type of the token, indicating how it is used. + """ _inner_class_types = {"network_data": NetworkData} class Treasury(StripeObject): diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 71a87a2aa..6d369a9d0 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -35,6 +35,196 @@ class Device(StripeObject): """ The IP address of the device at provisioning time. """ + language: Optional[ + Literal[ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu", + ] + ] + """ + The ISO 639-1 language code of the device associated with the tokenization request. + """ location: Optional[str] """ The geographic latitude/longitude coordinates of the device at provisioning time. The format is [+-]decimal/[+-]decimal. @@ -75,6 +265,12 @@ class Visa(StripeObject): """ A unique reference ID from Visa to represent the card account number. """ + token_decision_recommendation: Optional[ + Literal["approve", "decline", "recommend_id_and_v"] + ] + """ + Stripe's recommendation to the network for this token activation request, derived from the same risk signals used for the activation decision. + """ token_reference_id: str """ The network-unique identifier for the token. @@ -227,10 +423,29 @@ class CardholderAddress(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + provisioning_decision: Optional[ + Literal["approve", "approve_pending_id_and_v", "decline"] + ] + """ + The decision made during token provisioning. + """ status: Literal["active", "deleted", "requested", "suspended"] """ The usage state of the token. """ + token_type: Optional[ + Literal[ + "card_on_file", + "cloud_based", + "commerce_platform", + "commercial_virtual_account", + "secure_element", + "static_credential", + ] + ] + """ + The type of the token, indicating how it is used. + """ wallet_provider: Optional[ Literal["apple_pay", "google_pay", "samsung_pay"] ] diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index 8657049fe..66f99b20a 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -172,6 +172,7 @@ AccountCreateParamsIndividualAddress as AccountCreateParamsIndividualAddress, AccountCreateParamsIndividualAddressKana as AccountCreateParamsIndividualAddressKana, AccountCreateParamsIndividualAddressKanji as AccountCreateParamsIndividualAddressKanji, + AccountCreateParamsIndividualBirthAddress as AccountCreateParamsIndividualBirthAddress, AccountCreateParamsIndividualDob as AccountCreateParamsIndividualDob, AccountCreateParamsIndividualRegisteredAddress as AccountCreateParamsIndividualRegisteredAddress, AccountCreateParamsIndividualRelationship as AccountCreateParamsIndividualRelationship, @@ -215,6 +216,7 @@ AccountCreatePersonParamsAddress as AccountCreatePersonParamsAddress, AccountCreatePersonParamsAddressKana as AccountCreatePersonParamsAddressKana, AccountCreatePersonParamsAddressKanji as AccountCreatePersonParamsAddressKanji, + AccountCreatePersonParamsBirthAddress as AccountCreatePersonParamsBirthAddress, AccountCreatePersonParamsDob as AccountCreatePersonParamsDob, AccountCreatePersonParamsDocuments as AccountCreatePersonParamsDocuments, AccountCreatePersonParamsDocumentsCompanyAuthorization as AccountCreatePersonParamsDocumentsCompanyAuthorization, @@ -296,6 +298,7 @@ AccountModifyPersonParamsAddress as AccountModifyPersonParamsAddress, AccountModifyPersonParamsAddressKana as AccountModifyPersonParamsAddressKana, AccountModifyPersonParamsAddressKanji as AccountModifyPersonParamsAddressKanji, + AccountModifyPersonParamsBirthAddress as AccountModifyPersonParamsBirthAddress, AccountModifyPersonParamsDob as AccountModifyPersonParamsDob, AccountModifyPersonParamsDocuments as AccountModifyPersonParamsDocuments, AccountModifyPersonParamsDocumentsCompanyAuthorization as AccountModifyPersonParamsDocumentsCompanyAuthorization, @@ -333,6 +336,7 @@ AccountPersonCreateParamsAddress as AccountPersonCreateParamsAddress, AccountPersonCreateParamsAddressKana as AccountPersonCreateParamsAddressKana, AccountPersonCreateParamsAddressKanji as AccountPersonCreateParamsAddressKanji, + AccountPersonCreateParamsBirthAddress as AccountPersonCreateParamsBirthAddress, AccountPersonCreateParamsDob as AccountPersonCreateParamsDob, AccountPersonCreateParamsDocuments as AccountPersonCreateParamsDocuments, AccountPersonCreateParamsDocumentsCompanyAuthorization as AccountPersonCreateParamsDocumentsCompanyAuthorization, @@ -366,6 +370,7 @@ AccountPersonUpdateParamsAddress as AccountPersonUpdateParamsAddress, AccountPersonUpdateParamsAddressKana as AccountPersonUpdateParamsAddressKana, AccountPersonUpdateParamsAddressKanji as AccountPersonUpdateParamsAddressKanji, + AccountPersonUpdateParamsBirthAddress as AccountPersonUpdateParamsBirthAddress, AccountPersonUpdateParamsDob as AccountPersonUpdateParamsDob, AccountPersonUpdateParamsDocuments as AccountPersonUpdateParamsDocuments, AccountPersonUpdateParamsDocumentsCompanyAuthorization as AccountPersonUpdateParamsDocumentsCompanyAuthorization, @@ -606,6 +611,7 @@ AccountUpdateParamsIndividualAddress as AccountUpdateParamsIndividualAddress, AccountUpdateParamsIndividualAddressKana as AccountUpdateParamsIndividualAddressKana, AccountUpdateParamsIndividualAddressKanji as AccountUpdateParamsIndividualAddressKanji, + AccountUpdateParamsIndividualBirthAddress as AccountUpdateParamsIndividualBirthAddress, AccountUpdateParamsIndividualDob as AccountUpdateParamsIndividualDob, AccountUpdateParamsIndividualRegisteredAddress as AccountUpdateParamsIndividualRegisteredAddress, AccountUpdateParamsIndividualRelationship as AccountUpdateParamsIndividualRelationship, @@ -3034,7 +3040,6 @@ PaymentIntentCreateParamsPaymentMethodOptionsWechatPay as PaymentIntentCreateParamsPaymentMethodOptionsWechatPay, PaymentIntentCreateParamsPaymentMethodOptionsZip as PaymentIntentCreateParamsPaymentMethodOptionsZip, PaymentIntentCreateParamsPaymentsOrchestration as PaymentIntentCreateParamsPaymentsOrchestration, - PaymentIntentCreateParamsPaymentsOrchestrationPaymentDetails as PaymentIntentCreateParamsPaymentsOrchestrationPaymentDetails, PaymentIntentCreateParamsRadarOptions as PaymentIntentCreateParamsRadarOptions, PaymentIntentCreateParamsShipping as PaymentIntentCreateParamsShipping, PaymentIntentCreateParamsShippingAddress as PaymentIntentCreateParamsShippingAddress, @@ -6207,6 +6212,7 @@ TokenCreateParamsAccountIndividualAddress as TokenCreateParamsAccountIndividualAddress, TokenCreateParamsAccountIndividualAddressKana as TokenCreateParamsAccountIndividualAddressKana, TokenCreateParamsAccountIndividualAddressKanji as TokenCreateParamsAccountIndividualAddressKanji, + TokenCreateParamsAccountIndividualBirthAddress as TokenCreateParamsAccountIndividualBirthAddress, TokenCreateParamsAccountIndividualDob as TokenCreateParamsAccountIndividualDob, TokenCreateParamsAccountIndividualRegisteredAddress as TokenCreateParamsAccountIndividualRegisteredAddress, TokenCreateParamsAccountIndividualRelationship as TokenCreateParamsAccountIndividualRelationship, @@ -6225,6 +6231,7 @@ TokenCreateParamsPersonAddress as TokenCreateParamsPersonAddress, TokenCreateParamsPersonAddressKana as TokenCreateParamsPersonAddressKana, TokenCreateParamsPersonAddressKanji as TokenCreateParamsPersonAddressKanji, + TokenCreateParamsPersonBirthAddress as TokenCreateParamsPersonBirthAddress, TokenCreateParamsPersonDob as TokenCreateParamsPersonDob, TokenCreateParamsPersonDocuments as TokenCreateParamsPersonDocuments, TokenCreateParamsPersonDocumentsCompanyAuthorization as TokenCreateParamsPersonDocumentsCompanyAuthorization, @@ -6868,6 +6875,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsIndividualBirthAddress": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsIndividualDob": ( "stripe.params._account_create_params", False, @@ -7032,6 +7043,10 @@ "stripe.params._account_create_person_params", False, ), + "AccountCreatePersonParamsBirthAddress": ( + "stripe.params._account_create_person_params", + False, + ), "AccountCreatePersonParamsDob": ( "stripe.params._account_create_person_params", False, @@ -7211,6 +7226,10 @@ "stripe.params._account_modify_person_params", False, ), + "AccountModifyPersonParamsBirthAddress": ( + "stripe.params._account_modify_person_params", + False, + ), "AccountModifyPersonParamsDob": ( "stripe.params._account_modify_person_params", False, @@ -7319,6 +7338,10 @@ "stripe.params._account_person_create_params", False, ), + "AccountPersonCreateParamsBirthAddress": ( + "stripe.params._account_person_create_params", + False, + ), "AccountPersonCreateParamsDob": ( "stripe.params._account_person_create_params", False, @@ -7419,6 +7442,10 @@ "stripe.params._account_person_update_params", False, ), + "AccountPersonUpdateParamsBirthAddress": ( + "stripe.params._account_person_update_params", + False, + ), "AccountPersonUpdateParamsDob": ( "stripe.params._account_person_update_params", False, @@ -8276,6 +8303,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsIndividualBirthAddress": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsIndividualDob": ( "stripe.params._account_update_params", False, @@ -16176,10 +16207,6 @@ "stripe.params._payment_intent_create_params", False, ), - "PaymentIntentCreateParamsPaymentsOrchestrationPaymentDetails": ( - "stripe.params._payment_intent_create_params", - False, - ), "PaymentIntentCreateParamsRadarOptions": ( "stripe.params._payment_intent_create_params", False, @@ -27091,6 +27118,10 @@ "stripe.params._token_create_params", False, ), + "TokenCreateParamsAccountIndividualBirthAddress": ( + "stripe.params._token_create_params", + False, + ), "TokenCreateParamsAccountIndividualDob": ( "stripe.params._token_create_params", False, @@ -27157,6 +27188,10 @@ "stripe.params._token_create_params", False, ), + "TokenCreateParamsPersonBirthAddress": ( + "stripe.params._token_create_params", + False, + ), "TokenCreateParamsPersonDob": ( "stripe.params._token_create_params", False, diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index 2cc1947bf..dcd7a7d4a 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -1799,6 +1799,7 @@ class AccountCreateParamsIndividual(TypedDict): """ The Kanji variation of the individual's primary address (Japan only). """ + birth_address: NotRequired["AccountCreateParamsIndividualBirthAddress"] dob: NotRequired["Literal['']|AccountCreateParamsIndividualDob"] """ The individual's date of birth. @@ -1986,6 +1987,33 @@ class AccountCreateParamsIndividualAddressKanji(TypedDict): """ +class AccountCreateParamsIndividualBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountCreateParamsIndividualDob(TypedDict): day: int """ diff --git a/stripe/params/_account_create_person_params.py b/stripe/params/_account_create_person_params.py index de746c4f6..38dbe8edb 100644 --- a/stripe/params/_account_create_person_params.py +++ b/stripe/params/_account_create_person_params.py @@ -25,6 +25,10 @@ class AccountCreatePersonParams(RequestOptions): """ The Kanji variation of the person's address (Japan only). """ + birth_address: NotRequired["AccountCreatePersonParamsBirthAddress"] + """ + The person's place of birth. + """ dob: NotRequired["Literal['']|AccountCreatePersonParamsDob"] """ The person's date of birth. @@ -256,6 +260,33 @@ class AccountCreatePersonParamsAddressKanji(TypedDict): """ +class AccountCreatePersonParamsBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountCreatePersonParamsDob(TypedDict): day: int """ diff --git a/stripe/params/_account_modify_person_params.py b/stripe/params/_account_modify_person_params.py index 2dbc4641a..2b7140d9d 100644 --- a/stripe/params/_account_modify_person_params.py +++ b/stripe/params/_account_modify_person_params.py @@ -25,6 +25,10 @@ class AccountModifyPersonParams(RequestOptions): """ The Kanji variation of the person's address (Japan only). """ + birth_address: NotRequired["AccountModifyPersonParamsBirthAddress"] + """ + The person's place of birth. + """ dob: NotRequired["Literal['']|AccountModifyPersonParamsDob"] """ The person's date of birth. @@ -256,6 +260,33 @@ class AccountModifyPersonParamsAddressKanji(TypedDict): """ +class AccountModifyPersonParamsBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountModifyPersonParamsDob(TypedDict): day: int """ diff --git a/stripe/params/_account_person_create_params.py b/stripe/params/_account_person_create_params.py index f23f48e23..03f2eedb0 100644 --- a/stripe/params/_account_person_create_params.py +++ b/stripe/params/_account_person_create_params.py @@ -24,6 +24,10 @@ class AccountPersonCreateParams(TypedDict): """ The Kanji variation of the person's address (Japan only). """ + birth_address: NotRequired["AccountPersonCreateParamsBirthAddress"] + """ + The person's place of birth. + """ dob: NotRequired["Literal['']|AccountPersonCreateParamsDob"] """ The person's date of birth. @@ -255,6 +259,33 @@ class AccountPersonCreateParamsAddressKanji(TypedDict): """ +class AccountPersonCreateParamsBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountPersonCreateParamsDob(TypedDict): day: int """ diff --git a/stripe/params/_account_person_update_params.py b/stripe/params/_account_person_update_params.py index f7e09662e..e980b0ced 100644 --- a/stripe/params/_account_person_update_params.py +++ b/stripe/params/_account_person_update_params.py @@ -24,6 +24,10 @@ class AccountPersonUpdateParams(TypedDict): """ The Kanji variation of the person's address (Japan only). """ + birth_address: NotRequired["AccountPersonUpdateParamsBirthAddress"] + """ + The person's place of birth. + """ dob: NotRequired["Literal['']|AccountPersonUpdateParamsDob"] """ The person's date of birth. @@ -255,6 +259,33 @@ class AccountPersonUpdateParamsAddressKanji(TypedDict): """ +class AccountPersonUpdateParamsBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountPersonUpdateParamsDob(TypedDict): day: int """ diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index 14ae5802a..74c105fbb 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -1711,6 +1711,7 @@ class AccountUpdateParamsIndividual(TypedDict): """ The Kanji variation of the individual's primary address (Japan only). """ + birth_address: NotRequired["AccountUpdateParamsIndividualBirthAddress"] dob: NotRequired["Literal['']|AccountUpdateParamsIndividualDob"] """ The individual's date of birth. @@ -1898,6 +1899,33 @@ class AccountUpdateParamsIndividualAddressKanji(TypedDict): """ +class AccountUpdateParamsIndividualBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountUpdateParamsIndividualDob(TypedDict): day: int """ diff --git a/stripe/params/_charge_capture_params.py b/stripe/params/_charge_capture_params.py index b8b9953d5..235308b0a 100644 --- a/stripe/params/_charge_capture_params.py +++ b/stripe/params/_charge_capture_params.py @@ -1970,7 +1970,9 @@ class ChargeCaptureParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ diff --git a/stripe/params/_charge_modify_params.py b/stripe/params/_charge_modify_params.py index 779a7f6db..7e082e44b 100644 --- a/stripe/params/_charge_modify_params.py +++ b/stripe/params/_charge_modify_params.py @@ -1970,7 +1970,9 @@ class ChargeModifyParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ diff --git a/stripe/params/_charge_update_params.py b/stripe/params/_charge_update_params.py index ae7243afe..a6a7410a9 100644 --- a/stripe/params/_charge_update_params.py +++ b/stripe/params/_charge_update_params.py @@ -1969,7 +1969,9 @@ class ChargeUpdateParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ diff --git a/stripe/params/_payment_intent_capture_params.py b/stripe/params/_payment_intent_capture_params.py index 9ce2f8911..9ff79a198 100644 --- a/stripe/params/_payment_intent_capture_params.py +++ b/stripe/params/_payment_intent_capture_params.py @@ -2382,7 +2382,9 @@ class PaymentIntentCaptureParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 70f7bdb41..e9fbdf397 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -2614,7 +2614,9 @@ class PaymentIntentConfirmParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ @@ -4750,6 +4752,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardPaymentDetailsMoneyServi class PaymentIntentConfirmParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5021,6 +5029,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardPresentPaymentDetailsMon class PaymentIntentConfirmParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5171,6 +5185,10 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions( """ The blockchain networks to support for deposits. Learn more about [supported networks and tokens](https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support). """ + static_address: NotRequired[bool] + """ + If true, provisions a permanent per-customer deposit address reused across PaymentIntents. + """ class PaymentIntentConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 49a200d80..cbb08f93d 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -2748,7 +2748,9 @@ class PaymentIntentCreateParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ @@ -4874,6 +4876,12 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServic class PaymentIntentCreateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5143,6 +5151,12 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardPresentPaymentDetailsMone class PaymentIntentCreateParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5293,6 +5307,10 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions( """ The blockchain networks to support for deposits. Learn more about [supported networks and tokens](https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support). """ + static_address: NotRequired[bool] + """ + If true, provisions a permanent per-customer deposit address reused across PaymentIntents. + """ class PaymentIntentCreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): @@ -7693,16 +7711,7 @@ class PaymentIntentCreateParamsPaymentsOrchestration(TypedDict): """ Whether this feature is enabled. """ - payment_details: NotRequired[ - "PaymentIntentCreateParamsPaymentsOrchestrationPaymentDetails" - ] - """ - Payment-level details for the orchestrated payment. - """ - - -class PaymentIntentCreateParamsPaymentsOrchestrationPaymentDetails(TypedDict): - reference: NotRequired[str] + payment_reference: NotRequired[str] """ Merchant-provided reference for this payment, used for reconciliation. """ diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 548690d2e..41ec6baa7 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -2597,7 +2597,9 @@ class PaymentIntentModifyParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ @@ -4723,6 +4725,12 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardPaymentDetailsMoneyServic class PaymentIntentModifyParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -4992,6 +5000,12 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardPresentPaymentDetailsMone class PaymentIntentModifyParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5142,6 +5156,10 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions( """ The blockchain networks to support for deposits. Learn more about [supported networks and tokens](https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support). """ + static_address: NotRequired[bool] + """ + If true, provisions a permanent per-customer deposit address reused across PaymentIntents. + """ class PaymentIntentModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 7d5cbfd06..77c791986 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -2596,7 +2596,9 @@ class PaymentIntentUpdateParamsPaymentDetailsMoneyServices(TypedDict): """ Account funding transaction details including sender and beneficiary information. """ - transaction_type: NotRequired["Literal['']|Literal['account_funding']"] + transaction_type: NotRequired[ + "Literal['']|Literal['account_funding', 'debt_repayment']" + ] """ The type of money services transaction. """ @@ -4722,6 +4724,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServic class PaymentIntentUpdateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -4991,6 +4999,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardPresentPaymentDetailsMone class PaymentIntentUpdateParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFunding( TypedDict, ): + digital_asset_category: NotRequired[ + Literal["blockchain_native", "nft", "other_non_fiat", "stablecoin"] + ] + """ + The category of digital asset being acquired through this account funding transaction. + """ liquid_asset: NotRequired[ "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAsset" ] @@ -5141,6 +5155,10 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions( """ The blockchain networks to support for deposits. Learn more about [supported networks and tokens](https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support). """ + static_address: NotRequired[bool] + """ + If true, provisions a permanent per-customer deposit address reused across PaymentIntents. + """ class PaymentIntentUpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): diff --git a/stripe/params/_payment_location_capability_list_params.py b/stripe/params/_payment_location_capability_list_params.py index 8ab0aaf94..9efefd364 100644 --- a/stripe/params/_payment_location_capability_list_params.py +++ b/stripe/params/_payment_location_capability_list_params.py @@ -12,5 +12,5 @@ class PaymentLocationCapabilityListParams(RequestOptions): """ location: str """ - The location for which the capabilities enable functionality. + The payment location that the capabilities enable functionality for. """ diff --git a/stripe/params/_payment_location_capability_modify_params.py b/stripe/params/_payment_location_capability_modify_params.py index f7c2aee9b..108a9ff7a 100644 --- a/stripe/params/_payment_location_capability_modify_params.py +++ b/stripe/params/_payment_location_capability_modify_params.py @@ -12,7 +12,7 @@ class PaymentLocationCapabilityModifyParams(RequestOptions): """ location: str """ - The location for which the capability enables functionality. + The location that the capability enables functionality for. """ requested: bool """ diff --git a/stripe/params/_payment_location_capability_retrieve_params.py b/stripe/params/_payment_location_capability_retrieve_params.py index edd4eb2dd..7de0ba121 100644 --- a/stripe/params/_payment_location_capability_retrieve_params.py +++ b/stripe/params/_payment_location_capability_retrieve_params.py @@ -12,5 +12,5 @@ class PaymentLocationCapabilityRetrieveParams(RequestOptions): """ location: str """ - The payment location for which the capability enables functionality. + The payment location that the capability enables functionality for. """ diff --git a/stripe/params/_payment_location_capability_update_params.py b/stripe/params/_payment_location_capability_update_params.py index 350bff09b..630dce9da 100644 --- a/stripe/params/_payment_location_capability_update_params.py +++ b/stripe/params/_payment_location_capability_update_params.py @@ -11,7 +11,7 @@ class PaymentLocationCapabilityUpdateParams(TypedDict): """ location: str """ - The location for which the capability enables functionality. + The location that the capability enables functionality for. """ requested: bool """ diff --git a/stripe/params/_payment_location_list_params.py b/stripe/params/_payment_location_list_params.py index 55fed8c0c..2a4b3584a 100644 --- a/stripe/params/_payment_location_list_params.py +++ b/stripe/params/_payment_location_list_params.py @@ -6,7 +6,19 @@ class PaymentLocationListParams(RequestOptions): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ diff --git a/stripe/params/_payment_location_modify_params.py b/stripe/params/_payment_location_modify_params.py index 7a8c9cd36..6dcb29b00 100644 --- a/stripe/params/_payment_location_modify_params.py +++ b/stripe/params/_payment_location_modify_params.py @@ -26,7 +26,7 @@ class PaymentLocationModifyParams(RequestOptions): """ onboarding_data_update_acknowledged: NotRequired[bool] """ - Pass true when updating location fields that will trigger onboarding review for any of the location's active location capabilities. If this parameter is not set to true, updates that would trigger onboarding review will fail. Only applicable for locations with active location capabilities. + Pass true when updating location fields that trigger onboarding review for any of the location's active location capabilities. If this parameter isn't set to true, updates that would trigger onboarding review fail. Only applicable for locations with active location capabilities. """ diff --git a/stripe/params/_payment_location_update_params.py b/stripe/params/_payment_location_update_params.py index a4eec5797..22fb4a6f5 100644 --- a/stripe/params/_payment_location_update_params.py +++ b/stripe/params/_payment_location_update_params.py @@ -25,7 +25,7 @@ class PaymentLocationUpdateParams(TypedDict): """ onboarding_data_update_acknowledged: NotRequired[bool] """ - Pass true when updating location fields that will trigger onboarding review for any of the location's active location capabilities. If this parameter is not set to true, updates that would trigger onboarding review will fail. Only applicable for locations with active location capabilities. + Pass true when updating location fields that trigger onboarding review for any of the location's active location capabilities. If this parameter isn't set to true, updates that would trigger onboarding review fail. Only applicable for locations with active location capabilities. """ diff --git a/stripe/params/_token_create_params.py b/stripe/params/_token_create_params.py index 93262def6..dd55a707c 100644 --- a/stripe/params/_token_create_params.py +++ b/stripe/params/_token_create_params.py @@ -357,6 +357,9 @@ class TokenCreateParamsAccountIndividual(TypedDict): """ The Kanji variation of the individual's primary address (Japan only). """ + birth_address: NotRequired[ + "TokenCreateParamsAccountIndividualBirthAddress" + ] dob: NotRequired["Literal['']|TokenCreateParamsAccountIndividualDob"] """ The individual's date of birth. @@ -544,6 +547,33 @@ class TokenCreateParamsAccountIndividualAddressKanji(TypedDict): """ +class TokenCreateParamsAccountIndividualBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class TokenCreateParamsAccountIndividualDob(TypedDict): day: int """ @@ -795,6 +825,10 @@ class TokenCreateParamsPerson(TypedDict): """ The Kanji variation of the person's address (Japan only). """ + birth_address: NotRequired["TokenCreateParamsPersonBirthAddress"] + """ + The person's place of birth. + """ dob: NotRequired["Literal['']|TokenCreateParamsPersonDob"] """ The person's date of birth. @@ -1016,6 +1050,33 @@ class TokenCreateParamsPersonAddressKanji(TypedDict): """ +class TokenCreateParamsPersonBirthAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class TokenCreateParamsPersonDob(TypedDict): day: int """ diff --git a/stripe/params/delegated_checkout/__init__.py b/stripe/params/delegated_checkout/__init__.py index 8df7dcf2b..3af5ba9c7 100644 --- a/stripe/params/delegated_checkout/__init__.py +++ b/stripe/params/delegated_checkout/__init__.py @@ -4,6 +4,9 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.delegated_checkout._order_retrieve_params import ( + OrderRetrieveParams as OrderRetrieveParams, + ) from stripe.params.delegated_checkout._requested_session_confirm_params import ( RequestedSessionConfirmParams as RequestedSessionConfirmParams, RequestedSessionConfirmParamsAffiliateAttribution as RequestedSessionConfirmParamsAffiliateAttribution, @@ -29,6 +32,9 @@ from stripe.params.delegated_checkout._requested_session_expire_params import ( RequestedSessionExpireParams as RequestedSessionExpireParams, ) + from stripe.params.delegated_checkout._requested_session_list_orders_params import ( + RequestedSessionListOrdersParams as RequestedSessionListOrdersParams, + ) from stripe.params.delegated_checkout._requested_session_modify_params import ( RequestedSessionModifyParams as RequestedSessionModifyParams, RequestedSessionModifyParamsDiscounts as RequestedSessionModifyParamsDiscounts, @@ -44,6 +50,9 @@ RequestedSessionModifyParamsPaymentMethodOptions as RequestedSessionModifyParamsPaymentMethodOptions, RequestedSessionModifyParamsPaymentMethodOptionsCard as RequestedSessionModifyParamsPaymentMethodOptionsCard, ) + from stripe.params.delegated_checkout._requested_session_order_list_params import ( + RequestedSessionOrderListParams as RequestedSessionOrderListParams, + ) from stripe.params.delegated_checkout._requested_session_retrieve_params import ( RequestedSessionRetrieveParams as RequestedSessionRetrieveParams, ) @@ -65,6 +74,10 @@ # name -> (import_target, is_submodule) _import_map = { + "OrderRetrieveParams": ( + "stripe.params.delegated_checkout._order_retrieve_params", + False, + ), "RequestedSessionConfirmParams": ( "stripe.params.delegated_checkout._requested_session_confirm_params", False, @@ -141,6 +154,10 @@ "stripe.params.delegated_checkout._requested_session_expire_params", False, ), + "RequestedSessionListOrdersParams": ( + "stripe.params.delegated_checkout._requested_session_list_orders_params", + False, + ), "RequestedSessionModifyParams": ( "stripe.params.delegated_checkout._requested_session_modify_params", False, @@ -193,6 +210,10 @@ "stripe.params.delegated_checkout._requested_session_modify_params", False, ), + "RequestedSessionOrderListParams": ( + "stripe.params.delegated_checkout._requested_session_order_list_params", + False, + ), "RequestedSessionRetrieveParams": ( "stripe.params.delegated_checkout._requested_session_retrieve_params", False, diff --git a/stripe/params/delegated_checkout/_order_retrieve_params.py b/stripe/params/delegated_checkout/_order_retrieve_params.py new file mode 100644 index 000000000..9364635f9 --- /dev/null +++ b/stripe/params/delegated_checkout/_order_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class OrderRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/delegated_checkout/_requested_session_list_orders_params.py b/stripe/params/delegated_checkout/_requested_session_list_orders_params.py new file mode 100644 index 000000000..9f5b31eb6 --- /dev/null +++ b/stripe/params/delegated_checkout/_requested_session_list_orders_params.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class RequestedSessionListOrdersParams(RequestOptions): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ diff --git a/stripe/params/delegated_checkout/_requested_session_order_list_params.py b/stripe/params/delegated_checkout/_requested_session_order_list_params.py new file mode 100644 index 000000000..d48fb08b4 --- /dev/null +++ b/stripe/params/delegated_checkout/_requested_session_order_list_params.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class RequestedSessionOrderListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ diff --git a/stripe/params/radar/_issuing_authorization_evaluation_create_params.py b/stripe/params/radar/_issuing_authorization_evaluation_create_params.py index 615b94d9d..89487a9cd 100644 --- a/stripe/params/radar/_issuing_authorization_evaluation_create_params.py +++ b/stripe/params/radar/_issuing_authorization_evaluation_create_params.py @@ -142,7 +142,7 @@ class IssuingAuthorizationEvaluationCreateParamsCardDetails(TypedDict): """ The timestamp when the card was created, as a Unix timestamp in seconds. """ - last4: NotRequired[str] + last4: str """ The last 4 digits of the card number. """ diff --git a/stripe/params/v2/__init__.py b/stripe/params/v2/__init__.py index 1012812f5..07d776b43 100644 --- a/stripe/params/v2/__init__.py +++ b/stripe/params/v2/__init__.py @@ -14,6 +14,7 @@ orchestrated_commerce as orchestrated_commerce, payments as payments, reporting as reporting, + signals as signals, tax as tax, test_helpers as test_helpers, ) @@ -29,6 +30,7 @@ "orchestrated_commerce": ("stripe.params.v2.orchestrated_commerce", True), "payments": ("stripe.params.v2.payments", True), "reporting": ("stripe.params.v2.reporting", True), + "signals": ("stripe.params.v2.signals", True), "tax": ("stripe.params.v2.tax", True), "test_helpers": ("stripe.params.v2.test_helpers", True), } diff --git a/stripe/params/v2/billing/__init__.py b/stripe/params/v2/billing/__init__.py index c08351bba..175164cab 100644 --- a/stripe/params/v2/billing/__init__.py +++ b/stripe/params/v2/billing/__init__.py @@ -110,6 +110,101 @@ CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, ) + from stripe.params.v2.billing._contract_activate_params import ( + ContractActivateParams as ContractActivateParams, + ) + from stripe.params.v2.billing._contract_cancel_params import ( + ContractCancelParams as ContractCancelParams, + ) + from stripe.params.v2.billing._contract_create_params import ( + ContractCreateParams as ContractCreateParams, + ContractCreateParamsBillingSettings as ContractCreateParamsBillingSettings, + ContractCreateParamsBillingSettingsContractBillingDetails as ContractCreateParamsBillingSettingsContractBillingDetails, + ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetails as ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetails, + ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation as ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation, + ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax as ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax, + ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice as ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice, + ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue as ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue, + ContractCreateParamsBillingSettingsContractBillingDetailsBillingProfileDetails as ContractCreateParamsBillingSettingsContractBillingDetailsBillingProfileDetails, + ContractCreateParamsBillingSettingsContractBillingDetailsCollectionSettingsDetails as ContractCreateParamsBillingSettingsContractBillingDetailsCollectionSettingsDetails, + ContractCreateParamsContractLine as ContractCreateParamsContractLine, + ContractCreateParamsContractLineEndsAt as ContractCreateParamsContractLineEndsAt, + ContractCreateParamsContractLineOverride as ContractCreateParamsContractLineOverride, + ContractCreateParamsContractLineOverrideEndsAt as ContractCreateParamsContractLineOverrideEndsAt, + ContractCreateParamsContractLineOverrideServiceAction as ContractCreateParamsContractLineOverrideServiceAction, + ContractCreateParamsContractLineOverrideServiceActionAdd as ContractCreateParamsContractLineOverrideServiceActionAdd, + ContractCreateParamsContractLineOverrideServiceActionAddCreditGrant as ContractCreateParamsContractLineOverrideServiceActionAddCreditGrant, + ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantAmount as ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantAmount, + ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfig as ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfig, + ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScope as ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScope, + ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantExpiryConfig as ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantExpiryConfig, + ContractCreateParamsContractLineOverrideServiceActionReplace as ContractCreateParamsContractLineOverrideServiceActionReplace, + ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrant as ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrant, + ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantAmount as ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantAmount, + ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfig as ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfig, + ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope as ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope, + ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantExpiryConfig as ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantExpiryConfig, + ContractCreateParamsContractLineOverrideStartsAt as ContractCreateParamsContractLineOverrideStartsAt, + ContractCreateParamsContractLinePricing as ContractCreateParamsContractLinePricing, + ContractCreateParamsContractLineStartsAt as ContractCreateParamsContractLineStartsAt, + ContractCreateParamsLicenseQuantityAction as ContractCreateParamsLicenseQuantityAction, + ContractCreateParamsLicenseQuantityActionEffectiveAt as ContractCreateParamsLicenseQuantityActionEffectiveAt, + ContractCreateParamsLicenseQuantityActionSet as ContractCreateParamsLicenseQuantityActionSet, + ContractCreateParamsOneTimeFee as ContractCreateParamsOneTimeFee, + ContractCreateParamsOneTimeFeeBillSchedule as ContractCreateParamsOneTimeFeeBillSchedule, + ContractCreateParamsOneTimeFeeBillScheduleBillAt as ContractCreateParamsOneTimeFeeBillScheduleBillAt, + ContractCreateParamsOneTimeFeeProductDetails as ContractCreateParamsOneTimeFeeProductDetails, + ContractCreateParamsPricingLine as ContractCreateParamsPricingLine, + ContractCreateParamsPricingLineEndsAt as ContractCreateParamsPricingLineEndsAt, + ContractCreateParamsPricingLinePricing as ContractCreateParamsPricingLinePricing, + ContractCreateParamsPricingLinePricingPriceDetails as ContractCreateParamsPricingLinePricingPriceDetails, + ContractCreateParamsPricingLineStartsAt as ContractCreateParamsPricingLineStartsAt, + ContractCreateParamsPricingOverride as ContractCreateParamsPricingOverride, + ContractCreateParamsPricingOverrideEndsAt as ContractCreateParamsPricingOverrideEndsAt, + ContractCreateParamsPricingOverrideMultiplier as ContractCreateParamsPricingOverrideMultiplier, + ContractCreateParamsPricingOverrideMultiplierCriterion as ContractCreateParamsPricingOverrideMultiplierCriterion, + ContractCreateParamsPricingOverrideMultiplierCriterionMetadataCondition as ContractCreateParamsPricingOverrideMultiplierCriterionMetadataCondition, + ContractCreateParamsPricingOverrideMultiplierCriterionMetadataConditionAllOf as ContractCreateParamsPricingOverrideMultiplierCriterionMetadataConditionAllOf, + ContractCreateParamsPricingOverrideOverwritePrice as ContractCreateParamsPricingOverrideOverwritePrice, + ContractCreateParamsPricingOverrideOverwritePriceTier as ContractCreateParamsPricingOverrideOverwritePriceTier, + ContractCreateParamsPricingOverrideStartsAt as ContractCreateParamsPricingOverrideStartsAt, + ) + from stripe.params.v2.billing._contract_list_params import ( + ContractListParams as ContractListParams, + ) + from stripe.params.v2.billing._contract_retrieve_params import ( + ContractRetrieveParams as ContractRetrieveParams, + ) + from stripe.params.v2.billing._contract_update_params import ( + ContractUpdateParams as ContractUpdateParams, + ContractUpdateParamsLicenseQuantityAction as ContractUpdateParamsLicenseQuantityAction, + ContractUpdateParamsLicenseQuantityActionEffectiveAt as ContractUpdateParamsLicenseQuantityActionEffectiveAt, + ContractUpdateParamsLicenseQuantityActionSet as ContractUpdateParamsLicenseQuantityActionSet, + ContractUpdateParamsPricingLineAction as ContractUpdateParamsPricingLineAction, + ContractUpdateParamsPricingLineActionAdd as ContractUpdateParamsPricingLineActionAdd, + ContractUpdateParamsPricingLineActionAddEndsAt as ContractUpdateParamsPricingLineActionAddEndsAt, + ContractUpdateParamsPricingLineActionAddPricing as ContractUpdateParamsPricingLineActionAddPricing, + ContractUpdateParamsPricingLineActionAddPricingPriceDetails as ContractUpdateParamsPricingLineActionAddPricingPriceDetails, + ContractUpdateParamsPricingLineActionAddStartsAt as ContractUpdateParamsPricingLineActionAddStartsAt, + ContractUpdateParamsPricingLineActionRemove as ContractUpdateParamsPricingLineActionRemove, + ContractUpdateParamsPricingLineActionUpdate as ContractUpdateParamsPricingLineActionUpdate, + ContractUpdateParamsPricingLineActionUpdateEndsAt as ContractUpdateParamsPricingLineActionUpdateEndsAt, + ContractUpdateParamsPricingLineActionUpdateStartsAt as ContractUpdateParamsPricingLineActionUpdateStartsAt, + ContractUpdateParamsPricingOverrideAction as ContractUpdateParamsPricingOverrideAction, + ContractUpdateParamsPricingOverrideActionAdd as ContractUpdateParamsPricingOverrideActionAdd, + ContractUpdateParamsPricingOverrideActionAddEndsAt as ContractUpdateParamsPricingOverrideActionAddEndsAt, + ContractUpdateParamsPricingOverrideActionAddMultiplier as ContractUpdateParamsPricingOverrideActionAddMultiplier, + ContractUpdateParamsPricingOverrideActionAddMultiplierCriterion as ContractUpdateParamsPricingOverrideActionAddMultiplierCriterion, + ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataCondition as ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataCondition, + ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataConditionAllOf as ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataConditionAllOf, + ContractUpdateParamsPricingOverrideActionAddOverwritePrice as ContractUpdateParamsPricingOverrideActionAddOverwritePrice, + ContractUpdateParamsPricingOverrideActionAddOverwritePriceTier as ContractUpdateParamsPricingOverrideActionAddOverwritePriceTier, + ContractUpdateParamsPricingOverrideActionAddStartsAt as ContractUpdateParamsPricingOverrideActionAddStartsAt, + ContractUpdateParamsPricingOverrideActionRemove as ContractUpdateParamsPricingOverrideActionRemove, + ContractUpdateParamsPricingOverrideActionUpdate as ContractUpdateParamsPricingOverrideActionUpdate, + ContractUpdateParamsPricingOverrideActionUpdateEndsAt as ContractUpdateParamsPricingOverrideActionUpdateEndsAt, + ContractUpdateParamsPricingOverrideActionUpdateStartsAt as ContractUpdateParamsPricingOverrideActionUpdateStartsAt, + ) from stripe.params.v2.billing._custom_pricing_unit_create_params import ( CustomPricingUnitCreateParams as CustomPricingUnitCreateParams, ) @@ -668,6 +763,338 @@ "stripe.params.v2.billing._collection_setting_update_params", False, ), + "ContractActivateParams": ( + "stripe.params.v2.billing._contract_activate_params", + False, + ), + "ContractCancelParams": ( + "stripe.params.v2.billing._contract_cancel_params", + False, + ), + "ContractCreateParams": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettings": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsBillingProfileDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsBillingSettingsContractBillingDetailsCollectionSettingsDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLine": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineEndsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverride": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideEndsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceAction": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAdd": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrant": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantAmount": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfig": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScope": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantExpiryConfig": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplace": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrant": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantAmount": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfig": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantExpiryConfig": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineOverrideStartsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLinePricing": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsContractLineStartsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsLicenseQuantityAction": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsLicenseQuantityActionEffectiveAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsLicenseQuantityActionSet": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsOneTimeFee": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsOneTimeFeeBillSchedule": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsOneTimeFeeBillScheduleBillAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsOneTimeFeeProductDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingLine": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingLineEndsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingLinePricing": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingLinePricingPriceDetails": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingLineStartsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverride": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideEndsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideMultiplier": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideMultiplierCriterion": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideMultiplierCriterionMetadataCondition": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideMultiplierCriterionMetadataConditionAllOf": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideOverwritePrice": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideOverwritePriceTier": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractCreateParamsPricingOverrideStartsAt": ( + "stripe.params.v2.billing._contract_create_params", + False, + ), + "ContractListParams": ( + "stripe.params.v2.billing._contract_list_params", + False, + ), + "ContractRetrieveParams": ( + "stripe.params.v2.billing._contract_retrieve_params", + False, + ), + "ContractUpdateParams": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsLicenseQuantityAction": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsLicenseQuantityActionEffectiveAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsLicenseQuantityActionSet": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineAction": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionAdd": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionAddEndsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionAddPricing": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionAddPricingPriceDetails": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionAddStartsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionRemove": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionUpdate": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionUpdateEndsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingLineActionUpdateStartsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideAction": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAdd": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddEndsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddMultiplier": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterion": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataCondition": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataConditionAllOf": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddOverwritePrice": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddOverwritePriceTier": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionAddStartsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionRemove": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionUpdate": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionUpdateEndsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), + "ContractUpdateParamsPricingOverrideActionUpdateStartsAt": ( + "stripe.params.v2.billing._contract_update_params", + False, + ), "CustomPricingUnitCreateParams": ( "stripe.params.v2.billing._custom_pricing_unit_create_params", False, diff --git a/stripe/params/v2/billing/_contract_activate_params.py b/stripe/params/v2/billing/_contract_activate_params.py new file mode 100644 index 000000000..d44668fe3 --- /dev/null +++ b/stripe/params/v2/billing/_contract_activate_params.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ContractActivateParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "contract_line_details", + "license_quantities", + "one_time_fees", + "pricing_lines", + "pricing_overrides", + ] + ] + ] + """ + Additional fields to include in the response. + """ diff --git a/stripe/params/v2/billing/_contract_cancel_params.py b/stripe/params/v2/billing/_contract_cancel_params.py new file mode 100644 index 000000000..70d0e0f6c --- /dev/null +++ b/stripe/params/v2/billing/_contract_cancel_params.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ContractCancelParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "contract_line_details", + "license_quantities", + "one_time_fees", + "pricing_lines", + "pricing_overrides", + ] + ] + ] + """ + Additional fields to include in the response. + """ diff --git a/stripe/params/v2/billing/_contract_create_params.py b/stripe/params/v2/billing/_contract_create_params.py new file mode 100644 index 000000000..4f25c186a --- /dev/null +++ b/stripe/params/v2/billing/_contract_create_params.py @@ -0,0 +1,787 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from decimal import Decimal +from stripe._stripe_object import UntypedStripeObject +from stripe.v2._amount import AmountParam +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ContractCreateParams(TypedDict): + billing_settings: NotRequired["ContractCreateParamsBillingSettings"] + """ + The billing settings for the contract. + """ + contract_lines: List["ContractCreateParamsContractLine"] + """ + A list of contract lines to create with the contract. + """ + contract_number: str + """ + A unique user-provided contract number e.g. C-2026-0001. + """ + currency: str + """ + Currency of the contract. + """ + include: NotRequired[ + List[ + Literal[ + "contract_line_details", + "license_quantities", + "one_time_fees", + "pricing_lines", + "pricing_overrides", + ] + ] + ] + """ + Additional fields to include in the response. + """ + license_quantity_actions: List["ContractCreateParamsLicenseQuantityAction"] + """ + A list of license quantity actions to create with the contract. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of key-value pairs that you can attach to an object. + """ + one_time_fees: NotRequired[List["ContractCreateParamsOneTimeFee"]] + """ + A list of one-time fees to create with the contract. Each fee is billed as individual invoice items per its bill_schedule. + """ + pricing_lines: List["ContractCreateParamsPricingLine"] + """ + A list of pricing lines to create with the contract. + """ + pricing_overrides: List["ContractCreateParamsPricingOverride"] + """ + A list of pricing overrides to create with the contract. + """ + + +class ContractCreateParamsBillingSettings(TypedDict): + contract_billing_details: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetails" + ] + """ + Billing settings details for the contract. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetails(TypedDict): + bill_settings_details: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetails" + ] + """ + The bill settings details. + """ + billing_profile_details: "ContractCreateParamsBillingSettingsContractBillingDetailsBillingProfileDetails" + """ + The billing profile details. + """ + collection_settings_details: "ContractCreateParamsBillingSettingsContractBillingDetailsCollectionSettingsDetails" + """ + The collection settings details. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetails( + TypedDict, +): + calculation: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation" + ] + """ + Calculation settings. + """ + invoice: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice" + ] + """ + Invoice settings. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculation( + TypedDict, +): + tax: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax" + ] + """ + Tax calculation settings. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsCalculationTax( + TypedDict, +): + type: Literal["automatic", "manual"] + """ + The type of tax calculation. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoice( + TypedDict, +): + time_until_due: NotRequired[ + "ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue" + ] + """ + The number of time units before the invoice is past due. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillSettingsDetailsInvoiceTimeUntilDue( + TypedDict, +): + interval: Literal["day", "month", "week", "year"] + """ + The interval unit. + """ + interval_count: int + """ + The number of intervals. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsBillingProfileDetails( + TypedDict, +): + customer: str + """ + The customer who pays for the contract invoice. + """ + default_payment_method: NotRequired[str] + """ + The default payment method for the contract. + """ + + +class ContractCreateParamsBillingSettingsContractBillingDetailsCollectionSettingsDetails( + TypedDict, +): + collection_method: Literal["charge_automatically", "send_invoice"] + """ + The collection method. + """ + payment_method_configuration: NotRequired[str] + """ + The payment method configuration. + """ + + +class ContractCreateParamsContractLine(TypedDict): + ends_at: "ContractCreateParamsContractLineEndsAt" + """ + Timestamp to indicate when the contract line ends. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of key-value pairs that you can attach to an object. + """ + overrides: List["ContractCreateParamsContractLineOverride"] + """ + List of overrides. Later overrides in the list override earlier ones. + """ + pricing: "ContractCreateParamsContractLinePricing" + """ + The pricing configuration for the contract line. + """ + starts_at: "ContractCreateParamsContractLineStartsAt" + """ + Timestamp to indicate when the contract line starts. + """ + + +class ContractCreateParamsContractLineEndsAt(TypedDict): + timestamp: str + """ + The timestamp when the item ends. + """ + + +class ContractCreateParamsContractLineOverride(TypedDict): + ends_at: "ContractCreateParamsContractLineOverrideEndsAt" + """ + Timestamp to indicate when the override ends. + """ + service_action: NotRequired[ + "ContractCreateParamsContractLineOverrideServiceAction" + ] + """ + Service action override parameters. Required if `type` is `service_action`. + """ + starts_at: "ContractCreateParamsContractLineOverrideStartsAt" + """ + Timestamp to indicate when the override starts. + """ + type: Literal["service_action"] + """ + The type of the override. + """ + + +class ContractCreateParamsContractLineOverrideEndsAt(TypedDict): + timestamp: str + """ + The timestamp when the item ends. + """ + + +class ContractCreateParamsContractLineOverrideServiceAction(TypedDict): + add: NotRequired[ + "ContractCreateParamsContractLineOverrideServiceActionAdd" + ] + """ + Parameters for adding a new service action. + """ + replace: NotRequired[ + "ContractCreateParamsContractLineOverrideServiceActionReplace" + ] + """ + Parameters for replacing an existing service action. + """ + type: Literal["add", "replace"] + """ + The type of service action override. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAdd(TypedDict): + credit_grant: NotRequired[ + "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrant" + ] + """ + Details for the credit grant. Required if `type` is `credit_grant`. + """ + service_interval: Literal["day", "month", "week", "year"] + """ + The interval for assessing service. + """ + service_interval_count: int + """ + The length of the interval for assessing service. + """ + type: Literal["credit_grant"] + """ + The type of the service action. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAddCreditGrant( + TypedDict, +): + amount: "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantAmount" + """ + The amount of the credit grant. + """ + applicability_config: "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfig" + """ + Defines the scope where the credit grant is applicable. + """ + category: NotRequired[Literal["paid", "promotional"]] + """ + The category of the credit grant. + """ + expiry_config: "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantExpiryConfig" + """ + The expiry configuration for the credit grant. + """ + name: str + """ + A descriptive name. + """ + priority: NotRequired[int] + """ + The desired priority for applying this credit grant. The highest priority is 0 and the lowest is 100. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantAmount( + TypedDict, +): + monetary: NotRequired[AmountParam] + """ + The monetary amount of the credit grant. Required if `type` is `monetary`. + """ + type: Literal["monetary"] + """ + The type of the credit grant amount. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfig( + TypedDict, +): + scope: "ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScope" + """ + The applicability scope of the credit grant. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantApplicabilityConfigScope( + TypedDict, +): + billable_items: NotRequired[List[str]] + """ + The billable items to apply the credit grant to. + """ + price_type: NotRequired[Literal["metered"]] + """ + The price type that credit grants can apply to. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionAddCreditGrantExpiryConfig( + TypedDict, +): + type: Literal["end_of_service_period"] + """ + The type of the expiry configuration. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplace(TypedDict): + credit_grant: NotRequired[ + "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrant" + ] + """ + Details for the credit grant. Required if `type` is `credit_grant`. + """ + id: NotRequired[str] + """ + The ID of the service action to replace. + """ + lookup_key: NotRequired[str] + """ + The lookup key for the service action to replace. + """ + service_interval: Literal["day", "month", "week", "year"] + """ + The interval for assessing service. + """ + service_interval_count: int + """ + The length of the interval for assessing service. + """ + type: Literal["credit_grant"] + """ + The type of the service action. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrant( + TypedDict, +): + amount: "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantAmount" + """ + The amount of the credit grant. + """ + applicability_config: "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfig" + """ + Defines the scope where the credit grant is applicable. + """ + category: NotRequired[Literal["paid", "promotional"]] + """ + The category of the credit grant. + """ + expiry_config: "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantExpiryConfig" + """ + The expiry configuration for the credit grant. + """ + name: str + """ + A descriptive name. + """ + priority: NotRequired[int] + """ + The desired priority for applying this credit grant. The highest priority is 0 and the lowest is 100. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantAmount( + TypedDict, +): + monetary: NotRequired[AmountParam] + """ + The monetary amount of the credit grant. Required if `type` is `monetary`. + """ + type: Literal["monetary"] + """ + The type of the credit grant amount. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfig( + TypedDict, +): + scope: "ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope" + """ + The applicability scope of the credit grant. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantApplicabilityConfigScope( + TypedDict, +): + billable_items: NotRequired[List[str]] + """ + The billable items to apply the credit grant to. + """ + price_type: NotRequired[Literal["metered"]] + """ + The price type that credit grants can apply to. + """ + + +class ContractCreateParamsContractLineOverrideServiceActionReplaceCreditGrantExpiryConfig( + TypedDict, +): + type: Literal["end_of_service_period"] + """ + The type of the expiry configuration. + """ + + +class ContractCreateParamsContractLineOverrideStartsAt(TypedDict): + timestamp: str + """ + The timestamp when the item starts. + """ + + +class ContractCreateParamsContractLinePricing(TypedDict): + pass + + +class ContractCreateParamsContractLineStartsAt(TypedDict): + timestamp: str + """ + The timestamp when the item starts. + """ + + +class ContractCreateParamsLicenseQuantityAction(TypedDict): + effective_at: "ContractCreateParamsLicenseQuantityActionEffectiveAt" + """ + The effective at for the license quantity action. + """ + license_pricing_id: NotRequired[str] + """ + The ID of the license pricing. + """ + license_pricing_lookup_key: NotRequired[str] + """ + The lookup key for the license pricing. + """ + license_pricing_type: Literal["license_fee", "price"] + """ + The type of the license pricing. + """ + pricing_line: NotRequired[str] + """ + The pricing line for the license quantity action. + """ + set: NotRequired["ContractCreateParamsLicenseQuantityActionSet"] + """ + The set quantity for the license quantity action. + """ + type: Literal["set"] + """ + The type of the license quantity action. + """ + + +class ContractCreateParamsLicenseQuantityActionEffectiveAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp for the effective at. + """ + type: Literal["timestamp"] + """ + The type of the effective at. + """ + + +class ContractCreateParamsLicenseQuantityActionSet(TypedDict): + quantity: int + """ + The quantity to set. + """ + + +class ContractCreateParamsOneTimeFee(TypedDict): + bill_schedule: List["ContractCreateParamsOneTimeFeeBillSchedule"] + """ + The bill schedule for the fee. Each entry produces an individual invoice item billed at `bill_at`. + """ + billable_item_type: Literal["product"] + """ + The type of billable item that this fee references. + """ + product_details: NotRequired[ + "ContractCreateParamsOneTimeFeeProductDetails" + ] + """ + Details for a product billable target. Required when `billable_item_type` is `product`. + """ + + +class ContractCreateParamsOneTimeFeeBillSchedule(TypedDict): + bill_at: "ContractCreateParamsOneTimeFeeBillScheduleBillAt" + """ + When this entry should be billed. + """ + value: int + """ + The amount to bill for this entry, in the smallest currency unit. + """ + + +class ContractCreateParamsOneTimeFeeBillScheduleBillAt(TypedDict): + timestamp: NotRequired[str] + """ + The datetime at which the entry should be billed. Required if `type` is `datetime`. + """ + type: Literal["contract_start", "datetime"] + """ + The type of the bill_at. + """ + + +class ContractCreateParamsOneTimeFeeProductDetails(TypedDict): + product: str + """ + The ID of the v1 Product. + """ + + +class ContractCreateParamsPricingLine(TypedDict): + ends_at: "ContractCreateParamsPricingLineEndsAt" + """ + When the pricing line ends. + """ + lookup_key: NotRequired[str] + """ + A user-provided lookup key to reference this pricing line. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of key-value pairs that you can attach to an object. + """ + pricing: "ContractCreateParamsPricingLinePricing" + """ + The pricing configuration for the pricing line. + """ + starts_at: "ContractCreateParamsPricingLineStartsAt" + """ + When the pricing line starts. + """ + + +class ContractCreateParamsPricingLineEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. Required if `type` is `timestamp`. + """ + type: Literal["contract_end", "timestamp"] + """ + The type of the ends_at. + """ + + +class ContractCreateParamsPricingLinePricing(TypedDict): + price_details: NotRequired[ + "ContractCreateParamsPricingLinePricingPriceDetails" + ] + """ + V1 price details. Required if `type` is `price`. + """ + type: Literal["price"] + """ + The type of pricing. + """ + + +class ContractCreateParamsPricingLinePricingPriceDetails(TypedDict): + price: str + """ + The ID of the V1 price. + """ + quantity: NotRequired[int] + """ + The quantity for the price. Only applicable for licensed prices. + """ + + +class ContractCreateParamsPricingLineStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. Required if `type` is `timestamp`. + """ + type: Literal["contract_start", "timestamp"] + """ + The type of the starts_at. + """ + + +class ContractCreateParamsPricingOverride(TypedDict): + ends_at: "ContractCreateParamsPricingOverrideEndsAt" + """ + When the pricing override ends. + """ + lookup_key: NotRequired[str] + """ + A user-provided lookup key to reference this pricing override. + """ + multiplier: NotRequired["ContractCreateParamsPricingOverrideMultiplier"] + """ + Parameters for a multiplier override. Required if `type` is `multiplier`. + """ + overwrite_price: NotRequired[ + "ContractCreateParamsPricingOverrideOverwritePrice" + ] + """ + Parameters for an overwrite_price override. Required if `type` is `overwrite_price`. + """ + priority: int + """ + The priority of this override relative to others. Lower number = higher priority. + """ + starts_at: "ContractCreateParamsPricingOverrideStartsAt" + """ + When the pricing override starts. + """ + type: Literal["multiplier", "overwrite_price"] + """ + The type of pricing override. + """ + + +class ContractCreateParamsPricingOverrideEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. Required if `type` is `timestamp`. + """ + type: Literal["contract_end", "timestamp"] + """ + The type of the ends_at. + """ + + +class ContractCreateParamsPricingOverrideMultiplier(TypedDict): + criteria: List["ContractCreateParamsPricingOverrideMultiplierCriterion"] + """ + Criteria determining which rates the multiplier applies to. + """ + factor: str + """ + The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + """ + + +class ContractCreateParamsPricingOverrideMultiplierCriterion(TypedDict): + billable_item_ids: List[str] + """ + Filter by billable item IDs. + """ + billable_item_lookup_keys: List[str] + """ + Filter by billable item lookup keys. + """ + billable_item_types: List[Literal["licensed", "metered"]] + """ + Filter by billable item type. + """ + metadata_conditions: List[ + "ContractCreateParamsPricingOverrideMultiplierCriterionMetadataCondition" + ] + """ + Filter by metadata conditions. + """ + rate_card_ids: List[str] + """ + Filter by rate card IDs. Only applicable for `multiplier` overrides. + """ + type: Literal["exclude", "include"] + """ + Whether to include or exclude items matching these criteria. + """ + + +class ContractCreateParamsPricingOverrideMultiplierCriterionMetadataCondition( + TypedDict, +): + all_of: List[ + "ContractCreateParamsPricingOverrideMultiplierCriterionMetadataConditionAllOf" + ] + """ + All of these key-value conditions must match. + """ + + +class ContractCreateParamsPricingOverrideMultiplierCriterionMetadataConditionAllOf( + TypedDict, +): + key: str + """ + The metadata key. + """ + value: str + """ + The metadata value. + """ + + +class ContractCreateParamsPricingOverrideOverwritePrice(TypedDict): + price: str + """ + The ID of the V1 price to overwrite. + """ + tiering_mode: NotRequired[Literal["graduated", "volume"]] + """ + Defines whether the tiered price should be graduated or volume-based. + """ + tiers: NotRequired[ + List["ContractCreateParamsPricingOverrideOverwritePriceTier"] + ] + """ + Each element represents a pricing tier. + """ + unit_amount: NotRequired[str] + """ + The per-unit amount to be charged, represented as a decimal string in minor currency units. + """ + + +class ContractCreateParamsPricingOverrideOverwritePriceTier(TypedDict): + flat_amount: NotRequired[str] + """ + Price for the entire tier, represented as a decimal string in minor currency units. + """ + unit_amount: NotRequired[str] + """ + Per-unit price for units included in this tier, represented as a decimal string in minor currency units. + """ + up_to_decimal: NotRequired[Decimal] + """ + Up to and including this quantity will be contained in the tier. + """ + up_to_inf: NotRequired[Literal["inf"]] + """ + No upper bound to this tier. + """ + + +class ContractCreateParamsPricingOverrideStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. Required if `type` is `timestamp`. + """ + type: Literal["contract_start", "timestamp"] + """ + The type of the starts_at. + """ diff --git a/stripe/params/v2/billing/_contract_list_params.py b/stripe/params/v2/billing/_contract_list_params.py new file mode 100644 index 000000000..ab5267d1e --- /dev/null +++ b/stripe/params/v2/billing/_contract_list_params.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class ContractListParams(TypedDict): + customer: NotRequired[str] + """ + Filter by customer ID. + """ + limit: NotRequired[int] + """ + The limit for the number of results per page. + """ diff --git a/stripe/params/v2/billing/_contract_retrieve_params.py b/stripe/params/v2/billing/_contract_retrieve_params.py new file mode 100644 index 000000000..36fbc3422 --- /dev/null +++ b/stripe/params/v2/billing/_contract_retrieve_params.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ContractRetrieveParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "contract_line_details", + "license_quantities", + "one_time_fees", + "pricing_lines", + "pricing_overrides", + ] + ] + ] + """ + Additional fields to include in the response. + """ diff --git a/stripe/params/v2/billing/_contract_update_params.py b/stripe/params/v2/billing/_contract_update_params.py new file mode 100644 index 000000000..1652f30e3 --- /dev/null +++ b/stripe/params/v2/billing/_contract_update_params.py @@ -0,0 +1,462 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from decimal import Decimal +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ContractUpdateParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "contract_line_details", + "license_quantities", + "one_time_fees", + "pricing_lines", + "pricing_overrides", + ] + ] + ] + """ + Additional fields to include in the response. + """ + license_quantity_actions: NotRequired[ + List["ContractUpdateParamsLicenseQuantityAction"] + ] + """ + Schema-only: License quantity actions (implementation to follow). + """ + pricing_line_actions: NotRequired[ + List["ContractUpdateParamsPricingLineAction"] + ] + """ + Pricing line actions to apply. + """ + pricing_override_actions: NotRequired[ + List["ContractUpdateParamsPricingOverrideAction"] + ] + """ + Pricing override actions to apply. + """ + + +class ContractUpdateParamsLicenseQuantityAction(TypedDict): + effective_at: "ContractUpdateParamsLicenseQuantityActionEffectiveAt" + """ + The effective at for the license quantity action. + """ + license_pricing_id: NotRequired[str] + """ + The ID of the license pricing. + """ + license_pricing_lookup_key: NotRequired[str] + """ + The lookup key for the license pricing. + """ + license_pricing_type: Literal["license_fee", "price"] + """ + The type of the license pricing. + """ + pricing_line: NotRequired[str] + """ + The pricing line ID for the license quantity action. + """ + pricing_line_lookup_key: NotRequired[str] + """ + The pricing line lookup key for the license quantity action. + """ + set: NotRequired["ContractUpdateParamsLicenseQuantityActionSet"] + """ + The set quantity for the license quantity action. + """ + type: Literal["set"] + """ + The type of the license quantity action. + """ + + +class ContractUpdateParamsLicenseQuantityActionEffectiveAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp for the effective at. + """ + type: Literal["timestamp"] + """ + The type of the effective at. + """ + + +class ContractUpdateParamsLicenseQuantityActionSet(TypedDict): + quantity: int + """ + The quantity to set. + """ + + +class ContractUpdateParamsPricingLineAction(TypedDict): + add: NotRequired["ContractUpdateParamsPricingLineActionAdd"] + """ + Parameters for adding a pricing line. + """ + remove: NotRequired["ContractUpdateParamsPricingLineActionRemove"] + """ + Parameters for removing a pricing line. + """ + type: Literal["add", "remove", "update"] + """ + The type of pricing line action. + """ + update: NotRequired["ContractUpdateParamsPricingLineActionUpdate"] + """ + Parameters for updating a pricing line. + """ + + +class ContractUpdateParamsPricingLineActionAdd(TypedDict): + ends_at: "ContractUpdateParamsPricingLineActionAddEndsAt" + """ + The end time for the pricing line. + """ + lookup_key: NotRequired[str] + """ + A lookup key for the pricing line. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Metadata for the pricing line. + """ + pricing: "ContractUpdateParamsPricingLineActionAddPricing" + """ + The pricing configuration for the pricing line. + """ + starts_at: "ContractUpdateParamsPricingLineActionAddStartsAt" + """ + The start time for the pricing line. + """ + + +class ContractUpdateParamsPricingLineActionAddEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. + """ + type: Literal["billing_period_end", "timestamp"] + """ + The type of end time to apply. + """ + + +class ContractUpdateParamsPricingLineActionAddPricing(TypedDict): + price_details: NotRequired[ + "ContractUpdateParamsPricingLineActionAddPricingPriceDetails" + ] + """ + V1 price details. Required if `type` is `price`. + """ + type: Literal["price"] + """ + The type of pricing. + """ + + +class ContractUpdateParamsPricingLineActionAddPricingPriceDetails(TypedDict): + price: str + """ + The ID of the V1 price. + """ + quantity: NotRequired[int] + """ + The quantity for the price. Only applicable for licensed prices. + """ + + +class ContractUpdateParamsPricingLineActionAddStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. + """ + type: Literal["billing_period_start", "timestamp"] + """ + The type of start time to apply. + """ + + +class ContractUpdateParamsPricingLineActionRemove(TypedDict): + id: str + """ + The ID of the pricing line to remove. + """ + + +class ContractUpdateParamsPricingLineActionUpdate(TypedDict): + ends_at: NotRequired["ContractUpdateParamsPricingLineActionUpdateEndsAt"] + """ + The updated end time for the pricing line. + """ + id: str + """ + The ID of the pricing line. + """ + starts_at: NotRequired[ + "ContractUpdateParamsPricingLineActionUpdateStartsAt" + ] + """ + The updated start time for the pricing line. + """ + + +class ContractUpdateParamsPricingLineActionUpdateEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. + """ + type: Literal["billing_period_end", "timestamp"] + """ + The type of end time to apply. + """ + + +class ContractUpdateParamsPricingLineActionUpdateStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. + """ + type: Literal["billing_period_start", "timestamp"] + """ + The type of start time to apply. + """ + + +class ContractUpdateParamsPricingOverrideAction(TypedDict): + add: NotRequired["ContractUpdateParamsPricingOverrideActionAdd"] + """ + Parameters for adding a pricing override. + """ + remove: NotRequired["ContractUpdateParamsPricingOverrideActionRemove"] + """ + Parameters for removing a pricing override. + """ + type: Literal["add", "remove", "update"] + """ + The type of pricing override action. + """ + update: NotRequired["ContractUpdateParamsPricingOverrideActionUpdate"] + """ + Parameters for updating a pricing override. + """ + + +class ContractUpdateParamsPricingOverrideActionAdd(TypedDict): + ends_at: "ContractUpdateParamsPricingOverrideActionAddEndsAt" + """ + The end time for the pricing override. + """ + lookup_key: NotRequired[str] + """ + A lookup key for the pricing override. + """ + multiplier: NotRequired[ + "ContractUpdateParamsPricingOverrideActionAddMultiplier" + ] + """ + A multiplier override to add. + """ + overwrite_price: NotRequired[ + "ContractUpdateParamsPricingOverrideActionAddOverwritePrice" + ] + """ + An overwrite price override to add. + """ + priority: int + """ + The priority for the pricing override. + """ + starts_at: "ContractUpdateParamsPricingOverrideActionAddStartsAt" + """ + The start time for the pricing override. + """ + type: Literal["multiplier", "overwrite_price"] + """ + The type of pricing override to add. + """ + + +class ContractUpdateParamsPricingOverrideActionAddEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. + """ + type: Literal["billing_period_end", "timestamp"] + """ + The type of end time to apply. + """ + + +class ContractUpdateParamsPricingOverrideActionAddMultiplier(TypedDict): + criteria: List[ + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterion" + ] + """ + Criteria determining which rates the multiplier applies to. + """ + factor: str + """ + The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + """ + + +class ContractUpdateParamsPricingOverrideActionAddMultiplierCriterion( + TypedDict, +): + billable_item_ids: List[str] + """ + Filter by billable item IDs. + """ + billable_item_lookup_keys: List[str] + """ + Filter by billable item lookup keys. + """ + billable_item_types: List[Literal["licensed", "metered"]] + """ + Filter by billable item type. + """ + metadata_conditions: List[ + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataCondition" + ] + """ + Filter by metadata conditions. + """ + rate_card_ids: List[str] + """ + Filter by rate card IDs. Only applicable for `multiplier` overrides. + """ + type: Literal["exclude", "include"] + """ + Whether to include or exclude items matching these criteria. + """ + + +class ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataCondition( + TypedDict, +): + all_of: List[ + "ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataConditionAllOf" + ] + """ + All of these key-value conditions must match. + """ + + +class ContractUpdateParamsPricingOverrideActionAddMultiplierCriterionMetadataConditionAllOf( + TypedDict, +): + key: str + """ + The metadata key. + """ + value: str + """ + The metadata value. + """ + + +class ContractUpdateParamsPricingOverrideActionAddOverwritePrice(TypedDict): + price: str + """ + The ID of the V1 price to overwrite. + """ + tiering_mode: NotRequired[Literal["graduated", "volume"]] + """ + Defines whether the tiered price should be graduated or volume-based. + """ + tiers: List[ + "ContractUpdateParamsPricingOverrideActionAddOverwritePriceTier" + ] + """ + Each element represents a pricing tier. + """ + unit_amount: NotRequired[str] + """ + The per-unit amount to be charged, represented as a decimal string in minor currency units. + """ + + +class ContractUpdateParamsPricingOverrideActionAddOverwritePriceTier( + TypedDict +): + flat_amount: NotRequired[str] + """ + Price for the entire tier, represented as a decimal string in minor currency units. + """ + unit_amount: NotRequired[str] + """ + Per-unit price for units included in this tier, represented as a decimal string in minor currency units. + """ + up_to_decimal: NotRequired[Decimal] + """ + Up to and including this quantity will be contained in the tier. + """ + up_to_inf: NotRequired[Literal["inf"]] + """ + No upper bound to this tier. + """ + + +class ContractUpdateParamsPricingOverrideActionAddStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. + """ + type: Literal["billing_period_start", "timestamp"] + """ + The type of start time to apply. + """ + + +class ContractUpdateParamsPricingOverrideActionRemove(TypedDict): + id: str + """ + The ID of the pricing override to remove. + """ + + +class ContractUpdateParamsPricingOverrideActionUpdate(TypedDict): + ends_at: NotRequired[ + "ContractUpdateParamsPricingOverrideActionUpdateEndsAt" + ] + """ + The updated end time for the pricing override. + """ + id: str + """ + The ID of the pricing override. + """ + starts_at: NotRequired[ + "ContractUpdateParamsPricingOverrideActionUpdateStartsAt" + ] + """ + The updated start time for the pricing override. + """ + + +class ContractUpdateParamsPricingOverrideActionUpdateEndsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item ends. + """ + type: Literal["billing_period_end", "timestamp"] + """ + The type of end time to apply. + """ + + +class ContractUpdateParamsPricingOverrideActionUpdateStartsAt(TypedDict): + timestamp: NotRequired[str] + """ + The timestamp when the item starts. + """ + type: Literal["billing_period_start", "timestamp"] + """ + The type of start time to apply. + """ diff --git a/stripe/params/v2/billing/contracts/__init__.py b/stripe/params/v2/billing/contracts/__init__.py new file mode 100644 index 000000000..0cffa4e4a --- /dev/null +++ b/stripe/params/v2/billing/contracts/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.billing.contracts import ( + license_pricing as license_pricing, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "license_pricing": ( + "stripe.params.v2.billing.contracts.license_pricing", + True, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/billing/contracts/license_pricing/__init__.py b/stripe/params/v2/billing/contracts/license_pricing/__init__.py new file mode 100644 index 000000000..4fcdfd0fe --- /dev/null +++ b/stripe/params/v2/billing/contracts/license_pricing/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.billing.contracts.license_pricing._quantity_change_list_quantity_changes_params import ( + QuantityChangeListQuantityChangesParams as QuantityChangeListQuantityChangesParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "QuantityChangeListQuantityChangesParams": ( + "stripe.params.v2.billing.contracts.license_pricing._quantity_change_list_quantity_changes_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/billing/contracts/license_pricing/_quantity_change_list_quantity_changes_params.py b/stripe/params/v2/billing/contracts/license_pricing/_quantity_change_list_quantity_changes_params.py new file mode 100644 index 000000000..a60996991 --- /dev/null +++ b/stripe/params/v2/billing/contracts/license_pricing/_quantity_change_list_quantity_changes_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class QuantityChangeListQuantityChangesParams(TypedDict): + limit: NotRequired[int] + """ + The limit for the number of results per page. + """ diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 9f000c9f9..8fd4a87fb 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -2228,6 +2228,10 @@ class AccountCreateParamsDefaultsResponsibilities(TypedDict): """ A value indicating who is responsible for losses when this Account can't pay back negative balances from payments. """ + requirements_collector: NotRequired[Literal["application", "stripe"]] + """ + A value indicating the party responsible for collecting requirements on this account. + """ class AccountCreateParamsIdentity(TypedDict): diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 3c851e4d4..27d2248ec 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -2262,6 +2262,10 @@ class AccountUpdateParamsDefaultsResponsibilities(TypedDict): """ A value indicating who is responsible for losses when this Account can't pay back negative balances from payments. """ + requirements_collector: NotRequired[Literal["application", "stripe"]] + """ + A value indicating the party responsible for collecting requirements on this account. + """ class AccountUpdateParamsIdentity(TypedDict): diff --git a/stripe/params/v2/data/reporting/_query_run_retrieve_params.py b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py index 663751e2b..01bcd4e4c 100644 --- a/stripe/params/v2/data/reporting/_query_run_retrieve_params.py +++ b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py @@ -1,7 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing_extensions import TypedDict +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict class QueryRunRetrieveParams(TypedDict): - pass + include: NotRequired[List[Literal["result.file.schema"]]] + """ + Any optional includes (see https://docs.stripe.com/api-includable-response-values). + """ diff --git a/stripe/params/v2/money_management/_outbound_payment_create_params.py b/stripe/params/v2/money_management/_outbound_payment_create_params.py index 776a66052..a5dbde7fc 100644 --- a/stripe/params/v2/money_management/_outbound_payment_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_create_params.py @@ -48,7 +48,7 @@ class OutboundPaymentCreateParams(_OutboundPaymentCreateParamsBase): """ statement_descriptor: NotRequired[str] """ - The description that appears on the receiving end for an OutboundPayment (for example, on a bank statement). Must be between 3 and 22 characters long, and not contain profanity. + The description that appears on the receiving end for an OutboundPayment (for example, on a bank statement). Must be between 3 and 22 characters long for most destinations (500 for FinancialAccount destinations), and not contain profanity. """ to: "OutboundPaymentCreateParamsTo" """ diff --git a/stripe/params/v2/money_management/_outbound_transfer_create_params.py b/stripe/params/v2/money_management/_outbound_transfer_create_params.py index 54d2822f2..da5b75458 100644 --- a/stripe/params/v2/money_management/_outbound_transfer_create_params.py +++ b/stripe/params/v2/money_management/_outbound_transfer_create_params.py @@ -36,7 +36,7 @@ class OutboundTransferCreateParams(_OutboundTransferCreateParamsBase): """ statement_descriptor: NotRequired[str] """ - The description that appears on the receiving end for an OutboundTransfer (for example, on a bank statement). Must be between 3 and 22 characters long, and not contain profanity. + The description that appears on the receiving end for an OutboundTransfer (for example, on a bank statement). Must be between 3 and 22 characters long for most destinations (500 for FinancialAccount destinations), and not contain profanity. """ to: "OutboundTransferCreateParamsTo" """ diff --git a/stripe/params/v2/reporting/_report_run_retrieve_params.py b/stripe/params/v2/reporting/_report_run_retrieve_params.py index 5f2b19209..9f390f5f6 100644 --- a/stripe/params/v2/reporting/_report_run_retrieve_params.py +++ b/stripe/params/v2/reporting/_report_run_retrieve_params.py @@ -1,7 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing_extensions import TypedDict +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict class ReportRunRetrieveParams(TypedDict): - pass + include: NotRequired[List[Literal["result.file.schema"]]] + """ + Any optional includes (see https://docs.stripe.com/api-includable-response-values). + """ diff --git a/stripe/params/v2/signals/__init__.py b/stripe/params/v2/signals/__init__.py new file mode 100644 index 000000000..149d2f2a0 --- /dev/null +++ b/stripe/params/v2/signals/__init__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.signals._account_signal_list_params import ( + AccountSignalListParams as AccountSignalListParams, + AccountSignalListParamsAccountDetails as AccountSignalListParamsAccountDetails, + ) + from stripe.params.v2.signals._account_signal_retrieve_params import ( + AccountSignalRetrieveParams as AccountSignalRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "AccountSignalListParams": ( + "stripe.params.v2.signals._account_signal_list_params", + False, + ), + "AccountSignalListParamsAccountDetails": ( + "stripe.params.v2.signals._account_signal_list_params", + False, + ), + "AccountSignalRetrieveParams": ( + "stripe.params.v2.signals._account_signal_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/signals/_account_signal_list_params.py b/stripe/params/v2/signals/_account_signal_list_params.py new file mode 100644 index 000000000..1b3be95fa --- /dev/null +++ b/stripe/params/v2/signals/_account_signal_list_params.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class AccountSignalListParams(TypedDict): + account_details: NotRequired["AccountSignalListParamsAccountDetails"] + """ + The account or customer to list signals for. Exactly one of account_details.account or + account_details.customer must be provided. + """ + limit: NotRequired[int] + """ + Maximum number of results to return per page. Defaults to 20. + """ + type: List[Literal["fraudulent_merchant", "merchant_delinquency"]] + """ + Signal types to filter by. + """ + + +class AccountSignalListParamsAccountDetails(TypedDict): + account: NotRequired[str] + """ + The v2 account ID of the account. + """ + customer: NotRequired[str] + """ + The v1 customer ID of the account, for users not yet migrated to v2/accounts. + """ diff --git a/stripe/params/v2/signals/_account_signal_retrieve_params.py b/stripe/params/v2/signals/_account_signal_retrieve_params.py new file mode 100644 index 000000000..630774572 --- /dev/null +++ b/stripe/params/v2/signals/_account_signal_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AccountSignalRetrieveParams(TypedDict): + pass diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 8ecca0ec2..0a18316b7 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -19,6 +19,7 @@ orchestrated_commerce as orchestrated_commerce, payments as payments, reporting as reporting, + signals as signals, tax as tax, test_helpers as test_helpers, ) @@ -42,10 +43,11 @@ from stripe.v2._orchestrated_commerce_service import ( OrchestratedCommerceService as OrchestratedCommerceService, ) - from stripe.v2._payment_service import PaymentService as PaymentService + from stripe.v2._payments_service import PaymentsService as PaymentsService from stripe.v2._reporting_service import ( ReportingService as ReportingService, ) + from stripe.v2._signals_service import SignalsService as SignalsService from stripe.v2._tax_service import TaxService as TaxService from stripe.v2._test_helper_service import ( TestHelperService as TestHelperService, @@ -64,6 +66,7 @@ "orchestrated_commerce": ("stripe.v2.orchestrated_commerce", True), "payments": ("stripe.v2.payments", True), "reporting": ("stripe.v2.reporting", True), + "signals": ("stripe.v2.signals", True), "tax": ("stripe.v2.tax", True), "test_helpers": ("stripe.v2.test_helpers", True), "BillingService": ("stripe.v2._billing_service", False), @@ -87,8 +90,9 @@ "stripe.v2._orchestrated_commerce_service", False, ), - "PaymentService": ("stripe.v2._payment_service", False), + "PaymentsService": ("stripe.v2._payments_service", False), "ReportingService": ("stripe.v2._reporting_service", False), + "SignalsService": ("stripe.v2._signals_service", False), "TaxService": ("stripe.v2._tax_service", False), "TestHelperService": ("stripe.v2._test_helper_service", False), } diff --git a/stripe/v2/_billing_service.py b/stripe/v2/_billing_service.py index 5faa24495..42b098b5f 100644 --- a/stripe/v2/_billing_service.py +++ b/stripe/v2/_billing_service.py @@ -10,6 +10,7 @@ from stripe.v2.billing._collection_setting_service import ( CollectionSettingService, ) + from stripe.v2.billing._contract_service import ContractService from stripe.v2.billing._custom_pricing_unit_service import ( CustomPricingUnitService, ) @@ -49,6 +50,7 @@ "stripe.v2.billing._collection_setting_service", "CollectionSettingService", ], + "contracts": ["stripe.v2.billing._contract_service", "ContractService"], "custom_pricing_units": [ "stripe.v2.billing._custom_pricing_unit_service", "CustomPricingUnitService", @@ -111,6 +113,7 @@ class BillingService(StripeService): bill_settings: "BillSettingService" cadences: "CadenceService" collection_settings: "CollectionSettingService" + contracts: "ContractService" custom_pricing_units: "CustomPricingUnitService" intents: "IntentService" license_fees: "LicenseFeeService" diff --git a/stripe/v2/_payment_service.py b/stripe/v2/_payments_service.py similarity index 97% rename from stripe/v2/_payment_service.py rename to stripe/v2/_payments_service.py index d6a1bb5e2..a2ad36610 100644 --- a/stripe/v2/_payment_service.py +++ b/stripe/v2/_payments_service.py @@ -24,7 +24,7 @@ } -class PaymentService(StripeService): +class PaymentsService(StripeService): off_session_payments: "OffSessionPaymentService" settlement_allocation_intents: "SettlementAllocationIntentService" diff --git a/stripe/v2/_signals_service.py b/stripe/v2/_signals_service.py new file mode 100644 index 000000000..7dbb49980 --- /dev/null +++ b/stripe/v2/_signals_service.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.signals._account_signal_service import AccountSignalService + +_subservices = { + "account_signals": [ + "stripe.v2.signals._account_signal_service", + "AccountSignalService", + ], +} + + +class SignalsService(StripeService): + account_signals: "AccountSignalService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/__init__.py b/stripe/v2/billing/__init__.py index 17c73ebf2..604209441 100644 --- a/stripe/v2/billing/__init__.py +++ b/stripe/v2/billing/__init__.py @@ -8,6 +8,7 @@ bill_settings as bill_settings, cadences as cadences, collection_settings as collection_settings, + contracts as contracts, intents as intents, license_fees as license_fees, pricing_plans as pricing_plans, @@ -36,6 +37,13 @@ from stripe.v2.billing._collection_setting_version import ( CollectionSettingVersion as CollectionSettingVersion, ) + from stripe.v2.billing._contract import Contract as Contract + from stripe.v2.billing._contract_license_pricing_quantity_change import ( + ContractLicensePricingQuantityChange as ContractLicensePricingQuantityChange, + ) + from stripe.v2.billing._contract_service import ( + ContractService as ContractService, + ) from stripe.v2.billing._custom_pricing_unit import ( CustomPricingUnit as CustomPricingUnit, ) @@ -134,6 +142,7 @@ "bill_settings": ("stripe.v2.billing.bill_settings", True), "cadences": ("stripe.v2.billing.cadences", True), "collection_settings": ("stripe.v2.billing.collection_settings", True), + "contracts": ("stripe.v2.billing.contracts", True), "intents": ("stripe.v2.billing.intents", True), "license_fees": ("stripe.v2.billing.license_fees", True), "pricing_plans": ("stripe.v2.billing.pricing_plans", True), @@ -156,6 +165,12 @@ "stripe.v2.billing._collection_setting_version", False, ), + "Contract": ("stripe.v2.billing._contract", False), + "ContractLicensePricingQuantityChange": ( + "stripe.v2.billing._contract_license_pricing_quantity_change", + False, + ), + "ContractService": ("stripe.v2.billing._contract_service", False), "CustomPricingUnit": ("stripe.v2.billing._custom_pricing_unit", False), "CustomPricingUnitService": ( "stripe.v2.billing._custom_pricing_unit_service", diff --git a/stripe/v2/billing/_contract.py b/stripe/v2/billing/_contract.py new file mode 100644 index 000000000..cdf551c18 --- /dev/null +++ b/stripe/v2/billing/_contract.py @@ -0,0 +1,774 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from decimal import Decimal +from stripe._stripe_object import StripeObject, UntypedStripeObject +from stripe.v2._amount import Amount as V2AmountResource +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class Contract(StripeObject): + """ + Main Contract resource representing a comprehensive billing agreement + """ + + OBJECT_NAME: ClassVar[Literal["v2.billing.contract"]] = ( + "v2.billing.contract" + ) + + class BillingSettings(StripeObject): + class ContractBillingDetails(StripeObject): + class BillSettingsDetails(StripeObject): + class Calculation(StripeObject): + class Tax(StripeObject): + type: Literal["automatic", "manual"] + """ + The type of tax calculation. + """ + + tax: Optional[Tax] + """ + Tax calculation settings. + """ + _inner_class_types = {"tax": Tax} + + class Invoice(StripeObject): + class TimeUntilDue(StripeObject): + interval: Literal["day", "month", "week", "year"] + """ + The interval unit. + """ + interval_count: int + """ + The number of intervals. + """ + + time_until_due: Optional[TimeUntilDue] + """ + The number of time units before the invoice is past due. + """ + _inner_class_types = {"time_until_due": TimeUntilDue} + + calculation: Optional[Calculation] + """ + Calculation settings. + """ + invoice: Optional[Invoice] + """ + Invoice settings. + """ + _inner_class_types = { + "calculation": Calculation, + "invoice": Invoice, + } + + class BillingProfileDetails(StripeObject): + customer: str + """ + The customer who pays for the contract invoice. + """ + default_payment_method: Optional[str] + """ + The default payment method for the contract. + """ + + class CollectionSettingsDetails(StripeObject): + collection_method: Literal[ + "charge_automatically", "send_invoice" + ] + """ + The collection method. + """ + payment_method_configuration: Optional[str] + """ + The payment method configuration. + """ + + bill_settings_details: Optional[BillSettingsDetails] + """ + The bill settings details. + """ + billing_profile_details: BillingProfileDetails + """ + The billing profile details. + """ + collection_settings_details: CollectionSettingsDetails + """ + The collection settings details. + """ + _inner_class_types = { + "bill_settings_details": BillSettingsDetails, + "billing_profile_details": BillingProfileDetails, + "collection_settings_details": CollectionSettingsDetails, + } + + contract_billing_details: Optional[ContractBillingDetails] + """ + Billing settings details for the contract. + """ + _inner_class_types = { + "contract_billing_details": ContractBillingDetails, + } + + class ContractLineDetail(StripeObject): + class ContractLineValueDetails(StripeObject): + total: str + """ + Computed sum of all licensed fees. Represented as a decimal string in minor currency units. + """ + + class EndsAt(StripeObject): + timestamp: str + """ + The timestamp when the item ends. + """ + + class Override(StripeObject): + class EndsAt(StripeObject): + timestamp: str + """ + The timestamp when the item ends. + """ + + class ServiceAction(StripeObject): + class Add(StripeObject): + class CreditGrant(StripeObject): + class Amount(StripeObject): + monetary: Optional[V2AmountResource] + """ + The monetary amount of the credit grant. Required if `type` is `monetary`. + """ + type: Literal["monetary"] + """ + The type of the credit grant amount. + """ + + class ApplicabilityConfig(StripeObject): + class Scope(StripeObject): + billable_items: Optional[List[str]] + """ + The billable items to apply the credit grant to. + """ + price_type: Optional[Literal["metered"]] + """ + The price type that credit grants can apply to. + """ + + scope: Scope + """ + The applicability scope of the credit grant. + """ + _inner_class_types = {"scope": Scope} + + class ExpiryConfig(StripeObject): + type: Literal["end_of_service_period"] + """ + The type of the expiry configuration. + """ + + amount: Amount + """ + The amount of the credit grant. + """ + applicability_config: ApplicabilityConfig + """ + Defines the scope where the credit grant is applicable. + """ + category: Optional[Literal["paid", "promotional"]] + """ + The category of the credit grant. + """ + expiry_config: ExpiryConfig + """ + The expiry configuration for the credit grant. + """ + name: str + """ + A descriptive name. + """ + priority: Optional[int] + """ + The desired priority for applying this credit grant. The highest priority is 0 and the lowest is 100. + """ + _inner_class_types = { + "amount": Amount, + "applicability_config": ApplicabilityConfig, + "expiry_config": ExpiryConfig, + } + + credit_grant: Optional[CreditGrant] + """ + Details for the credit grant. Required if `type` is `credit_grant`. + """ + service_interval: Literal["day", "month", "week", "year"] + """ + The interval for assessing service. + """ + service_interval_count: int + """ + The length of the interval for assessing service. + """ + type: Literal["credit_grant"] + """ + The type of the service action. + """ + _inner_class_types = {"credit_grant": CreditGrant} + + class Replace(StripeObject): + class CreditGrant(StripeObject): + class Amount(StripeObject): + monetary: Optional[V2AmountResource] + """ + The monetary amount of the credit grant. Required if `type` is `monetary`. + """ + type: Literal["monetary"] + """ + The type of the credit grant amount. + """ + + class ApplicabilityConfig(StripeObject): + class Scope(StripeObject): + billable_items: Optional[List[str]] + """ + The billable items to apply the credit grant to. + """ + price_type: Optional[Literal["metered"]] + """ + The price type that credit grants can apply to. + """ + + scope: Scope + """ + The applicability scope of the credit grant. + """ + _inner_class_types = {"scope": Scope} + + class ExpiryConfig(StripeObject): + type: Literal["end_of_service_period"] + """ + The type of the expiry configuration. + """ + + amount: Amount + """ + The amount of the credit grant. + """ + applicability_config: ApplicabilityConfig + """ + Defines the scope where the credit grant is applicable. + """ + category: Optional[Literal["paid", "promotional"]] + """ + The category of the credit grant. + """ + expiry_config: ExpiryConfig + """ + The expiry configuration for the credit grant. + """ + name: str + """ + A descriptive name. + """ + priority: Optional[int] + """ + The desired priority for applying this credit grant. The highest priority is 0 and the lowest is 100. + """ + _inner_class_types = { + "amount": Amount, + "applicability_config": ApplicabilityConfig, + "expiry_config": ExpiryConfig, + } + + credit_grant: Optional[CreditGrant] + """ + Details for the credit grant. Required if `type` is `credit_grant`. + """ + id: Optional[str] + """ + The ID of the service action to replace. + """ + lookup_key: Optional[str] + """ + The lookup key for the service action to replace. + """ + service_interval: Literal["day", "month", "week", "year"] + """ + The interval for assessing service. + """ + service_interval_count: int + """ + The length of the interval for assessing service. + """ + type: Literal["credit_grant"] + """ + The type of the service action. + """ + _inner_class_types = {"credit_grant": CreditGrant} + + add: Optional[Add] + """ + Parameters for adding a new service action. + """ + replace: Optional[Replace] + """ + Parameters for replacing an existing service action. + """ + type: Literal["add", "replace"] + """ + The type of service action override. + """ + _inner_class_types = {"add": Add, "replace": Replace} + + class StartsAt(StripeObject): + timestamp: str + """ + The timestamp when the item starts. + """ + + ends_at: EndsAt + """ + Timestamp to indicate when the override ends. + """ + service_action: Optional[ServiceAction] + """ + Service action override details. + """ + starts_at: StartsAt + """ + Timestamp to indicate when the override starts. + """ + type: Literal["service_action"] + """ + The type of the override. + """ + _inner_class_types = { + "ends_at": EndsAt, + "service_action": ServiceAction, + "starts_at": StartsAt, + } + + class Pricing(StripeObject): + pass + + class StartsAt(StripeObject): + timestamp: str + """ + The timestamp when the item starts. + """ + + contract_line: str + """ + The ID of the contract line. + """ + contract_line_value_details: ContractLineValueDetails + """ + The computed value details for the contract line. + """ + created: str + """ + Timestamp of when the object was created. + """ + ends_at: EndsAt + """ + Timestamp to indicate when the contract line ends. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of key-value pairs that you can attach to an object. + """ + overrides: List[Override] + """ + List of overrides applied to the contract line. + """ + pricing: Pricing + """ + The pricing configuration for the contract line. + """ + starts_at: StartsAt + """ + Timestamp to indicate when the contract line starts. + """ + _inner_class_types = { + "contract_line_value_details": ContractLineValueDetails, + "ends_at": EndsAt, + "overrides": Override, + "pricing": Pricing, + "starts_at": StartsAt, + } + + class ContractValueDetails(StripeObject): + total: str + """ + The total value represented as a decimal string in minor currency units. + """ + + class LicenseQuantity(StripeObject): + license_pricing_id: str + """ + The ID of the license pricing. + """ + license_pricing_type: Literal["license_fee", "price"] + """ + The type of the license pricing. + """ + pricing_line: str + """ + The ID of the pricing line associated with this license quantity. + """ + quantity: int + """ + The current quantity of the license. + """ + + class OneTimeFee(StripeObject): + class BillSchedule(StripeObject): + class BillAt(StripeObject): + timestamp: Optional[str] + """ + The datetime at which the entry will be billed. Set when `type` is `datetime`. + """ + type: Literal["contract_start", "datetime"] + """ + The type of the bill_at. + """ + + bill_at: BillAt + """ + When this entry will be billed. + """ + value: int + """ + The amount to bill for this entry, in the smallest currency unit. + """ + _inner_class_types = {"bill_at": BillAt} + _field_encodings = {"value": "int64_string"} + + class ProductDetails(StripeObject): + product: str + """ + The ID of the v1 Product. + """ + + bill_schedule: List[BillSchedule] + """ + The resolved bill schedule for the fee. + """ + billable_item_type: Literal["product"] + """ + The type of billable item that this fee references. + """ + product_details: Optional[ProductDetails] + """ + Details for a product billable target. Set when `billable_item_type` is `product`. + """ + _inner_class_types = { + "bill_schedule": BillSchedule, + "product_details": ProductDetails, + } + + class PricingLine(StripeObject): + class EndsAt(StripeObject): + timestamp: str + """ + The timestamp when the item ends. + """ + + class Pricing(StripeObject): + class PriceDetails(StripeObject): + price: str + """ + The ID of the V1 price. + """ + + price_details: Optional[PriceDetails] + """ + V1 price details. Present when `type` is `price`. + """ + type: Literal["price"] + """ + The type of pricing. + """ + _inner_class_types = {"price_details": PriceDetails} + + class StartsAt(StripeObject): + timestamp: str + """ + The timestamp when the item starts. + """ + + ends_at: EndsAt + """ + Resolved timestamp when the pricing line ends. + """ + lookup_key: Optional[str] + """ + The user-provided lookup key for the pricing line. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of key-value pairs that you can attach to an object. + """ + pricing: Pricing + """ + The pricing configuration for the pricing line. + """ + pricing_line: str + """ + The ID of the pricing line. + """ + starts_at: StartsAt + """ + Resolved timestamp when the pricing line starts. + """ + _inner_class_types = { + "ends_at": EndsAt, + "pricing": Pricing, + "starts_at": StartsAt, + } + + class PricingOverride(StripeObject): + class EndsAt(StripeObject): + timestamp: str + """ + The timestamp when the item ends. + """ + + class Multiplier(StripeObject): + class Criterion(StripeObject): + class MetadataCondition(StripeObject): + class AllOf(StripeObject): + key: str + """ + The metadata key. + """ + value: str + """ + The metadata value. + """ + + all_of: List[AllOf] + """ + All of these key-value conditions must match. + """ + _inner_class_types = {"all_of": AllOf} + + billable_item_ids: List[str] + """ + Filter by billable item IDs. + """ + billable_item_lookup_keys: List[str] + """ + Filter by billable item lookup keys. + """ + billable_item_types: List[Literal["licensed", "metered"]] + """ + Filter by billable item type. + """ + metadata_conditions: List[MetadataCondition] + """ + Filter by metadata conditions. + """ + rate_card_ids: List[str] + """ + Filter by rate card IDs. Only applicable for `multiplier` overrides. + """ + type: Literal["exclude", "include"] + """ + Whether to include or exclude items matching these criteria. + """ + _inner_class_types = {"metadata_conditions": MetadataCondition} + + criteria: List[Criterion] + """ + Criteria determining which rates the multiplier applies to. + """ + factor: str + """ + The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction. + """ + _inner_class_types = {"criteria": Criterion} + + class OverwritePrice(StripeObject): + class Tier(StripeObject): + flat_amount: Optional[str] + """ + Price for the entire tier, represented as a decimal string in minor currency units. + """ + unit_amount: Optional[str] + """ + Per-unit price for units included in this tier, represented as a decimal string in minor currency units. + """ + up_to_decimal: Optional[Decimal] + """ + Up to and including this quantity will be contained in the tier. + """ + up_to_inf: Optional[Literal["inf"]] + """ + No upper bound to this tier. + """ + _field_encodings = {"up_to_decimal": "decimal_string"} + + price: str + """ + The ID of the V1 price to overwrite. + """ + tiering_mode: Optional[Literal["graduated", "volume"]] + """ + Defines whether the tiered price should be graduated or volume-based. + """ + tiers: List[Tier] + """ + Each element represents a pricing tier. + """ + unit_amount: Optional[str] + """ + The per-unit amount to be charged, represented as a decimal string in minor currency units. + """ + _inner_class_types = {"tiers": Tier} + + class StartsAt(StripeObject): + timestamp: str + """ + The timestamp when the item starts. + """ + + ends_at: EndsAt + """ + Resolved timestamp when the pricing override ends. + """ + lookup_key: Optional[str] + """ + The user-provided lookup key for the pricing override. + """ + multiplier: Optional[Multiplier] + """ + Details for a multiplier override. + """ + overwrite_price: Optional[OverwritePrice] + """ + Details for an overwrite_price override. + """ + pricing_override: str + """ + The ID of the pricing override. + """ + priority: int + """ + The priority of this override relative to others. Lower number = higher priority. + """ + starts_at: StartsAt + """ + Resolved timestamp when the pricing override starts. + """ + type: Literal["multiplier", "overwrite_price"] + """ + The type of pricing override. + """ + _inner_class_types = { + "ends_at": EndsAt, + "multiplier": Multiplier, + "overwrite_price": OverwritePrice, + "starts_at": StartsAt, + } + + class StatusDetails(StripeObject): + class Active(StripeObject): + activated_at: str + """ + The timestamp when the contract was activated. + """ + + class Canceled(StripeObject): + canceled_at: str + """ + The timestamp when the contract was canceled. + """ + + active: Optional[Active] + """ + Details of the active contract status. + """ + canceled: Optional[Canceled] + """ + Details of the canceled contract status. + """ + _inner_class_types = {"active": Active, "canceled": Canceled} + + billing_settings: Optional[BillingSettings] + """ + The billing settings for the contract. + """ + contract_line_details: List[ContractLineDetail] + """ + The contract line details of the contract. Only populated when `contract_line_details` is passed in the `include` parameter. + """ + contract_number: str + """ + A unique user-provided contract number e.g. C-2026-0001. + """ + contract_value_details: ContractValueDetails + """ + The computed total value of all contract lines. + """ + created: str + """ + Timestamp of when the object was created. + """ + currency: str + """ + The currency of the contract. + """ + customer: str + """ + The ID of the customer associated with the contract. + """ + id: str + """ + The ID of the contract object. + """ + license_quantities: List[LicenseQuantity] + """ + The license quantities of the contract. Only populated when `license_quantities` is passed in the `include` parameter. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of key-value pairs that you can attach to an object. + """ + object: Literal["v2.billing.contract"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + one_time_fees: Optional[List[OneTimeFee]] + """ + The one-time fees of the contract. Only populated when `one_time_fees` is passed in the `include` parameter. + """ + pricing_lines: List[PricingLine] + """ + The pricing lines of the contract. Only populated when `pricing_lines` is passed in the `include` parameter. + """ + pricing_overrides: List[PricingOverride] + """ + The pricing overrides of the contract. Only populated when `pricing_overrides` is passed in the `include` parameter. + """ + status: Literal["active", "canceled", "draft", "ended"] + """ + The current status of the contract. + """ + status_details: StatusDetails + """ + Information about the contract status transitions. + """ + _inner_class_types = { + "billing_settings": BillingSettings, + "contract_line_details": ContractLineDetail, + "contract_value_details": ContractValueDetails, + "license_quantities": LicenseQuantity, + "one_time_fees": OneTimeFee, + "pricing_lines": PricingLine, + "pricing_overrides": PricingOverride, + "status_details": StatusDetails, + } diff --git a/stripe/v2/billing/_contract_license_pricing_quantity_change.py b/stripe/v2/billing/_contract_license_pricing_quantity_change.py new file mode 100644 index 000000000..102d62514 --- /dev/null +++ b/stripe/v2/billing/_contract_license_pricing_quantity_change.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class ContractLicensePricingQuantityChange(StripeObject): + """ + A license pricing quantity change object returned by ListContractLicenseQuantityChanges. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.billing.contract_license_pricing_quantity_change"] + ] = "v2.billing.contract_license_pricing_quantity_change" + created: str + """ + The timestamp when this quantity change object was created. + """ + effective_at: str + """ + The timestamp when this quantity change takes effect. + """ + id: str + """ + The ID of the quantity change object. + """ + license_pricing_id: str + """ + The ID of the license pricing. + """ + license_pricing_type: Literal["license_fee", "price"] + """ + The type of the license pricing. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.billing.contract_license_pricing_quantity_change"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + pricing_line: str + """ + The ID of the pricing line associated with this quantity change. + """ + quantity: int + """ + The quantity at the effective time. + """ diff --git a/stripe/v2/billing/_contract_service.py b/stripe/v2/billing/_contract_service.py new file mode 100644 index 000000000..3bd236fd5 --- /dev/null +++ b/stripe/v2/billing/_contract_service.py @@ -0,0 +1,318 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._encode import _coerce_v2_params +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.billing._contract_activate_params import ( + ContractActivateParams, + ) + from stripe.params.v2.billing._contract_cancel_params import ( + ContractCancelParams, + ) + from stripe.params.v2.billing._contract_create_params import ( + ContractCreateParams, + ) + from stripe.params.v2.billing._contract_list_params import ( + ContractListParams, + ) + from stripe.params.v2.billing._contract_retrieve_params import ( + ContractRetrieveParams, + ) + from stripe.params.v2.billing._contract_update_params import ( + ContractUpdateParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.billing._contract import Contract + from stripe.v2.billing.contracts._license_pricing_service import ( + LicensePricingService, + ) + +_subservices = { + "license_pricing": [ + "stripe.v2.billing.contracts._license_pricing_service", + "LicensePricingService", + ], +} + + +class ContractService(StripeService): + license_pricing: "LicensePricingService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() + + def list( + self, + params: Optional["ContractListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Contract]": + """ + List Contract objects with pagination. + """ + return cast( + "ListObject[Contract]", + self._request( + "get", + "/v2/billing/contracts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ContractListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Contract]": + """ + List Contract objects with pagination. + """ + return cast( + "ListObject[Contract]", + await self._request_async( + "get", + "/v2/billing/contracts", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "ContractCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Create a Contract object. + """ + return cast( + "Contract", + self._request( + "post", + "/v2/billing/contracts", + base_address="api", + params=_coerce_v2_params( + params, + { + "one_time_fees": { + "bill_schedule": {"value": "int64_string"}, + }, + }, + ), + options=options, + ), + ) + + async def create_async( + self, + params: "ContractCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Create a Contract object. + """ + return cast( + "Contract", + await self._request_async( + "post", + "/v2/billing/contracts", + base_address="api", + params=_coerce_v2_params( + params, + { + "one_time_fees": { + "bill_schedule": {"value": "int64_string"}, + }, + }, + ), + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["ContractRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Retrieve a Contract object by ID. + """ + return cast( + "Contract", + self._request( + "get", + "/v2/billing/contracts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["ContractRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Retrieve a Contract object by ID. + """ + return cast( + "Contract", + await self._request_async( + "get", + "/v2/billing/contracts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: Optional["ContractUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Update a Contract object by ID. + """ + return cast( + "Contract", + self._request( + "post", + "/v2/billing/contracts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: Optional["ContractUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Update a Contract object by ID. + """ + return cast( + "Contract", + await self._request_async( + "post", + "/v2/billing/contracts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def activate( + self, + id: str, + params: Optional["ContractActivateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Activate a Draft Contract object by ID. + """ + return cast( + "Contract", + self._request( + "post", + "/v2/billing/contracts/{id}/activate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def activate_async( + self, + id: str, + params: Optional["ContractActivateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Activate a Draft Contract object by ID. + """ + return cast( + "Contract", + await self._request_async( + "post", + "/v2/billing/contracts/{id}/activate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + id: str, + params: Optional["ContractCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Cancel a Contract object by ID. + """ + return cast( + "Contract", + self._request( + "post", + "/v2/billing/contracts/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: Optional["ContractCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Contract": + """ + Cancel a Contract object by ID. + """ + return cast( + "Contract", + await self._request_async( + "post", + "/v2/billing/contracts/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/billing/contracts/__init__.py b/stripe/v2/billing/contracts/__init__.py new file mode 100644 index 000000000..4d22cda83 --- /dev/null +++ b/stripe/v2/billing/contracts/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.billing.contracts import license_pricing as license_pricing + from stripe.v2.billing.contracts._license_pricing_service import ( + LicensePricingService as LicensePricingService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "license_pricing": ("stripe.v2.billing.contracts.license_pricing", True), + "LicensePricingService": ( + "stripe.v2.billing.contracts._license_pricing_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/contracts/_license_pricing_service.py b/stripe/v2/billing/contracts/_license_pricing_service.py new file mode 100644 index 000000000..8b6efa1ad --- /dev/null +++ b/stripe/v2/billing/contracts/_license_pricing_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.billing.contracts.license_pricing._quantity_change_service import ( + QuantityChangeService, + ) + +_subservices = { + "quantity_changes": [ + "stripe.v2.billing.contracts.license_pricing._quantity_change_service", + "QuantityChangeService", + ], +} + + +class LicensePricingService(StripeService): + quantity_changes: "QuantityChangeService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/contracts/license_pricing/__init__.py b/stripe/v2/billing/contracts/license_pricing/__init__.py new file mode 100644 index 000000000..a9fa64908 --- /dev/null +++ b/stripe/v2/billing/contracts/license_pricing/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.billing.contracts.license_pricing._quantity_change_service import ( + QuantityChangeService as QuantityChangeService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "QuantityChangeService": ( + "stripe.v2.billing.contracts.license_pricing._quantity_change_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/contracts/license_pricing/_quantity_change_service.py b/stripe/v2/billing/contracts/license_pricing/_quantity_change_service.py new file mode 100644 index 000000000..75a551b8e --- /dev/null +++ b/stripe/v2/billing/contracts/license_pricing/_quantity_change_service.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.billing.contracts.license_pricing._quantity_change_list_quantity_changes_params import ( + QuantityChangeListQuantityChangesParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.billing._contract_license_pricing_quantity_change import ( + ContractLicensePricingQuantityChange, + ) + + +class QuantityChangeService(StripeService): + def list_quantity_changes( + self, + contract_id: str, + license_pricing_id: str, + params: Optional["QuantityChangeListQuantityChangesParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ContractLicensePricingQuantityChange]": + """ + List license quantity changes for a contract given a license pricing ID. + """ + return cast( + "ListObject[ContractLicensePricingQuantityChange]", + self._request( + "get", + "/v2/billing/contracts/{contract_id}/license_pricing/{license_pricing_id}/quantity_changes".format( + contract_id=sanitize_id(contract_id), + license_pricing_id=sanitize_id(license_pricing_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_quantity_changes_async( + self, + contract_id: str, + license_pricing_id: str, + params: Optional["QuantityChangeListQuantityChangesParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ContractLicensePricingQuantityChange]": + """ + List license quantity changes for a contract given a license pricing ID. + """ + return cast( + "ListObject[ContractLicensePricingQuantityChange]", + await self._request_async( + "get", + "/v2/billing/contracts/{contract_id}/license_pricing/{license_pricing_id}/quantity_changes".format( + contract_id=sanitize_id(contract_id), + license_pricing_id=sanitize_id(license_pricing_id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/data/reporting/_query_run.py b/stripe/v2/data/reporting/_query_run.py index 859da3711..89ce62a9a 100644 --- a/stripe/v2/data/reporting/_query_run.py +++ b/stripe/v2/data/reporting/_query_run.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -27,6 +27,18 @@ class DownloadUrl(StripeObject): The URL that can be used for accessing the file. """ + class Schema(StripeObject): + name: str + """ + The name of the column. + """ + type: Literal[ + "boolean", "double", "bigint", "varchar", "timestamp" + ] + """ + The type of the column. + """ + content_type: Literal["csv", "zip"] """ The content type of the file. @@ -35,11 +47,18 @@ class DownloadUrl(StripeObject): """ A pre-signed URL that allows secure, time-limited access to download the file. """ + schema: List[Schema] + """ + The columns of the schema. + """ size: int """ The total size of the file in bytes. """ - _inner_class_types = {"download_url": DownloadUrl} + _inner_class_types = { + "download_url": DownloadUrl, + "schema": Schema, + } _field_encodings = {"size": "int64_string"} file: Optional[File] diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index 5d4a1fb0e..4d3eb3dce 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -67,6 +67,7 @@ class Failed(StripeObject): "paper_check_attachment_too_large", "paper_check_expired", "paper_check_undeliverable", + "payout_method_amount_limit_exceeded", "payout_method_declined", "payout_method_does_not_exist", "payout_method_expired", diff --git a/stripe/v2/reporting/_report_run.py b/stripe/v2/reporting/_report_run.py index f95f4d511..fdc392f40 100644 --- a/stripe/v2/reporting/_report_run.py +++ b/stripe/v2/reporting/_report_run.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import Any, ClassVar, Optional +from typing import Any, ClassVar, List, Optional from typing_extensions import Literal @@ -28,6 +28,18 @@ class DownloadUrl(StripeObject): The URL that can be used for accessing the file. """ + class Schema(StripeObject): + name: str + """ + The name of the column. + """ + type: Literal[ + "boolean", "double", "bigint", "varchar", "timestamp" + ] + """ + The type of the column. + """ + content_type: Literal["csv", "zip"] """ The content type of the file. @@ -36,11 +48,18 @@ class DownloadUrl(StripeObject): """ A pre-signed URL that allows secure, time-limited access to download the file. """ + schema: List[Schema] + """ + The columns of the schema. + """ size: int """ The total size of the file in bytes. """ - _inner_class_types = {"download_url": DownloadUrl} + _inner_class_types = { + "download_url": DownloadUrl, + "schema": Schema, + } _field_encodings = {"size": "int64_string"} file: Optional[File] diff --git a/stripe/v2/signals/__init__.py b/stripe/v2/signals/__init__.py new file mode 100644 index 000000000..9ede77748 --- /dev/null +++ b/stripe/v2/signals/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.signals._account_signal import ( + AccountSignal as AccountSignal, + ) + from stripe.v2.signals._account_signal_service import ( + AccountSignalService as AccountSignalService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "AccountSignal": ("stripe.v2.signals._account_signal", False), + "AccountSignalService": ( + "stripe.v2.signals._account_signal_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/signals/_account_signal.py b/stripe/v2/signals/_account_signal.py new file mode 100644 index 000000000..ab7fe445a --- /dev/null +++ b/stripe/v2/signals/_account_signal.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from decimal import Decimal +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class AccountSignal(StripeObject): + """ + An automatically evaluated signal on a v2 account. + """ + + OBJECT_NAME: ClassVar[Literal["v2.signals.account_signal"]] = ( + "v2.signals.account_signal" + ) + + class AccountDetails(StripeObject): + account: Optional[str] + """ + The v2 account ID of the account. + """ + customer: Optional[str] + """ + The v1 customer ID of the account, for users not yet migrated to v2/accounts. + """ + + class FraudulentMerchant(StripeObject): + class Indicator(StripeObject): + explanation: str + """ + A brief explanation of how this indicator contributed to the fraudulent merchant probability. + """ + impact: Literal[ + "decrease", "neutral", "slight_increase", "strong_increase" + ] + """ + The effect this indicator had on the overall risk level. + """ + indicator: Literal[ + "bank_account", + "business_information_and_account_activity", + "disputes", + "failures", + "geolocation", + "other", + "other_related_accounts", + "other_transaction_activity", + "owner_email", + ] + """ + The name of the specific indicator used in the risk assessment. + """ + + indicators: List[Indicator] + """ + Array of objects representing individual factors that contributed to the calculated probability. Absent when risk level is not_assessed or unknown, + or when the user is not on a product tier that includes indicators. + """ + probability: Optional[Decimal] + """ + The probability of the merchant being fraudulent. Can be between 0.00 and 100.00. Absent when risk level is not_assessed or unknown, + or when the user is not on a product tier that includes numeric scores. + """ + risk_level: Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ] + """ + Categorical assessment of the fraudulent merchant risk based on probability. + """ + _inner_class_types = {"indicators": Indicator} + _field_encodings = {"probability": "decimal_string"} + + class MerchantDelinquency(StripeObject): + class Indicator(StripeObject): + explanation: str + """ + A brief explanation of how this indicator contributed to the delinquency probability. + """ + impact: Literal[ + "decrease", "neutral", "slight_increase", "strong_increase" + ] + """ + The effect this indicator had on the overall risk level. + """ + indicator: Literal[ + "account_balance", + "aov", + "charge_concentration", + "disputes", + "dispute_window", + "exposure", + "firmographic", + "lifetime_metrics", + "other", + "payment_processing", + "payment_volume", + "payouts", + "refunds", + "related_accounts", + "tenure", + "transfers", + ] + """ + The name of the specific indicator used in the risk assessment. + """ + + indicators: List[Indicator] + """ + Array of objects representing individual factors that contributed to the calculated probability of delinquency. Absent when risk level is not_assessed or unknown, + or when the user is not on a product tier that includes indicators. + """ + probability: Optional[Decimal] + """ + The probability of delinquency. Can be between 0.00 and 100.00. Absent when risk level is not_assessed or unknown, + or when the user is not on a product tier that includes numeric scores. + """ + risk_level: Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ] + """ + Categorical assessment of the delinquency risk based on probability. + """ + _inner_class_types = {"indicators": Indicator} + _field_encodings = {"probability": "decimal_string"} + + account_details: Optional[AccountDetails] + """ + The account or customer this signal is associated with. + """ + created: str + """ + Timestamp at which the signal was created. + """ + fraudulent_merchant: Optional[FraudulentMerchant] + """ + Data for the fraudulent merchant signal. Present only when type is fraudulent_merchant. + """ + id: str + """ + Unique identifier for the account signal. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + merchant_delinquency: Optional[MerchantDelinquency] + """ + Data for the merchant delinquency signal. Present only when type is merchant_delinquency. + """ + object: Literal["v2.signals.account_signal"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + type: Literal["fraudulent_merchant", "merchant_delinquency"] + """ + The type of signal. + """ + _inner_class_types = { + "account_details": AccountDetails, + "fraudulent_merchant": FraudulentMerchant, + "merchant_delinquency": MerchantDelinquency, + } diff --git a/stripe/v2/signals/_account_signal_service.py b/stripe/v2/signals/_account_signal_service.py new file mode 100644 index 000000000..e363cc6a7 --- /dev/null +++ b/stripe/v2/signals/_account_signal_service.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.signals._account_signal_list_params import ( + AccountSignalListParams, + ) + from stripe.params.v2.signals._account_signal_retrieve_params import ( + AccountSignalRetrieveParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.signals._account_signal import AccountSignal + + +class AccountSignalService(StripeService): + def list( + self, + params: "AccountSignalListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[AccountSignal]": + """ + Lists AccountSignals for a given account or customer, filtered by signal type. + """ + return cast( + "ListObject[AccountSignal]", + self._request( + "get", + "/v2/signals/account_signals", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "AccountSignalListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[AccountSignal]": + """ + Lists AccountSignals for a given account or customer, filtered by signal type. + """ + return cast( + "ListObject[AccountSignal]", + await self._request_async( + "get", + "/v2/signals/account_signals", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["AccountSignalRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "AccountSignal": + """ + Retrieves an AccountSignal by its ID. + """ + return cast( + "AccountSignal", + self._request( + "get", + "/v2/signals/account_signals/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["AccountSignalRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "AccountSignal": + """ + Retrieves an AccountSignal by its ID. + """ + return cast( + "AccountSignal", + await self._request_async( + "get", + "/v2/signals/account_signals/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 9681f0bdd..0612fcdfb 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -43912,6 +43912,331 @@ def test_v2_billing_collection_settings_version_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_billing_contract_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/billing/contracts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.list() + http_client_mock.assert_requested( + "get", + path="/v2/billing/contracts", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_billing_contract_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/contracts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.create( + { + "contract_lines": [ + { + "ends_at": {"timestamp": "1970-01-01T15:18:46.294Z"}, + "metadata": {"key": "metadata"}, + "overrides": [ + { + "ends_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + }, + "service_action": { + "add": { + "credit_grant": { + "amount": { + "monetary": { + "currency": "USD", + "value": 63, + }, + "type": "monetary", + }, + "applicability_config": { + "scope": { + "billable_items": [ + "billable_items", + ], + "price_type": "metered", + }, + }, + "category": "paid", + "expiry_config": { + "type": "end_of_service_period", + }, + "name": "name", + "priority": 1165461084, + }, + "service_interval": "month", + "service_interval_count": 1375336415, + "type": "credit_grant", + }, + "replace": { + "credit_grant": { + "amount": { + "monetary": { + "currency": "USD", + "value": 63, + }, + "type": "monetary", + }, + "applicability_config": { + "scope": { + "billable_items": [ + "billable_items", + ], + "price_type": "metered", + }, + }, + "category": "paid", + "expiry_config": { + "type": "end_of_service_period", + }, + "name": "name", + "priority": 1165461084, + }, + "id": "obj_123", + "lookup_key": "lookup_key", + "service_interval": "month", + "service_interval_count": 1375336415, + "type": "credit_grant", + }, + "type": "add", + }, + "starts_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + }, + "type": "service_action", + }, + ], + "pricing": {}, + "starts_at": {"timestamp": "1970-01-01T15:18:46.294Z"}, + }, + ], + "contract_number": "contract_number", + "currency": "usd", + "license_quantity_actions": [ + { + "effective_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + "type": "timestamp", + }, + "license_pricing_id": "license_pricing_id", + "license_pricing_lookup_key": "license_pricing_lookup_key", + "license_pricing_type": "price", + "pricing_line": "pricing_line", + "set": {"quantity": 1285004149}, + "type": "set", + }, + ], + "pricing_lines": [ + { + "ends_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + "type": "contract_end", + }, + "lookup_key": "lookup_key", + "metadata": {"key": "metadata"}, + "pricing": { + "price_details": { + "price": "price", + "quantity": 1285004149, + }, + "type": "price", + }, + "starts_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + "type": "contract_start", + }, + }, + ], + "pricing_overrides": [ + { + "ends_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + "type": "contract_end", + }, + "lookup_key": "lookup_key", + "multiplier": { + "criteria": [ + { + "billable_item_ids": ["billable_item_ids"], + "billable_item_lookup_keys": [ + "billable_item_lookup_keys", + ], + "billable_item_types": ["metered"], + "metadata_conditions": [ + { + "all_of": [ + { + "key": "key", + "value": "value", + }, + ], + }, + ], + "rate_card_ids": ["rate_card_ids"], + "type": "exclude", + }, + ], + "factor": "factor", + }, + "overwrite_price": { + "price": "price", + "tiering_mode": "graduated", + "tiers": [ + { + "flat_amount": "flat_amount", + "unit_amount": "unit_amount", + "up_to_decimal": Decimal( + "1387931359.3333333" + ), + "up_to_inf": "inf", + }, + ], + "unit_amount": "unit_amount", + }, + "priority": 1165461084, + "starts_at": { + "timestamp": "1970-01-01T15:18:46.294Z", + "type": "contract_start", + }, + "type": "multiplier", + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/contracts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"contract_lines":[{"ends_at":{"timestamp":"1970-01-01T15:18:46.294Z"},"metadata":{"key":"metadata"},"overrides":[{"ends_at":{"timestamp":"1970-01-01T15:18:46.294Z"},"service_action":{"add":{"credit_grant":{"amount":{"monetary":{"currency":"USD","value":63},"type":"monetary"},"applicability_config":{"scope":{"billable_items":["billable_items"],"price_type":"metered"}},"category":"paid","expiry_config":{"type":"end_of_service_period"},"name":"name","priority":1165461084},"service_interval":"month","service_interval_count":1375336415,"type":"credit_grant"},"replace":{"credit_grant":{"amount":{"monetary":{"currency":"USD","value":63},"type":"monetary"},"applicability_config":{"scope":{"billable_items":["billable_items"],"price_type":"metered"}},"category":"paid","expiry_config":{"type":"end_of_service_period"},"name":"name","priority":1165461084},"id":"obj_123","lookup_key":"lookup_key","service_interval":"month","service_interval_count":1375336415,"type":"credit_grant"},"type":"add"},"starts_at":{"timestamp":"1970-01-01T15:18:46.294Z"},"type":"service_action"}],"pricing":{},"starts_at":{"timestamp":"1970-01-01T15:18:46.294Z"}}],"contract_number":"contract_number","currency":"usd","license_quantity_actions":[{"effective_at":{"timestamp":"1970-01-01T15:18:46.294Z","type":"timestamp"},"license_pricing_id":"license_pricing_id","license_pricing_lookup_key":"license_pricing_lookup_key","license_pricing_type":"price","pricing_line":"pricing_line","set":{"quantity":1285004149},"type":"set"}],"pricing_lines":[{"ends_at":{"timestamp":"1970-01-01T15:18:46.294Z","type":"contract_end"},"lookup_key":"lookup_key","metadata":{"key":"metadata"},"pricing":{"price_details":{"price":"price","quantity":1285004149},"type":"price"},"starts_at":{"timestamp":"1970-01-01T15:18:46.294Z","type":"contract_start"}}],"pricing_overrides":[{"ends_at":{"timestamp":"1970-01-01T15:18:46.294Z","type":"contract_end"},"lookup_key":"lookup_key","multiplier":{"criteria":[{"billable_item_ids":["billable_item_ids"],"billable_item_lookup_keys":["billable_item_lookup_keys"],"billable_item_types":["metered"],"metadata_conditions":[{"all_of":[{"key":"key","value":"value"}]}],"rate_card_ids":["rate_card_ids"],"type":"exclude"}],"factor":"factor"},"overwrite_price":{"price":"price","tiering_mode":"graduated","tiers":[{"flat_amount":"flat_amount","unit_amount":"unit_amount","up_to_decimal":"1387931359.3333333","up_to_inf":"inf"}],"unit_amount":"unit_amount"},"priority":1165461084,"starts_at":{"timestamp":"1970-01-01T15:18:46.294Z","type":"contract_start"},"type":"multiplier"}]}', + is_json=True, + ) + + def test_v2_billing_contract_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/billing/contracts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/billing/contracts/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_billing_contract_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/contracts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/billing/contracts/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_billing_contract_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/contracts/id_123/activate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.activate("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/billing/contracts/id_123/activate", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_billing_contract_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/contracts/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/billing/contracts/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_billing_contracts_license_pricing_quantity_change_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/billing/contracts/contract_id_123/license_pricing/license_pricing_id_123/quantity_changes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.contracts.license_pricing.quantity_changes.list_quantity_changes( + "contract_id_123", + "license_pricing_id_123", + ) + http_client_mock.assert_requested( + "get", + path="/v2/billing/contracts/contract_id_123/license_pricing/license_pricing_id_123/quantity_changes", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_billing_custom_pricing_unit_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -49317,6 +49642,51 @@ def test_v2_reporting_report_run_get_service( api_base="https://api.stripe.com", ) + def test_v2_signals_account_signal_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/signals/account_signals", + "type[0]=fraudulent_merchant", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.signals.account_signals.list( + { + "type": ["fraudulent_merchant"], + } + ) + http_client_mock.assert_requested( + "get", + path="/v2/signals/account_signals", + query_string="type[0]=fraudulent_merchant", + api_base="https://api.stripe.com", + ) + + def test_v2_signals_account_signal_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/signals/account_signals/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.signals.account_signals.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/signals/account_signals/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_tax_manual_rule_get_service( self, http_client_mock: HTTPClientMock ) -> None: