diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffa250852..b87e62c21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,7 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" - "pypy-3.7" - "pypy-3.8" - "pypy-3.9" diff --git a/API_VERSION b/API_VERSION index e48768f4a..672166605 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -3602014a6583f6c0fbfdde3c575839ac7d0b4e9c \ No newline at end of file +0822236fb875490aa7ccc7b66dbb52f8965ee062 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c1ea8db7..4147d4b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,27 +39,47 @@ * Add support for event notifications `V2PaymentsSettlementAllocationIntentSplitCanceledEvent`, `V2PaymentsSettlementAllocationIntentSplitCreatedEvent`, and `V2PaymentsSettlementAllocationIntentSplitSettledEvent` with related object `v2.payments.SettlementAllocationIntentSplit` * Remove support for error code `account_rate_limit_exceeded` on `RateLimitError` -## 14.1.0a4 - 2025-12-04 -* [#1691](https://github.com/stripe/stripe-python/pull/1691) Update generated code for private-preview - * Add support for event notifications `V2IamApiKeyCreatedEvent`, `V2IamApiKeyDefaultSecretRevealedEvent`, `V2IamApiKeyExpiredEvent`, `V2IamApiKeyPermissionsUpdatedEvent`, `V2IamApiKeyRotatedEvent`, and `V2IamApiKeyUpdatedEvent` -* [#1686](https://github.com/stripe/stripe-python/pull/1686) Update generated code for private-preview - * Add support for `check_scanning` on `AccountSession.Component` - * Add support for `client` on `V2.Core.Event.Reason.Request` - * Add support for `stripe_balance_payment` on `V2.MoneyManagement.ReceivedCredit` and `V2.MoneyManagement.ReceivedDebit` - * Add support for new value `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedCredit.type` - * Add support for `balance_transfer` on `V2.MoneyManagement.ReceivedDebit` - * Add support for new values `balance_transfer` and `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedDebit.type` - * Add support for `include` on `v2.core.EventListParams` and `v2.core.EventRetrieveParams` +## 14.1.0 - 2025-12-16 +This release changes the pinned API version to `2025-12-15.clover`. -## 14.1.0a3 - 2025-11-24 -* [#1685](https://github.com/stripe/stripe-python/pull/1685) Update generated code for private-preview - * Add support for new resource `product_catalog.TrialOffer` - * Add support for `create` method on resource `product_catalog.TrialOffer` - * Remove support for `amount_subtotal_after_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` and `DelegatedCheckout.RequestedSession.TotalDetail` - * Remove support for `amount_total`, `unit_amount_after_discount`, and `unit_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` - * Add support for `amount_cart_discount` and `amount_items_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` - * Remove support for `amount_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` - * Add support for `payments_orchestration` on `PaymentIntentCreateParams` and `PaymentIntent` +* [#1696](https://github.com/stripe/stripe-python/pull/1696) Update generated code + * Add support for new resources `v2.core.AccountLink`, `v2.core.AccountPersonToken`, `v2.core.AccountPerson`, `v2.core.AccountToken`, and `v2.core.Account` + * Add support for `create` and `retrieve` methods on resources `v2.core.AccountPersonToken` and `v2.core.AccountToken` + * Add support for `create` method on resource `v2.core.AccountLink` + * Add support for `close`, `create`, `list`, `modify`, and `retrieve` methods on resource `v2.core.Account` + * Add support for `create`, `delete`, `list`, `modify`, and `retrieve` methods on resource `v2.core.AccountPerson` + * Add support for `customer_account` on `Billing.CreditBalanceSummary`, `Billing.CreditGrant`, `BillingPortal.Session`, `CashBalance`, `Checkout.Session`, `ConfirmationToken.PaymentMethodPreview`, `CreditNoteListParams`, `CreditNote`, `CustomerBalanceTransaction`, `CustomerCashBalanceTransaction`, `CustomerSessionCreateParams`, `CustomerSession`, `Customer`, `Discount`, `FinancialConnections.Account.AccountHolder`, `FinancialConnections.Session.AccountHolder`, `InvoiceCreateParams`, `InvoiceCreatePreviewParams`, `InvoiceItemCreateParams`, `InvoiceItemListParams`, `InvoiceItem`, `InvoiceListParams`, `Invoice`, `PaymentIntentCreateParams`, `PaymentIntentListParams`, `PaymentIntentModifyParams`, `PaymentIntent`, `PaymentMethodAttachParams`, `PaymentMethodListParams`, `PaymentMethod`, `PromotionCodeCreateParams`, `PromotionCodeListParams`, `PromotionCode`, `QuoteCreateParams`, `QuoteListParams`, `QuoteModifyParams`, `Quote`, `SetupAttempt`, `SetupIntentCreateParams`, `SetupIntentListParams`, `SetupIntentModifyParams`, `SetupIntent`, `SubscriptionCreateParams`, `SubscriptionListParams`, `SubscriptionScheduleCreateParams`, `SubscriptionScheduleListParams`, `SubscriptionSchedule`, `Subscription`, `TaxId.Owner`, `TaxIdCreateParamsOwner`, `TaxIdListParamsOwner`, `TaxId`, `billing.CreditBalanceSummaryRetrieveParams`, `billing.CreditBalanceTransactionListParams`, `billing.CreditGrantCreateParams`, `billing.CreditGrantListParams`, `billing_portal.SessionCreateParams`, `checkout.SessionCreateParams`, `checkout.SessionListParams`, `financial_connections.AccountListParamsAccountHolder`, and `financial_connections.SessionCreateParamsAccountHolder` + * Add support for `metadata` on `LineItem` and `checkout.SessionCreateParamsLineItem` + * Add support for `payto_payments` on `Account.Capability`, `AccountCreateParamsCapability`, and `AccountModifyParamsCapability` + * Add support for `signer` on `AccountCreateParamsDocumentProofOfRegistration`, `AccountCreateParamsDocumentProofOfUltimateBeneficialOwnership`, `AccountModifyParamsDocumentProofOfRegistration`, and `AccountModifyParamsDocumentProofOfUltimateBeneficialOwnership` + * Change `CustomerSessionCreateParams.customer`, `InvoiceItemCreateParams.customer`, `PaymentMethodAttachParams.customer`, `SubscriptionCreateParams.customer`, `billing.CreditBalanceSummaryRetrieveParams.customer`, `billing.CreditBalanceTransactionListParams.customer`, `billing.CreditGrantCreateParams.customer`, and `billing_portal.SessionCreateParams.customer` to be optional + * Add support for `billing_cycle_anchor` on `BillingPortal.Configuration.Feature.SubscriptionUpdate`, `billing_portal.ConfigurationCreateParamsFeatureSubscriptionUpdate`, and `billing_portal.ConfigurationModifyParamsFeatureSubscriptionUpdate` + * Add support for `payto` on `Charge.PaymentMethodDetail`, `Checkout.Session.PaymentMethodOption`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Mandate.PaymentMethodDetail`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodOption`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethodModifyParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.PaymentMethodOption`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentConfirmParamsPaymentMethodOption`, `SetupIntentCreateParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodOption`, `SetupIntentModifyParamsPaymentMethodDatum`, `SetupIntentModifyParamsPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, `SubscriptionModifyParamsPaymentSettingPaymentMethodOption`, and `checkout.SessionCreateParamsPaymentMethodOption` + * Add support for `expected_debit_date` on `Charge.PaymentMethodDetail.AcssDebit`, `Charge.PaymentMethodDetail.AuBecsDebit`, `Charge.PaymentMethodDetail.BacsDebit`, `Charge.PaymentMethodDetail.NzBankAccount`, `Charge.PaymentMethodDetail.SepaDebit`, `Charge.PaymentMethodDetail.UsBankAccount`, `PaymentAttemptRecord.PaymentMethodDetail.AcssDebit`, `PaymentAttemptRecord.PaymentMethodDetail.AuBecsDebit`, `PaymentAttemptRecord.PaymentMethodDetail.BacsDebit`, `PaymentAttemptRecord.PaymentMethodDetail.NzBankAccount`, `PaymentAttemptRecord.PaymentMethodDetail.SepaDebit`, `PaymentAttemptRecord.PaymentMethodDetail.UsBankAccount`, `PaymentRecord.PaymentMethodDetail.AcssDebit`, `PaymentRecord.PaymentMethodDetail.AuBecsDebit`, `PaymentRecord.PaymentMethodDetail.BacsDebit`, `PaymentRecord.PaymentMethodDetail.NzBankAccount`, `PaymentRecord.PaymentMethodDetail.SepaDebit`, and `PaymentRecord.PaymentMethodDetail.UsBankAccount` + * Add support for new value `mollie` on enums `Charge.PaymentMethodDetail.Ideal.bank`, `ConfirmationToken.PaymentMethodPreview.Ideal.bank`, `ConfirmationTokenCreateParamsPaymentMethodDatumIdeal.bank`, `PaymentAttemptRecord.PaymentMethodDetail.Ideal.bank`, `PaymentIntentConfirmParamsPaymentMethodDatumIdeal.bank`, `PaymentIntentCreateParamsPaymentMethodDatumIdeal.bank`, `PaymentIntentModifyParamsPaymentMethodDatumIdeal.bank`, `PaymentMethod.Ideal.bank`, `PaymentMethodCreateParamsIdeal.bank`, `PaymentRecord.PaymentMethodDetail.Ideal.bank`, `SetupAttempt.PaymentMethodDetail.Ideal.bank`, `SetupIntentConfirmParamsPaymentMethodDatumIdeal.bank`, `SetupIntentCreateParamsPaymentMethodDatumIdeal.bank`, and `SetupIntentModifyParamsPaymentMethodDatumIdeal.bank` + * Add support for new value `MLLENL2A` on enums `Charge.PaymentMethodDetail.Ideal.bic`, `ConfirmationToken.PaymentMethodPreview.Ideal.bic`, `PaymentAttemptRecord.PaymentMethodDetail.Ideal.bic`, `PaymentMethod.Ideal.bic`, `PaymentRecord.PaymentMethodDetail.Ideal.bic`, and `SetupAttempt.PaymentMethodDetail.Ideal.bic` + * Add support for new value `payto` on enums `PaymentIntent.excluded_payment_method_types`, `PaymentIntentConfirmParams.excluded_payment_method_types`, `PaymentIntentCreateParams.excluded_payment_method_types`, `PaymentIntentModifyParams.excluded_payment_method_types`, `SetupIntent.excluded_payment_method_types`, `SetupIntentCreateParams.excluded_payment_method_types`, `SetupIntentModifyParams.excluded_payment_method_types`, and `checkout.SessionCreateParams.excluded_payment_method_types` + * Add support for new value `payto` on enum `checkout.SessionCreateParams.payment_method_types` + * Add support for `line_items` on `checkout.SessionModifyParams` + * Add support for new value `payto` on enums `ConfirmationTokenCreateParamsPaymentMethodDatum.type`, `PaymentIntentConfirmParamsPaymentMethodDatum.type`, `PaymentIntentCreateParamsPaymentMethodDatum.type`, `PaymentIntentModifyParamsPaymentMethodDatum.type`, `SetupIntentConfirmParamsPaymentMethodDatum.type`, `SetupIntentCreateParamsPaymentMethodDatum.type`, and `SetupIntentModifyParamsPaymentMethodDatum.type` + * Add support for new value `payto` on enums `ConfirmationToken.PaymentMethodPreview.type` and `PaymentMethod.type` + * Add support for new value `payto` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type` + * Add support for `invoice` on `CustomerListCustomerBalanceTransactionParams` + * Add support for `related_customer_account` on `Identity.VerificationSession`, `identity.VerificationSessionCreateParams`, and `identity.VerificationSessionListParams` + * Change type of `InvoiceItem.Pricing.PriceDetail.price` and `InvoiceLineItem.Pricing.PriceDetail.price` from `string` to `expandable($Price)` + * Add support for new value `payto` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * Add support for `subtotal` on `InvoiceLineItem` + * Add support for `authorization_code`, `description`, `iin`, `installments`, `issuer`, `network_advice_code`, `network_decline_code`, and `stored_credential_usage` on `PaymentAttemptRecord.PaymentMethodDetail.Card` and `PaymentRecord.PaymentMethodDetail.Card` + * Change `PaymentIntent.transfer_data` to be optional + * Add support for new value `payto` on enums `PaymentLink.payment_method_types`, `PaymentLinkCreateParams.payment_method_types`, and `PaymentLinkModifyParams.payment_method_types` + * Add support for `allow_redisplay` on `PaymentMethodListParams` + * Add support for `reported_by` on `PaymentRecord` + * Change `Product.tax_code` to be optional + * Add support for new values `2025-12-15.clover` and `2026-01-28.clover` on enum `WebhookEndpointCreateParams.api_version` + * Add support for `changes` on `V2.Core.Event` + * Add support for error code `account_token_required_for_v2_account` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError` +* [#1692](https://github.com/stripe/stripe-python/pull/1692) Updated bundled CA certificates +* [#1676](https://github.com/stripe/stripe-python/pull/1676) Add create_async method to EphemeralKey ## 14.1.0b1 - 2025-11-18 This release changes the pinned API version to `2025-11-17.preview`. @@ -96,6 +116,28 @@ This release changes the pinned API version to `2025-11-17.preview`. * Add support for thin event `V2CoreHealthEventGenerationFailureResolvedEvent` * Remove support for thin events `V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent`, `V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent`, `V2PaymentsOffSessionPaymentCanceledEvent`, `V2PaymentsOffSessionPaymentCreatedEvent`, `V2PaymentsOffSessionPaymentFailedEvent`, `V2PaymentsOffSessionPaymentRequiresCaptureEvent`, and `V2PaymentsOffSessionPaymentSucceededEvent` with related object `v2.payments.OffSessionPayment` +## 14.1.0a4 - 2025-12-04 +* [#1691](https://github.com/stripe/stripe-python/pull/1691) Update generated code for private-preview + * Add support for event notifications `V2IamApiKeyCreatedEvent`, `V2IamApiKeyDefaultSecretRevealedEvent`, `V2IamApiKeyExpiredEvent`, `V2IamApiKeyPermissionsUpdatedEvent`, `V2IamApiKeyRotatedEvent`, and `V2IamApiKeyUpdatedEvent` +* [#1686](https://github.com/stripe/stripe-python/pull/1686) Update generated code for private-preview + * Add support for `check_scanning` on `AccountSession.Component` + * Add support for `client` on `V2.Core.Event.Reason.Request` + * Add support for `stripe_balance_payment` on `V2.MoneyManagement.ReceivedCredit` and `V2.MoneyManagement.ReceivedDebit` + * Add support for new value `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedCredit.type` + * Add support for `balance_transfer` on `V2.MoneyManagement.ReceivedDebit` + * Add support for new values `balance_transfer` and `stripe_balance_payment` on enum `V2.MoneyManagement.ReceivedDebit.type` + * Add support for `include` on `v2.core.EventListParams` and `v2.core.EventRetrieveParams` + +## 14.1.0a3 - 2025-11-24 +* [#1685](https://github.com/stripe/stripe-python/pull/1685) Update generated code for private-preview + * Add support for new resource `product_catalog.TrialOffer` + * Add support for `create` method on resource `product_catalog.TrialOffer` + * Remove support for `amount_subtotal_after_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` and `DelegatedCheckout.RequestedSession.TotalDetail` + * Remove support for `amount_total`, `unit_amount_after_discount`, and `unit_discount` on `DelegatedCheckout.RequestedSession.LineItemDetail` + * Add support for `amount_cart_discount` and `amount_items_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` + * Remove support for `amount_discount` on `DelegatedCheckout.RequestedSession.TotalDetail` + * Add support for `payments_orchestration` on `PaymentIntentCreateParams` and `PaymentIntent` + ## 14.1.0a2 - 2025-11-20 This release changes the pinned API version to `2025-11-17.preview`. @@ -245,7 +287,7 @@ This release changes the pinned API version to `2025-11-17.preview`. ## 14.0.1 - 2025-11-21 * [#1684](https://github.com/stripe/stripe-python/pull/1684) Update generated code - * `stripe.error` module is now accessible globally. Fixes [#1682](https://github.com/stripe/stripe-python/issues/1682) + * `stripe.error` module is now accessible globally. Fixes [#1682](https://github.com/stripe/stripe-python/issues/1682) * [#1681](https://github.com/stripe/stripe-python/pull/1681) Throw a specific error when accessing `payment_intent` property on `Invoice` object to ease debugging. ## 14.0.0 - 2025-11-18 diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4e4ca8e5b..6a50c81b8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2141 \ No newline at end of file +v2148 \ No newline at end of file diff --git a/stripe/_invoice.py b/stripe/_invoice.py index b3f1b1d67..0b5929fe4 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -746,6 +746,10 @@ class ScheduleDetails(StripeObject): """ The schedule that generated this invoice """ + subscription: Optional[ExpandableField["Subscription"]] + """ + The subscription associated with this schedule + """ class SubscriptionDetails(StripeObject): class PauseCollection(StripeObject): diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 658f09458..7ed47fd28 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -324,6 +324,7 @@ "CalculationLineItem", ), "tax.form": ("stripe.tax._form", "Form"), + "tax.location": ("stripe.tax._location", "Location"), "tax.registration": ("stripe.tax._registration", "Registration"), "tax.settings": ("stripe.tax._settings", "Settings"), "tax.transaction": ("stripe.tax._transaction", "Transaction"), diff --git a/stripe/_quote.py b/stripe/_quote.py index 9079ee09c..4251d4fac 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -771,10 +771,10 @@ class Prebilling(StripeObject): Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ phase_effective_at: Optional[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the quote handles billing for line transitions. Possible values are `line_start` (default) or `billing_period_start`. `line_start` bills based on the current state of the line, ignoring changes scheduled for future lines. `billing_period_start` bills predictively for upcoming line transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ prebilling: Optional[Prebilling] """ @@ -1041,10 +1041,10 @@ class LineEndsAt(StripeObject): Behavior of the subscription schedule and underlying subscription when it ends. """ phase_effective_at: Optional[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the quote handles billing for line transitions. Possible values are `line_start` (default) or `billing_period_start`. `line_start` bills based on the current state of the line, ignoring changes scheduled for future lines. `billing_period_start` bills predictively for upcoming line transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ proration_behavior: Optional[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/_quote_line.py b/stripe/_quote_line.py index e72c0d28f..3b918ed3e 100644 --- a/stripe/_quote_line.py +++ b/stripe/_quote_line.py @@ -487,7 +487,7 @@ class EndBehavior(StripeObject): """ effective_at: Optional[Literal["billing_period_start", "line_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ ends_at: Optional[EndsAt] """ diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 02219af9f..1b51fa78d 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -704,6 +704,10 @@ class ScheduleDetails(StripeObject): """ The schedule that generated this invoice """ + subscription: Optional[ExpandableField["Subscription"]] + """ + The subscription associated with this schedule + """ class SubscriptionDetails(StripeObject): class PauseCollection(StripeObject): diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index 281a4985a..3b570be5d 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from typing import ClassVar +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -16,6 +17,13 @@ class TaxCode(ListableAPIResource["TaxCode"]): """ OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" + + class Requirements(StripeObject): + performance_location: Optional[Literal["optional", "required"]] + """ + Describes whether a performance location is required for a successful tax calculation with a tax code. + """ + description: str """ A detailed description of which types of products the tax code represents. @@ -32,6 +40,10 @@ class TaxCode(ListableAPIResource["TaxCode"]): """ String representing the object's type. Objects of the same type share the same value. """ + requirements: Optional[Requirements] + """ + An object that describes more information about the tax location required for this tax code. Some [tax codes](https://docs.stripe.com/tax/tax-for-tickets/integration-guide#types-of-products) require a tax location of type `performance` to calculate tax correctly. + """ @classmethod def list( @@ -94,3 +106,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"requirements": Requirements} diff --git a/stripe/_tax_service.py b/stripe/_tax_service.py index cc3d8626f..970381939 100644 --- a/stripe/_tax_service.py +++ b/stripe/_tax_service.py @@ -8,6 +8,7 @@ from stripe.tax._association_service import AssociationService from stripe.tax._calculation_service import CalculationService from stripe.tax._form_service import FormService + from stripe.tax._location_service import LocationService from stripe.tax._registration_service import RegistrationService from stripe.tax._settings_service import SettingsService from stripe.tax._transaction_service import TransactionService @@ -16,6 +17,7 @@ "associations": ["stripe.tax._association_service", "AssociationService"], "calculations": ["stripe.tax._calculation_service", "CalculationService"], "forms": ["stripe.tax._form_service", "FormService"], + "locations": ["stripe.tax._location_service", "LocationService"], "registrations": [ "stripe.tax._registration_service", "RegistrationService", @@ -29,6 +31,7 @@ class TaxService(StripeService): associations: "AssociationService" calculations: "CalculationService" forms: "FormService" + locations: "LocationService" registrations: "RegistrationService" settings: "SettingsService" transactions: "TransactionService" diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index ffbad8bf3..08f535ac9 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -22,6 +22,12 @@ from stripe.events._v2_billing_cadence_created_event import ( V2BillingCadenceCreatedEventNotification, ) + from stripe.events._v2_billing_licensed_item_created_event import ( + V2BillingLicensedItemCreatedEventNotification, + ) + from stripe.events._v2_billing_licensed_item_updated_event import ( + V2BillingLicensedItemUpdatedEventNotification, + ) from stripe.events._v2_billing_license_fee_created_event import ( V2BillingLicenseFeeCreatedEventNotification, ) @@ -31,30 +37,21 @@ from stripe.events._v2_billing_license_fee_version_created_event import ( V2BillingLicenseFeeVersionCreatedEventNotification, ) - from stripe.events._v2_billing_licensed_item_created_event import ( - V2BillingLicensedItemCreatedEventNotification, - ) - from stripe.events._v2_billing_licensed_item_updated_event import ( - V2BillingLicensedItemUpdatedEventNotification, - ) from stripe.events._v2_billing_metered_item_created_event import ( V2BillingMeteredItemCreatedEventNotification, ) from stripe.events._v2_billing_metered_item_updated_event import ( V2BillingMeteredItemUpdatedEventNotification, ) - from stripe.events._v2_billing_pricing_plan_created_event import ( - V2BillingPricingPlanCreatedEventNotification, - ) - from stripe.events._v2_billing_pricing_plan_updated_event import ( - V2BillingPricingPlanUpdatedEventNotification, - ) from stripe.events._v2_billing_pricing_plan_component_created_event import ( V2BillingPricingPlanComponentCreatedEventNotification, ) from stripe.events._v2_billing_pricing_plan_component_updated_event import ( V2BillingPricingPlanComponentUpdatedEventNotification, ) + from stripe.events._v2_billing_pricing_plan_created_event import ( + V2BillingPricingPlanCreatedEventNotification, + ) from stripe.events._v2_billing_pricing_plan_subscription_collection_awaiting_customer_action_event import ( V2BillingPricingPlanSubscriptionCollectionAwaitingCustomerActionEventNotification, ) @@ -79,15 +76,15 @@ from stripe.events._v2_billing_pricing_plan_subscription_servicing_paused_event import ( V2BillingPricingPlanSubscriptionServicingPausedEventNotification, ) + from stripe.events._v2_billing_pricing_plan_updated_event import ( + V2BillingPricingPlanUpdatedEventNotification, + ) from stripe.events._v2_billing_pricing_plan_version_created_event import ( V2BillingPricingPlanVersionCreatedEventNotification, ) from stripe.events._v2_billing_rate_card_created_event import ( V2BillingRateCardCreatedEventNotification, ) - from stripe.events._v2_billing_rate_card_updated_event import ( - V2BillingRateCardUpdatedEventNotification, - ) from stripe.events._v2_billing_rate_card_rate_created_event import ( V2BillingRateCardRateCreatedEventNotification, ) @@ -121,6 +118,9 @@ from stripe.events._v2_billing_rate_card_subscription_servicing_paused_event import ( V2BillingRateCardSubscriptionServicingPausedEventNotification, ) + from stripe.events._v2_billing_rate_card_updated_event import ( + V2BillingRateCardUpdatedEventNotification, + ) from stripe.events._v2_billing_rate_card_version_created_event import ( V2BillingRateCardVersionCreatedEventNotification, ) @@ -130,9 +130,6 @@ from stripe.events._v2_core_account_created_event import ( V2CoreAccountCreatedEventNotification, ) - from stripe.events._v2_core_account_updated_event import ( - V2CoreAccountUpdatedEventNotification, - ) from stripe.events._v2_core_account_including_configuration_card_creator_capability_status_updated_event import ( V2CoreAccountIncludingConfigurationCardCreatorCapabilityStatusUpdatedEventNotification, ) @@ -184,6 +181,9 @@ from stripe.events._v2_core_account_person_updated_event import ( V2CoreAccountPersonUpdatedEventNotification, ) + from stripe.events._v2_core_account_updated_event import ( + V2CoreAccountUpdatedEventNotification, + ) from stripe.events._v2_core_claimable_sandbox_claimed_event import ( V2CoreClaimableSandboxClaimedEventNotification, ) @@ -442,9 +442,6 @@ from stripe.events._v2_payments_settlement_allocation_intent_settled_event import ( V2PaymentsSettlementAllocationIntentSettledEventNotification, ) - from stripe.events._v2_payments_settlement_allocation_intent_submitted_event import ( - V2PaymentsSettlementAllocationIntentSubmittedEventNotification, - ) from stripe.events._v2_payments_settlement_allocation_intent_split_canceled_event import ( V2PaymentsSettlementAllocationIntentSplitCanceledEventNotification, ) @@ -454,6 +451,9 @@ from stripe.events._v2_payments_settlement_allocation_intent_split_settled_event import ( V2PaymentsSettlementAllocationIntentSplitSettledEventNotification, ) + from stripe.events._v2_payments_settlement_allocation_intent_submitted_event import ( + V2PaymentsSettlementAllocationIntentSubmittedEventNotification, + ) from stripe.events._v2_reporting_report_run_created_event import ( V2ReportingReportRunCreatedEventNotification, ) diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index 284a66613..f2bd1baf7 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -4081,6 +4081,7 @@ from stripe.params._plan_create_params import ( PlanCreateParams as PlanCreateParams, PlanCreateParamsProduct as PlanCreateParamsProduct, + PlanCreateParamsProductTaxDetails as PlanCreateParamsProductTaxDetails, PlanCreateParamsTier as PlanCreateParamsTier, PlanCreateParamsTransformUsage as PlanCreateParamsTransformUsage, ) @@ -4107,6 +4108,7 @@ PriceCreateParamsCurrencyOptionsTier as PriceCreateParamsCurrencyOptionsTier, PriceCreateParamsCustomUnitAmount as PriceCreateParamsCustomUnitAmount, PriceCreateParamsProductData as PriceCreateParamsProductData, + PriceCreateParamsProductDataTaxDetails as PriceCreateParamsProductDataTaxDetails, PriceCreateParamsRecurring as PriceCreateParamsRecurring, PriceCreateParamsTier as PriceCreateParamsTier, PriceCreateParamsTransformQuantity as PriceCreateParamsTransformQuantity, @@ -19346,6 +19348,10 @@ "PayoutUpdateParams": ("stripe.params._payout_update_params", False), "PlanCreateParams": ("stripe.params._plan_create_params", False), "PlanCreateParamsProduct": ("stripe.params._plan_create_params", False), + "PlanCreateParamsProductTaxDetails": ( + "stripe.params._plan_create_params", + False, + ), "PlanCreateParamsTier": ("stripe.params._plan_create_params", False), "PlanCreateParamsTransformUsage": ( "stripe.params._plan_create_params", @@ -19378,6 +19384,10 @@ "stripe.params._price_create_params", False, ), + "PriceCreateParamsProductDataTaxDetails": ( + "stripe.params._price_create_params", + False, + ), "PriceCreateParamsRecurring": ( "stripe.params._price_create_params", False, diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index f09efbf2e..b66d23451 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -198,6 +198,10 @@ class InvoiceAddLinesParamsLinePriceDataProductData(TypedDict): class InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index 3c95dae6a..4878f5f8c 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -621,7 +621,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsAmendment(TypedDict): Literal["amendment_start", "billing_period_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ item_actions: NotRequired[ List["InvoiceCreatePreviewParamsScheduleDetailsAmendmentItemAction"] @@ -1357,7 +1357,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhase(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "phase_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ end_date: NotRequired["int|Literal['now']"] """ diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index 4cb83427b..5986339a3 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -184,6 +184,10 @@ class InvoiceLineItemUpdateParamsPriceDataProductData(TypedDict): class InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index 9ef0a1e27..951fd83d6 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -202,6 +202,10 @@ class InvoiceUpdateLinesParamsLinePriceDataProductData(TypedDict): class InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index a8858dd3f..151ca8d19 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -466,7 +466,7 @@ class PaymentIntentConfirmParamsPaymentDetails(TypedDict): class PaymentIntentConfirmParamsPaymentDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "PaymentIntentConfirmParamsPaymentDetailsBenefitFrMealVoucher" + "Literal['']|PaymentIntentConfirmParamsPaymentDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this PaymentIntent. diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 192a4ffeb..fdcf1a37c 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -613,7 +613,7 @@ class PaymentIntentCreateParamsPaymentDetails(TypedDict): class PaymentIntentCreateParamsPaymentDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "PaymentIntentCreateParamsPaymentDetailsBenefitFrMealVoucher" + "Literal['']|PaymentIntentCreateParamsPaymentDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this PaymentIntent. diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 2d2afa5ab..abd4c4d78 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -461,7 +461,7 @@ class PaymentIntentModifyParamsPaymentDetails(TypedDict): class PaymentIntentModifyParamsPaymentDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "PaymentIntentModifyParamsPaymentDetailsBenefitFrMealVoucher" + "Literal['']|PaymentIntentModifyParamsPaymentDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this PaymentIntent. diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 1a68fd31a..861f03a42 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -460,7 +460,7 @@ class PaymentIntentUpdateParamsPaymentDetails(TypedDict): class PaymentIntentUpdateParamsPaymentDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "PaymentIntentUpdateParamsPaymentDetailsBenefitFrMealVoucher" + "Literal['']|PaymentIntentUpdateParamsPaymentDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this PaymentIntent. diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index 197762780..07f361c98 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -617,6 +617,10 @@ class PaymentLinkCreateParamsLineItemPriceDataProductData(TypedDict): class PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_plan_create_params.py b/stripe/params/_plan_create_params.py index d3cdabcdf..a8f2b1368 100644 --- a/stripe/params/_plan_create_params.py +++ b/stripe/params/_plan_create_params.py @@ -108,6 +108,21 @@ class PlanCreateParamsProduct(TypedDict): """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ + tax_details: NotRequired["PlanCreateParamsProductTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ + + +class PlanCreateParamsProductTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ class PlanCreateParamsTier(TypedDict): diff --git a/stripe/params/_price_create_params.py b/stripe/params/_price_create_params.py index b584425ca..4c676b48b 100644 --- a/stripe/params/_price_create_params.py +++ b/stripe/params/_price_create_params.py @@ -203,6 +203,21 @@ class PriceCreateParamsProductData(TypedDict): """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ + tax_details: NotRequired["PriceCreateParamsProductDataTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ + + +class PriceCreateParamsProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ class PriceCreateParamsRecurring(TypedDict): diff --git a/stripe/params/_product_create_params.py b/stripe/params/_product_create_params.py index 749e36a2e..65fc4c9b7 100644 --- a/stripe/params/_product_create_params.py +++ b/stripe/params/_product_create_params.py @@ -248,6 +248,10 @@ class ProductCreateParamsPackageDimensions(TypedDict): class ProductCreateParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_product_modify_params.py b/stripe/params/_product_modify_params.py index 6391c4f7c..ed5764efc 100644 --- a/stripe/params/_product_modify_params.py +++ b/stripe/params/_product_modify_params.py @@ -102,6 +102,10 @@ class ProductModifyParamsPackageDimensions(TypedDict): class ProductModifyParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_product_update_params.py b/stripe/params/_product_update_params.py index 35108f301..b6a533308 100644 --- a/stripe/params/_product_update_params.py +++ b/stripe/params/_product_update_params.py @@ -101,6 +101,10 @@ class ProductUpdateParamsPackageDimensions(TypedDict): class ProductUpdateParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/_quote_create_params.py b/stripe/params/_quote_create_params.py index 6401424e8..253c39a81 100644 --- a/stripe/params/_quote_create_params.py +++ b/stripe/params/_quote_create_params.py @@ -339,7 +339,7 @@ class QuoteCreateParamsLine(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "line_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the quote handles billing for line transitions. """ ends_at: NotRequired["QuoteCreateParamsLineEndsAt"] """ @@ -875,10 +875,10 @@ class QuoteCreateParamsSubscriptionData(TypedDict): Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ prebilling: NotRequired[ "Literal['']|QuoteCreateParamsSubscriptionDataPrebilling" @@ -1196,10 +1196,10 @@ class QuoteCreateParamsSubscriptionDataOverride(TypedDict): Behavior of the subscription schedule and underlying subscription when it ends. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/params/_quote_modify_params.py b/stripe/params/_quote_modify_params.py index 94a765652..789219cc5 100644 --- a/stripe/params/_quote_modify_params.py +++ b/stripe/params/_quote_modify_params.py @@ -324,7 +324,7 @@ class QuoteModifyParamsLine(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "line_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the quote handles billing for line transitions. """ ends_at: NotRequired["QuoteModifyParamsLineEndsAt"] """ @@ -860,10 +860,10 @@ class QuoteModifyParamsSubscriptionData(TypedDict): Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ prebilling: NotRequired[ "Literal['']|QuoteModifyParamsSubscriptionDataPrebilling" @@ -1165,10 +1165,10 @@ class QuoteModifyParamsSubscriptionDataOverride(TypedDict): Behavior of the subscription schedule and underlying subscription when it ends. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/params/_quote_update_params.py b/stripe/params/_quote_update_params.py index df1767eff..b8746f9c7 100644 --- a/stripe/params/_quote_update_params.py +++ b/stripe/params/_quote_update_params.py @@ -323,7 +323,7 @@ class QuoteUpdateParamsLine(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "line_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the quote handles billing for line transitions. """ ends_at: NotRequired["QuoteUpdateParamsLineEndsAt"] """ @@ -859,10 +859,10 @@ class QuoteUpdateParamsSubscriptionData(TypedDict): Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ prebilling: NotRequired[ "Literal['']|QuoteUpdateParamsSubscriptionDataPrebilling" @@ -1164,10 +1164,10 @@ class QuoteUpdateParamsSubscriptionDataOverride(TypedDict): Behavior of the subscription schedule and underlying subscription when it ends. """ phase_effective_at: NotRequired[ - Literal["billing_period_start", "line_start"] + Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions when the quote is accepted. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index bb064441e..99cbdf2f3 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -1678,7 +1678,7 @@ class SetupIntentConfirmParamsSetupDetails(TypedDict): class SetupIntentConfirmParamsSetupDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "SetupIntentConfirmParamsSetupDetailsBenefitFrMealVoucher" + "Literal['']|SetupIntentConfirmParamsSetupDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this SetupIntent. diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 2ec3611c0..797f7f1b2 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -1805,7 +1805,7 @@ class SetupIntentCreateParamsSetupDetails(TypedDict): class SetupIntentCreateParamsSetupDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "SetupIntentCreateParamsSetupDetailsBenefitFrMealVoucher" + "Literal['']|SetupIntentCreateParamsSetupDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this SetupIntent. diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 29077eac6..fbd495fd3 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -1646,7 +1646,7 @@ class SetupIntentModifyParamsSetupDetails(TypedDict): class SetupIntentModifyParamsSetupDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "SetupIntentModifyParamsSetupDetailsBenefitFrMealVoucher" + "Literal['']|SetupIntentModifyParamsSetupDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this SetupIntent. diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index c48fb66ec..325677b75 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -1645,7 +1645,7 @@ class SetupIntentUpdateParamsSetupDetails(TypedDict): class SetupIntentUpdateParamsSetupDetailsBenefit(TypedDict): fr_meal_voucher: NotRequired[ - "SetupIntentUpdateParamsSetupDetailsBenefitFrMealVoucher" + "Literal['']|SetupIntentUpdateParamsSetupDetailsBenefitFrMealVoucher" ] """ French meal voucher benefit details for this SetupIntent. diff --git a/stripe/params/_subscription_schedule_amend_params.py b/stripe/params/_subscription_schedule_amend_params.py index 4f1e00eac..80dedc2aa 100644 --- a/stripe/params/_subscription_schedule_amend_params.py +++ b/stripe/params/_subscription_schedule_amend_params.py @@ -66,7 +66,7 @@ class SubscriptionScheduleAmendParamsAmendment(TypedDict): Literal["amendment_start", "billing_period_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ item_actions: NotRequired[ List["SubscriptionScheduleAmendParamsAmendmentItemAction"] diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index bce74d121..2654108e7 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -193,7 +193,7 @@ class SubscriptionScheduleCreateParamsDefaultSettings(TypedDict): Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ transfer_data: NotRequired[ "Literal['']|SubscriptionScheduleCreateParamsDefaultSettingsTransferData" @@ -346,7 +346,7 @@ class SubscriptionScheduleCreateParamsPhase(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "phase_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ end_date: NotRequired[int] """ diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index d3c989341..9a9a55644 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -161,7 +161,7 @@ class SubscriptionScheduleModifyParamsDefaultSettings(TypedDict): Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ transfer_data: NotRequired[ "Literal['']|SubscriptionScheduleModifyParamsDefaultSettingsTransferData" @@ -314,7 +314,7 @@ class SubscriptionScheduleModifyParamsPhase(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "phase_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ end_date: NotRequired["int|Literal['now']"] """ diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index 4af0284ee..7bfab6c0c 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -160,7 +160,7 @@ class SubscriptionScheduleUpdateParamsDefaultSettings(TypedDict): Literal["billing_period_start", "phase_start"] ] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ transfer_data: NotRequired[ "Literal['']|SubscriptionScheduleUpdateParamsDefaultSettingsTransferData" @@ -313,7 +313,7 @@ class SubscriptionScheduleUpdateParamsPhase(TypedDict): """ effective_at: NotRequired[Literal["billing_period_start", "phase_start"]] """ - Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice. + Configures how the subscription schedule handles billing for phase transitions. """ end_date: NotRequired["int|Literal['now']"] """ diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 5b565925a..3d002fcc3 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -995,6 +995,10 @@ class SessionCreateParamsLineItemPriceDataProductData(TypedDict): class SessionCreateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index 36e78511b..60db6a5fd 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -303,6 +303,10 @@ class SessionModifyParamsLineItemPriceDataProductData(TypedDict): class SessionModifyParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index 66432bc3c..ac1f7af47 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -302,6 +302,10 @@ class SessionUpdateParamsLineItemPriceDataProductData(TypedDict): class SessionUpdateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ tax_code: str """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. diff --git a/stripe/params/delegated_checkout/_requested_session_modify_params.py b/stripe/params/delegated_checkout/_requested_session_modify_params.py index 78a9252f6..d1f5319c3 100644 --- a/stripe/params/delegated_checkout/_requested_session_modify_params.py +++ b/stripe/params/delegated_checkout/_requested_session_modify_params.py @@ -22,7 +22,7 @@ class RequestedSessionModifyParams(RequestOptions): """ The details of the line items. """ - metadata: NotRequired[Dict[str, str]] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ The metadata for this requested session. """ @@ -31,12 +31,12 @@ class RequestedSessionModifyParams(RequestOptions): The payment method for this requested session. """ payment_method_data: NotRequired[ - "RequestedSessionModifyParamsPaymentMethodData" + "Literal['']|RequestedSessionModifyParamsPaymentMethodData" ] """ The payment method data for this requested session. """ - shared_metadata: NotRequired[Dict[str, str]] + shared_metadata: NotRequired["Literal['']|Dict[str, str]"] """ The shared metadata for this requested session. """ diff --git a/stripe/params/delegated_checkout/_requested_session_update_params.py b/stripe/params/delegated_checkout/_requested_session_update_params.py index e1e0580f6..e80124a3d 100644 --- a/stripe/params/delegated_checkout/_requested_session_update_params.py +++ b/stripe/params/delegated_checkout/_requested_session_update_params.py @@ -21,7 +21,7 @@ class RequestedSessionUpdateParams(TypedDict): """ The details of the line items. """ - metadata: NotRequired[Dict[str, str]] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ The metadata for this requested session. """ @@ -30,12 +30,12 @@ class RequestedSessionUpdateParams(TypedDict): The payment method for this requested session. """ payment_method_data: NotRequired[ - "RequestedSessionUpdateParamsPaymentMethodData" + "Literal['']|RequestedSessionUpdateParamsPaymentMethodData" ] """ The payment method data for this requested session. """ - shared_metadata: NotRequired[Dict[str, str]] + shared_metadata: NotRequired["Literal['']|Dict[str, str]"] """ The shared metadata for this requested session. """ diff --git a/stripe/params/shared_payment/__init__.py b/stripe/params/shared_payment/__init__.py index 1d82bfbc3..4e12a7d09 100644 --- a/stripe/params/shared_payment/__init__.py +++ b/stripe/params/shared_payment/__init__.py @@ -11,8 +11,8 @@ from stripe.params.shared_payment._granted_token_retrieve_params import ( GrantedTokenRetrieveParams as GrantedTokenRetrieveParams, ) - from stripe.params.shared_payment._granted_token_update_params import ( - GrantedTokenUpdateParams as GrantedTokenUpdateParams, + from stripe.params.shared_payment._granted_token_revoke_params import ( + GrantedTokenRevokeParams as GrantedTokenRevokeParams, ) # name -> (import_target, is_submodule) @@ -29,8 +29,8 @@ "stripe.params.shared_payment._granted_token_retrieve_params", False, ), - "GrantedTokenUpdateParams": ( - "stripe.params.shared_payment._granted_token_update_params", + "GrantedTokenRevokeParams": ( + "stripe.params.shared_payment._granted_token_revoke_params", False, ), } diff --git a/stripe/params/shared_payment/_granted_token_update_params.py b/stripe/params/shared_payment/_granted_token_revoke_params.py similarity index 86% rename from stripe/params/shared_payment/_granted_token_update_params.py rename to stripe/params/shared_payment/_granted_token_revoke_params.py index 7eb144054..7bc291a52 100644 --- a/stripe/params/shared_payment/_granted_token_update_params.py +++ b/stripe/params/shared_payment/_granted_token_revoke_params.py @@ -5,7 +5,7 @@ from typing_extensions import NotRequired -class GrantedTokenUpdateParams(RequestOptions): +class GrantedTokenRevokeParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/params/tax/__init__.py b/stripe/params/tax/__init__.py index 0db0a9dca..85a1ec8f9 100644 --- a/stripe/params/tax/__init__.py +++ b/stripe/params/tax/__init__.py @@ -36,6 +36,16 @@ from stripe.params.tax._form_retrieve_params import ( FormRetrieveParams as FormRetrieveParams, ) + from stripe.params.tax._location_create_params import ( + LocationCreateParams as LocationCreateParams, + LocationCreateParamsAddress as LocationCreateParamsAddress, + ) + from stripe.params.tax._location_list_params import ( + LocationListParams as LocationListParams, + ) + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams as LocationRetrieveParams, + ) from stripe.params.tax._registration_create_params import ( RegistrationCreateParams as RegistrationCreateParams, RegistrationCreateParamsCountryOptions as RegistrationCreateParamsCountryOptions, @@ -301,6 +311,19 @@ "FormListParamsPayee": ("stripe.params.tax._form_list_params", False), "FormPdfParams": ("stripe.params.tax._form_pdf_params", False), "FormRetrieveParams": ("stripe.params.tax._form_retrieve_params", False), + "LocationCreateParams": ( + "stripe.params.tax._location_create_params", + False, + ), + "LocationCreateParamsAddress": ( + "stripe.params.tax._location_create_params", + False, + ), + "LocationListParams": ("stripe.params.tax._location_list_params", False), + "LocationRetrieveParams": ( + "stripe.params.tax._location_retrieve_params", + False, + ), "RegistrationCreateParams": ( "stripe.params.tax._registration_create_params", False, diff --git a/stripe/params/tax/_calculation_create_params.py b/stripe/params/tax/_calculation_create_params.py index 5f6f71166..5ad00015f 100644 --- a/stripe/params/tax/_calculation_create_params.py +++ b/stripe/params/tax/_calculation_create_params.py @@ -244,6 +244,10 @@ class CalculationCreateParamsLineItem(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ class CalculationCreateParamsShipFromDetails(TypedDict): diff --git a/stripe/params/tax/_location_create_params.py b/stripe/params/tax/_location_create_params.py new file mode 100644 index 000000000..8aa5abfca --- /dev/null +++ b/stripe/params/tax/_location_create_params.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class LocationCreateParams(RequestOptions): + address: "LocationCreateParamsAddress" + """ + The physical address of the tax location. + """ + description: NotRequired[str] + """ + Details to identify the tax location by its venue, types of events held, or available services, such as "A spacious auditorium suitable for large concerts and events.". + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + type: Literal["performance"] + """ + The type of tax location. The only supported value is "performance". + """ + + +class LocationCreateParamsAddress(TypedDict): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["Literal['']|str"] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix, such as "NY" or "TX". + """ diff --git a/stripe/params/tax/_location_list_params.py b/stripe/params/tax/_location_list_params.py new file mode 100644 index 000000000..cbe266706 --- /dev/null +++ b/stripe/params/tax/_location_list_params.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired + + +class LocationListParams(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. + """ + type: Literal["performance"] + """ + Type of the tax location. Currently the only option is `performance`. + """ diff --git a/stripe/params/tax/_location_retrieve_params.py b/stripe/params/tax/_location_retrieve_params.py new file mode 100644 index 000000000..107563bb5 --- /dev/null +++ b/stripe/params/tax/_location_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 LocationRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/tax/_registration_create_params.py b/stripe/params/tax/_registration_create_params.py index 01e660e14..fc73f649d 100644 --- a/stripe/params/tax/_registration_create_params.py +++ b/stripe/params/tax/_registration_create_params.py @@ -1770,11 +1770,19 @@ class RegistrationCreateParamsCountryOptionsUs(TypedDict): Options for the state sales tax registration. """ type: Literal[ + "admissions_tax", + "attendance_tax", + "entertainment_tax", + "gross_receipts_tax", + "hospitality_tax", "local_amusement_tax", "local_lease_tax", + "luxury_tax", + "resort_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", + "tourism_tax", ] """ Type of registration to be created in the US. diff --git a/stripe/params/test_helpers/shared_payment/__init__.py b/stripe/params/test_helpers/shared_payment/__init__.py index 4056f5750..9290020d8 100644 --- a/stripe/params/test_helpers/shared_payment/__init__.py +++ b/stripe/params/test_helpers/shared_payment/__init__.py @@ -8,8 +8,8 @@ GrantedTokenCreateParams as GrantedTokenCreateParams, GrantedTokenCreateParamsUsageLimits as GrantedTokenCreateParamsUsageLimits, ) - from stripe.params.test_helpers.shared_payment._granted_token_update_params import ( - GrantedTokenUpdateParams as GrantedTokenUpdateParams, + from stripe.params.test_helpers.shared_payment._granted_token_revoke_params import ( + GrantedTokenRevokeParams as GrantedTokenRevokeParams, ) # name -> (import_target, is_submodule) @@ -22,8 +22,8 @@ "stripe.params.test_helpers.shared_payment._granted_token_create_params", False, ), - "GrantedTokenUpdateParams": ( - "stripe.params.test_helpers.shared_payment._granted_token_update_params", + "GrantedTokenRevokeParams": ( + "stripe.params.test_helpers.shared_payment._granted_token_revoke_params", False, ), } diff --git a/stripe/params/test_helpers/shared_payment/_granted_token_update_params.py b/stripe/params/test_helpers/shared_payment/_granted_token_revoke_params.py similarity index 85% rename from stripe/params/test_helpers/shared_payment/_granted_token_update_params.py rename to stripe/params/test_helpers/shared_payment/_granted_token_revoke_params.py index 0a0385be2..95d0ccd0b 100644 --- a/stripe/params/test_helpers/shared_payment/_granted_token_update_params.py +++ b/stripe/params/test_helpers/shared_payment/_granted_token_revoke_params.py @@ -4,7 +4,7 @@ from typing_extensions import NotRequired, TypedDict -class GrantedTokenUpdateParams(TypedDict): +class GrantedTokenRevokeParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/shared_payment/_granted_token.py b/stripe/shared_payment/_granted_token.py index 47fc8c23f..4bb6ed416 100644 --- a/stripe/shared_payment/_granted_token.py +++ b/stripe/shared_payment/_granted_token.py @@ -14,8 +14,8 @@ from stripe.params.shared_payment._granted_token_retrieve_params import ( GrantedTokenRetrieveParams, ) - from stripe.params.shared_payment._granted_token_update_params import ( - GrantedTokenUpdateParams, + from stripe.params.shared_payment._granted_token_revoke_params import ( + GrantedTokenRevokeParams, ) @@ -155,10 +155,10 @@ async def create_async( ) @classmethod - def _cls_update( + def _cls_revoke( cls, shared_payment_granted_token: str, - **params: Unpack["GrantedTokenUpdateParams"], + **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration @@ -178,9 +178,9 @@ def _cls_update( @overload @staticmethod - def update( + def revoke( shared_payment_granted_token: str, - **params: Unpack["GrantedTokenUpdateParams"], + **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration @@ -188,17 +188,17 @@ def update( ... @overload - def update( - self, **params: Unpack["GrantedTokenUpdateParams"] + def revoke( + self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration """ ... - @class_method_variant("_cls_update") - def update( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["GrantedTokenUpdateParams"] + @class_method_variant("_cls_revoke") + def revoke( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration @@ -217,10 +217,10 @@ def update( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - async def _cls_update_async( + async def _cls_revoke_async( cls, shared_payment_granted_token: str, - **params: Unpack["GrantedTokenUpdateParams"], + **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration @@ -240,9 +240,9 @@ async def _cls_update_async( @overload @staticmethod - async def update_async( + async def revoke_async( shared_payment_granted_token: str, - **params: Unpack["GrantedTokenUpdateParams"], + **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration @@ -250,17 +250,17 @@ async def update_async( ... @overload - async def update_async( - self, **params: Unpack["GrantedTokenUpdateParams"] + async def revoke_async( + self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration """ ... - @class_method_variant("_cls_update_async") - async def update_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["GrantedTokenUpdateParams"] + @class_method_variant("_cls_revoke_async") + async def revoke_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration diff --git a/stripe/tax/__init__.py b/stripe/tax/__init__.py index f820b52f4..43c706c5e 100644 --- a/stripe/tax/__init__.py +++ b/stripe/tax/__init__.py @@ -20,6 +20,8 @@ ) from stripe.tax._form import Form as Form from stripe.tax._form_service import FormService as FormService + from stripe.tax._location import Location as Location + from stripe.tax._location_service import LocationService as LocationService from stripe.tax._registration import Registration as Registration from stripe.tax._registration_service import ( RegistrationService as RegistrationService, @@ -50,6 +52,8 @@ "CalculationService": ("stripe.tax._calculation_service", False), "Form": ("stripe.tax._form", False), "FormService": ("stripe.tax._form_service", False), + "Location": ("stripe.tax._location", False), + "LocationService": ("stripe.tax._location_service", False), "Registration": ("stripe.tax._registration", False), "RegistrationService": ("stripe.tax._registration_service", False), "Settings": ("stripe.tax._settings", False), diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 60239a652..7cc0320f4 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -264,19 +264,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -288,7 +296,7 @@ class TaxRateDetails(StripeObject): The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ @@ -385,19 +393,27 @@ class FlatAmount(StripeObject): """ tax_type: Optional[ Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] ] diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 702b039e6..ae62748a3 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -39,19 +39,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -63,7 +71,7 @@ class TaxRateDetails(StripeObject): The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ @@ -124,6 +132,10 @@ class TaxRateDetails(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + performance_location: Optional[str] + """ + A tax location for a line item that acts as a performance location. This indicates that the line item might be taxed at the place where it is being performed at. This is helpful for events or other services being performed at non-customer addresses like venues or offices. This can be left empty for tax codes that do not require a tax location. For tax codes where the location requirement is "optional", this would override the customer address in most use cases. + """ product: Optional[str] """ The ID of an existing [Product](https://docs.stripe.com/api/products/object). diff --git a/stripe/tax/_location.py b/stripe/tax/_location.py new file mode 100644 index 000000000..1fda99425 --- /dev/null +++ b/stripe/tax/_location.py @@ -0,0 +1,172 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.tax._location_create_params import LocationCreateParams + from stripe.params.tax._location_list_params import LocationListParams + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams, + ) + + +class Location( + CreateableAPIResource["Location"], + ListableAPIResource["Location"], +): + """ + Tax locations represent venues for services, tickets, or other product types. + """ + + OBJECT_NAME: ClassVar[Literal["tax.location"]] = "tax.location" + + class Address(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)). + """ + + address: Address + description: Optional[str] + """ + A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (e.g., "A spacious auditorium suitable for large concerts and events."). + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["tax.location"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + type: Literal["performance"] + """ + The type of tax location to be defined. Currently the only option is `performance`. + """ + + @classmethod + def create(cls, **params: Unpack["LocationCreateParams"]) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["LocationCreateParams"] + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["LocationListParams"] + ) -> ListObject["Location"]: + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["LocationListParams"] + ) -> ListObject["Location"]: + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["LocationRetrieveParams"] + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["LocationRetrieveParams"] + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"address": Address} diff --git a/stripe/tax/_location_service.py b/stripe/tax/_location_service.py new file mode 100644 index 000000000..3d33322b7 --- /dev/null +++ b/stripe/tax/_location_service.py @@ -0,0 +1,146 @@ +# -*- 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.params.tax._location_create_params import LocationCreateParams + from stripe.params.tax._location_list_params import LocationListParams + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams, + ) + from stripe.tax._location import Location + + +class LocationService(StripeService): + def list( + self, + params: "LocationListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Location]": + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + return cast( + "ListObject[Location]", + self._request( + "get", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "LocationListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Location]": + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + return cast( + "ListObject[Location]", + await self._request_async( + "get", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "LocationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + self._request( + "post", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "LocationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + await self._request_async( + "post", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + location: str, + params: Optional["LocationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + return cast( + "Location", + self._request( + "get", + "/v1/tax/locations/{location}".format( + location=sanitize_id(location), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + location: str, + params: Optional["LocationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + return cast( + "Location", + await self._request_async( + "get", + "/v1/tax/locations/{location}".format( + location=sanitize_id(location), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 328747a08..a157f9358 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -941,6 +941,36 @@ class Ug(StripeObject): """ class Us(StripeObject): + class AdmissionsTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=admissions_tax#registration-types) representing the local jurisdiction. + """ + + class AttendanceTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=attendance_tax#registration-types) representing the local jurisdiction. + """ + + class EntertainmentTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=entertainment_tax#registration-types) representing the local jurisdiction. + """ + + class GrossReceiptsTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=gross_receipts_tax#registration-types) representing the local jurisdiction. + """ + + class HospitalityTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=hospitality_tax#registration-types) representing the local jurisdiction. + """ + class LocalAmusementTax(StripeObject): jurisdiction: str """ @@ -953,6 +983,18 @@ class LocalLeaseTax(StripeObject): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ + class LuxuryTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=luxury_tax#registration-types) representing the local jurisdiction. + """ + + class ResortTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=resort_tax#registration-types) representing the local jurisdiction. + """ + class StateSalesTax(StripeObject): class Election(StripeObject): jurisdiction: Optional[str] @@ -974,27 +1016,57 @@ class Election(StripeObject): """ _inner_class_types = {"elections": Election} + class TourismTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=tourism_tax#registration-types) representing the local jurisdiction. + """ + + admissions_tax: Optional[AdmissionsTax] + attendance_tax: Optional[AttendanceTax] + entertainment_tax: Optional[EntertainmentTax] + gross_receipts_tax: Optional[GrossReceiptsTax] + hospitality_tax: Optional[HospitalityTax] local_amusement_tax: Optional[LocalAmusementTax] local_lease_tax: Optional[LocalLeaseTax] + luxury_tax: Optional[LuxuryTax] + resort_tax: Optional[ResortTax] state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ state_sales_tax: Optional[StateSalesTax] + tourism_tax: Optional[TourismTax] type: Literal[ + "admissions_tax", + "attendance_tax", + "entertainment_tax", + "gross_receipts_tax", + "hospitality_tax", "local_amusement_tax", "local_lease_tax", + "luxury_tax", + "resort_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", + "tourism_tax", ] """ Type of registration in the US. """ _inner_class_types = { + "admissions_tax": AdmissionsTax, + "attendance_tax": AttendanceTax, + "entertainment_tax": EntertainmentTax, + "gross_receipts_tax": GrossReceiptsTax, + "hospitality_tax": HospitalityTax, "local_amusement_tax": LocalAmusementTax, "local_lease_tax": LocalLeaseTax, + "luxury_tax": LuxuryTax, + "resort_tax": ResortTax, "state_sales_tax": StateSalesTax, + "tourism_tax": TourismTax, } class Uy(StripeObject): diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index d76506217..3a16f4abc 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -273,19 +273,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -297,7 +305,7 @@ class TaxRateDetails(StripeObject): The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ diff --git a/stripe/test_helpers/shared_payment/_granted_token_service.py b/stripe/test_helpers/shared_payment/_granted_token_service.py index 7ee1ee739..66bfd21b2 100644 --- a/stripe/test_helpers/shared_payment/_granted_token_service.py +++ b/stripe/test_helpers/shared_payment/_granted_token_service.py @@ -10,8 +10,8 @@ from stripe.params.test_helpers.shared_payment._granted_token_create_params import ( GrantedTokenCreateParams, ) - from stripe.params.test_helpers.shared_payment._granted_token_update_params import ( - GrantedTokenUpdateParams, + from stripe.params.test_helpers.shared_payment._granted_token_revoke_params import ( + GrantedTokenRevokeParams, ) from stripe.shared_payment._granted_token import GrantedToken @@ -55,10 +55,10 @@ async def create_async( ), ) - def update( + def revoke( self, shared_payment_granted_token: str, - params: Optional["GrantedTokenUpdateParams"] = None, + params: Optional["GrantedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": """ @@ -79,10 +79,10 @@ def update( ), ) - async def update_async( + async def revoke_async( self, shared_payment_granted_token: str, - params: Optional["GrantedTokenUpdateParams"] = None, + params: Optional["GrantedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": """ diff --git a/tests/test_integration.py b/tests/test_integration.py index a84ddf1c6..cc558a4b9 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -335,7 +335,6 @@ def do_request(self, req_num): usage = telemetry["last_request_metrics"]["usage"] assert usage == ["stripe_client", "async"] - @pytest.mark.anyio @pytest.fixture(params=["aiohttp", "httpx"]) async def async_http_client(self, request, anyio_backend): if request.param == "httpx":