diff --git a/.editorconfig b/.editorconfig index 1c32a5e4c..108bfbbff 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,3 +15,6 @@ indent_size = 2 [Makefile] indent_style = tab + +[CHANGELOG.md] +trim_trailing_whitespace = false diff --git a/.flake8 b/.flake8 index 25a15e502..996891f46 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,9 @@ # explicitly when using `ignore`. # E704 is disabled in the default configuration, but by specifying `ignore`, we wipe that out. # ruff formatting creates code that violates it, so we have to disable it manually -ignore = E501, W503, E704 +# E203 checks that `:` is not preceded by whitespace, but in some cases, +# formatting adds the whitespace. We let formatting be the source of truth in that case. +ignore = E501, W503, E704, E203 per-file-ignores = */__init__.py: IMP100, E402, F401 # we test various import patterns @@ -17,6 +19,7 @@ per-file-ignores = # IMP101: Do not import stripe # breaking circular dependencies in overrides + stripe/tax/_form.py: IMP101 stripe/_file.py: IMP101 stripe/_account.py: IMP101 stripe/_person.py: IMP101 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 5d191dfb5..11d96803b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,3 +1,5 @@ # .git-blame-ignore-revs # mass formatted w/ ruff (2024-05-10) c46b4b950ea77e9d18ab98885cda721b3de247c0 +# (beta) mass formatted w/ ruff (2024-05-13) +11c92dc754cf1e93ed1910624c182aa244d3981c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26c71633f..d56146205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,7 @@ jobs: fail-fast: false matrix: python_version: + # - "3.6" - "3.7" - "3.8" - "3.9" diff --git a/.vscode/settings.json b/.vscode/settings.json index 24c60026c..59e67bec4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,6 +25,10 @@ } }, + "[markdown]": { + "editor.formatOnSave": false, + }, + // Tests "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, diff --git a/CHANGELOG.md b/CHANGELOG.md index e187eda41..fb5268ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +# Changelog + +## 12.3.0b1 - 2025-05-29 +This release changes the pinned API version to `2025-05-28.preview`. + +* [#1509](https://github.com/stripe/stripe-python/pull/1509) Update generated code for beta + ### Breaking changes + * Remove support for deprecated previews + * Remove support for resources `billing.MeterErrorReport`, `gift_cards.Card`, `gift_cards.Transaction`, and `privacy.RedactionJobRootObjects` + * Remove support for `create`, `list`, `modify`, `retrieve`, and `validate` methods on resource `gift_cards.Card` + * Remove support for `cancel`, `confirm`, `create`, `list`, `modify`, and `retrieve` methods on resource `gift_cards.Transaction` + * Remove support for `provisioning` on `Product.CreateParams` and `Product` + * Remove support for snapshot event `billing.meter_error_report.triggered` with resource `billing.MeterErrorReport` + * Remove support for error codes `gift_card_balance_insufficient`, `gift_card_code_exists`, and `gift_card_inactive` on `QuotePreviewInvoice.LastFinalizationError` and `StripeError` + * Remove support for values `credits_attributed_to_debits` and `legacy_prorations` from enums `Invoice.CreatePreviewParamsScheduleDetail.billing_mode`, `Invoice.CreatePreviewParamsSubscriptionDetail.billing_mode`, `Quote.CreateParamsSubscriptionDatum.billing_mode`, `Quote.SubscriptionDatum.billing_mode`, `QuotePreviewSubscriptionSchedule.billing_mode`, `Subscription.CreateParams.billing_mode`, `Subscription.billing_mode`, `SubscriptionSchedule.CreateParams.billing_mode`, `SubscriptionSchedule.billing_mode`, and `checkout.Session.CreateParamsSubscriptionDatum.billing_mode` + * Change type of `checkout.Session.ModifyParamsLineItem.quantity` from `emptyable(longInteger)` to `longInteger` + * Change `CreditNote.post_payment_amount` to be required + * Change `CreditNote.pre_payment_amount` to be required + * Remove support for `credits` on `Order.CreateParams`, `Order.ModifyParams`, and `Order` + * Remove support for `amount_remaining` on `Order` + * Remove support for `amount_credit` on `Order.TotalDetail` + * Change type of `PaymentAttemptRecord.metadata` and `PaymentRecord.metadata` from `nullable(map(string: string))` to `map(string: string)` + * Remove support for `async_workflows` on `PaymentIntent.CaptureParams`, `PaymentIntent.ConfirmParams`, `PaymentIntent.CreateParams`, `PaymentIntent.DecrementAuthorizationParams`, `PaymentIntent.IncrementAuthorizationParams`, `PaymentIntent.ModifyParams`, and `PaymentIntent` + * Change type of `PaymentRecord.ReportPaymentAttemptCanceledParams.metadata`, `PaymentRecord.ReportPaymentAttemptFailedParams.metadata`, `PaymentRecord.ReportPaymentAttemptGuaranteedParams.metadata`, `PaymentRecord.ReportPaymentAttemptParams.metadata`, and `PaymentRecord.ReportPaymentParams.metadata` from `map(string: string)` to `emptyable(map(string: string))` + * Change type of `Privacy.RedactionJob.objects` from `$Privacy.RedactionJobRootObjects` to `RedactionResourceRootObjects` + * Change type of `Privacy.RedactionJob.status` from `string` to `enum` + * Change type of `Privacy.RedactionJob.validation_behavior` from `string` to `enum('error'|'fix')` + * Change type of `Privacy.RedactionJobValidationError.code` from `string` to `enum` + * Change type of `Privacy.RedactionJobValidationError.erroring_object` from `map(string: string)` to `RedactionResourceErroringObject` + * Remove support for `status_details` and `status` on `Tax.Association` + + ### Other changes + * Add support for `migrate` method on resource `Subscription` + * Add support for `distance`, `pickup_location_name`, `return_location_name`, and `vehicle_identification_number` on `Charge.CaptureParamsPaymentDetailCarRental`, `Charge.ModifyParamsPaymentDetailCarRental`, `PaymentIntent.CaptureParamsPaymentDetailCarRental`, `PaymentIntent.ConfirmParamsPaymentDetailCarRental`, `PaymentIntent.CreateParamsPaymentDetailCarRental`, `PaymentIntent.ModifyParamsPaymentDetailCarRental`, and `PaymentIntent.PaymentDetail.CarRental` + * Add support for `driver_identification_number` and `driver_tax_number` on `Charge.CaptureParamsPaymentDetailCarRentalDriver`, `Charge.ModifyParamsPaymentDetailCarRentalDriver`, `PaymentIntent.CaptureParamsPaymentDetailCarRentalDriver`, `PaymentIntent.ConfirmParamsPaymentDetailCarRentalDriver`, `PaymentIntent.CreateParamsPaymentDetailCarRentalDriver`, `PaymentIntent.ModifyParamsPaymentDetailCarRentalDriver`, and `PaymentIntent.PaymentDetail.CarRental.Driver` + * Add support for new values `classic` and `flexible` on enums `Invoice.CreatePreviewParamsScheduleDetail.billing_mode`, `Invoice.CreatePreviewParamsSubscriptionDetail.billing_mode`, `Quote.CreateParamsSubscriptionDatum.billing_mode`, `Quote.SubscriptionDatum.billing_mode`, `QuotePreviewSubscriptionSchedule.billing_mode`, `Subscription.CreateParams.billing_mode`, `Subscription.billing_mode`, `SubscriptionSchedule.CreateParams.billing_mode`, `SubscriptionSchedule.billing_mode`, and `checkout.Session.CreateParamsSubscriptionDatum.billing_mode` + * Add support for `institution` on `FinancialConnections.Account` + * Add support for `countries` on `FinancialConnections.Institution` + * Change type of `Invoice.CreatePreviewParamsSubscriptionDetail.cancel_at`, `Subscription.CreateParams.cancel_at`, and `Subscription.ModifyParams.cancel_at` from `DateTime` to `DateTime | enum('max_period_end'|'min_period_end')` + * Add support for `location` and `reader` on `PaymentAttemptRecord.PaymentMethodDetail.Affirm`, `PaymentAttemptRecord.PaymentMethodDetail.WechatPay`, `PaymentRecord.PaymentMethodDetail.Affirm`, and `PaymentRecord.PaymentMethodDetail.WechatPay` + * Add support for `hooks` on `PaymentIntent.CaptureParams`, `PaymentIntent.ConfirmParams`, `PaymentIntent.CreateParams`, `PaymentIntent.DecrementAuthorizationParams`, `PaymentIntent.IncrementAuthorizationParams`, `PaymentIntent.ModifyParams`, and `PaymentIntent` + * Add support for `card_present` on `PaymentIntentAmountDetailsLineItem.PaymentMethodOption` + * Add support for `livemode` on `Privacy.RedactionJob` + * Add support for `billing_thresholds` on `QuotePreviewSubscriptionSchedule.DefaultSetting`, `QuotePreviewSubscriptionSchedule.Phase.Item`, and `QuotePreviewSubscriptionSchedule.Phase` + * Add support for `billing_mode_details` on `Subscription` + * Add support for `tax_transaction_attempts` on `Tax.Association` + * Add support for `confirm_config` on `Terminal.Reader.Action.ConfirmPaymentIntent` and `terminal.Reader.ConfirmPaymentIntentParams` + * Add support for error code `forwarding_api_upstream_error` on `QuotePreviewInvoice.LastFinalizationError` + + ## 12.2.0 - 2025-05-29 This release changes the pinned API version to `2025-05-28.basil`. @@ -34,6 +84,22 @@ * Add support for error code `forwarding_api_upstream_error` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError` * [#1511](https://github.com/stripe/stripe-python/pull/1511) Adds CONTRIBUTING.md +## 12.2.0b1 - 2025-04-30 +This release changes the pinned API version to `2025-04-30.preview`. +* [#1501](https://github.com/stripe/stripe-python/pull/1501) Update generated code for beta + * Add support for `billing_mode` on `Invoice.CreatePreviewParamsScheduleDetail`, `Invoice.CreatePreviewParamsSubscriptionDetail`, `InvoiceService.CreatePreviewParamsScheduleDetail`, `InvoiceService.CreatePreviewParamsSubscriptionDetail`, `Quote.SubscriptionDatum`, `QuotePreviewSubscriptionSchedule`, `SubscriptionSchedule`, `Subscription`, `checkout.Session.CreateParamsSubscriptionDatum`, and `checkout.SessionService.CreateParamsSubscriptionDatum` + * Add support for new value `balance_settings.updated` on enum `Event.type` + * Add support for new value `balance_settings.updated` on enums `WebhookEndpoint.ModifyParams.enabled_events` and `WebhookEndpointService.UpdateParams.enabled_events` +* [#1498](https://github.com/stripe/stripe-python/pull/1498) Update generated code for beta + * Add support for new values `aw_tin`, `az_tin`, `bd_bin`, `bf_ifu`, `bj_ifu`, `cm_niu`, `cv_nif`, `et_tin`, `kg_tin`, and `la_tin` on enums `Checkout.Session.CollectedInformation.TaxId.type`, `Checkout.Session.CustomerDetail.TaxId.type`, `Invoice.CustomerTaxId.type`, `Order.TaxDetail.TaxId.type`, `QuotePreviewInvoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetail.TaxId.type`, `Tax.Transaction.CustomerDetail.TaxId.type`, and `TaxId.type` + * Change `Checkout.Session.AutomaticTax.provider`, `Invoice.AutomaticTax.provider`, `Quote.AutomaticTax.provider`, and `QuotePreviewInvoice.AutomaticTax.provider` to be required + * Add support for `account_number` on `ConfirmationToken.PaymentMethodPreview.AcssDebit` and `PaymentMethod.AcssDebit` + * Add support for new values `aw_tin`, `az_tin`, `bd_bin`, `bf_ifu`, `bj_ifu`, `cm_niu`, `cv_nif`, `et_tin`, `kg_tin`, and `la_tin` on enums `Customer.CreateParams.type`, `Customer.CreateParamsTaxIdDatum.type`, `CustomerService.CreateParamsTaxIdDatum.type`, `CustomerTaxIdService.CreateParams.type`, `Invoice.CreatePreviewParamsCustomerDetailTaxId.type`, `InvoiceService.CreatePreviewParamsCustomerDetailTaxId.type`, `Order.CreateParamsTaxDetailTaxId.type`, `Order.ModifyParamsTaxDetailTaxId.type`, `OrderService.CreateParamsTaxDetailTaxId.type`, `OrderService.UpdateParamsTaxDetailTaxId.type`, `TaxId.CreateParams.type`, `TaxIdService.CreateParams.type`, `tax.Calculation.CreateParamsCustomerDetailTaxId.type`, and `tax.CalculationService.CreateParamsCustomerDetailTaxId.type` + * Change type of `InvoiceLineItem.Parent.SubscriptionItemDetail.subscription` from `string` to `nullable(string)` + * Add support for `billing_mode` on `Quote.CreateParamsSubscriptionDatum`, `QuoteService.CreateParamsSubscriptionDatum`, `Subscription.CreateParams`, `SubscriptionSchedule.CreateParams`, `SubscriptionScheduleService.CreateParams`, and `SubscriptionService.CreateParams` + * Add support for `bf`, `cm`, and `cv` on `Tax.Registration.CountryOption`, `tax.Registration.CreateParamsCountryOption`, and `tax.RegistrationService.CreateParamsCountryOption` + * Add support for new value `2025-04-30.basil` on enums `WebhookEndpoint.CreateParams.api_version` and `WebhookEndpointService.CreateParams.api_version` + ## 12.1.0 - 2025-04-30 This release changes the pinned API version to `2025-04-30.basil`. @@ -62,6 +128,144 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `aw`, `az`, `bd`, `bf`, `bj`, `cm`, `cv`, `et`, `in`, `kg`, `la`, and `ph` on `Tax.Registration.CountryOption`, `tax.Registration.CreateParamsCountryOption`, and `tax.RegistrationService.CreateParamsCountryOption` * Add support for new value `2025-04-30.basil` on enums `WebhookEndpoint.CreateParams.api_version` and `WebhookEndpointService.CreateParams.api_version` +## 12.1.0b3 - 2025-04-17 +* [#1495](https://github.com/stripe/stripe-python/pull/1495) Update generated code for beta + * Add support for new resources `FxQuote` and `PaymentIntentAmountDetailsLineItem` + * Add support for `create`, `list`, and `retrieve` methods on resource `FxQuote` + * Remove support for `attach_payment_intent` method on resource `Invoice` + * Add support for `registration_date` on `Account.Company`, `Account.CreateParamsCompany`, `Account.UpdateParamsCompany`, and `Token.CreateParamsAccountCompany` + * Add support for `customer_reference` and `order_reference` on `Charge.CaptureParamsPaymentDetail`, `Charge.UpdateParamsPaymentDetail`, `PaymentIntent.CaptureParamsPaymentDetail`, `PaymentIntent.ConfirmParamsPaymentDetail`, `PaymentIntent.CreateParamsPaymentDetail`, `PaymentIntent.PaymentDetail`, and `PaymentIntent.UpdateParamsPaymentDetail` + * Add support for `tax_id` on `Charge.BillingDetail`, `ConfirmationToken.CreateParamsPaymentMethodDatumBillingDetail`, `ConfirmationToken.PaymentMethodPreview.BillingDetail`, `PaymentIntent.ConfirmParamsPaymentMethodDatumBillingDetail`, `PaymentIntent.CreateParamsPaymentMethodDatumBillingDetail`, `PaymentIntent.UpdateParamsPaymentMethodDatumBillingDetail`, `PaymentMethod.BillingDetail`, `PaymentMethod.CreateParamsBillingDetail`, `PaymentMethod.UpdateParamsBillingDetail`, `SetupIntent.ConfirmParamsPaymentMethodDatumBillingDetail`, `SetupIntent.CreateParamsPaymentMethodDatumBillingDetail`, `SetupIntent.UpdateParamsPaymentMethodDatumBillingDetail`, and `treasury.OutboundPayment.CreateParamsDestinationPaymentMethodDatumBillingDetail` + * Add support for `price_data` on `checkout.Session.UpdateParamsLineItem` + * Change type of `checkout.Session.UpdateParamsLineItem.quantity` from `longInteger` to `emptyable(longInteger)` + * Add support for `script` on `Coupon.CreateParams` and `Coupon` + * Add support for `type` on `Coupon` + * Add support for new value `fx_quote.expired` on enum `Event.type` + * Add support for new value `affirm` on enums `Invoice.CreateParamsPaymentSetting.payment_method_types`, `Invoice.PaymentSetting.payment_method_types`, `Invoice.UpdateParamsPaymentSetting.payment_method_types`, `QuotePreviewInvoice.PaymentSetting.payment_method_types`, `Subscription.CreateParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, and `Subscription.UpdateParamsPaymentSetting.payment_method_types` + * Add support for `fx_quote` on `PaymentIntent.ConfirmParams`, `PaymentIntent.CreateParams`, `PaymentIntent.UpdateParams`, `PaymentIntent`, `Transfer.CreateParams`, and `Transfer` + * Add support for `discount_amount`, `line_items`, `shipping`, and `tax` on `PaymentIntent.AmountDetail` + * Add support for `pix` on `PaymentMethodConfiguration.CreateParams`, `PaymentMethodConfiguration.UpdateParams`, and `PaymentMethodConfiguration` + * Add support for `us_cfpb_data` on `Person` and `Token.CreateParamsPerson` + * Add support for `pending_reason` on `Refund` + * Add support for `aw`, `az`, `bd`, `bj`, `et`, `kg`, `la`, and `ph` on `TaxRegistration.CountryOption` and `tax.Registration.CreateParamsCountryOption` + * Add support for new value `fx_quote.expired` on enums `WebhookEndpoint.CreateParams.enabled_events` and `WebhookEndpoint.UpdateParams.enabled_events` + * Add support for snapshot event `fx_quote.expired` with resource `FxQuote` + +## 12.1.0b2 - 2025-04-10 +* [#1489](https://github.com/stripe/stripe-python/pull/1489) Update generated code for beta + + ### Breaking changes + * Change type of `V2MoneyManagementReceivedDebit.status_transitions` from `an object` to `nullable(an object)` + * Remove support for values `bank_accounts.local_uk`, `bank_accounts.wire_uk`, `cards_uk`, and `crypto_wallets_v2` from enum `EventsV2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.updated_capability` + + ### Additions + * Add support for new resources `Privacy.RedactionJobRootObjects`, `Privacy.RedactionJobValidationError`, and `Privacy.RedactionJob` + * Add support for `cancel`, `create`, `list`, `modify`, `retrieve`, `run`, and `validate` methods on resource `RedactionJob` + * Add support for `list` and `retrieve` methods on resource `RedactionJobValidationError` + * Add support for `minority_owned_business_designation` on `Account.BusinessProfile`, `Account.CreateParamsBusinessProfile`, and `Account.UpdateParamsBusinessProfile` + * Add support for new value `verification_legal_entity_structure_mismatch` on enums `Account.FutureRequirement.Error.code`, `Account.Requirement.Error.code`, `AccountCapability.FutureRequirement.Error.code`, `AccountCapability.Requirement.Error.code`, `AccountPerson.FutureRequirement.Error.code`, `AccountPerson.Requirement.Error.code`, `BankAccount.FutureRequirement.Error.code`, and `BankAccount.Requirement.Error.code` + * Add support for `export_tax_transactions` and `payment_disputes` on `AccountSession.CreateParamsComponent` + * Add support for new value `tax_id_prohibited` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `QuotePreviewInvoice.LastFinalizationError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` + * Add support for new value `fixed_term_loan` on enum `CapitalFinancingOffer.type` + * Add support for `wallet_options` on `CheckoutSession` and `checkout.Session.CreateParams` + * Add support for new values `privacy.redaction_job.canceled`, `privacy.redaction_job.created`, `privacy.redaction_job.ready`, `privacy.redaction_job.succeeded`, and `privacy.redaction_job.validation_error` on enum `Event.type` + * Add support for `klarna` on `PaymentMethodDomain` + * Change type of `TaxCalculationLineItem.reference` from `nullable(string)` to `string` + * Add support for `in` on `TaxRegistration.CountryOption` and `tax.Registration.CreateParamsCountryOption` + * Add support for new values `privacy.redaction_job.canceled`, `privacy.redaction_job.created`, `privacy.redaction_job.ready`, `privacy.redaction_job.succeeded`, and `privacy.redaction_job.validation_error` on enums `WebhookEndpoint.CreateParams.enabled_events` and `WebhookEndpoint.UpdateParams.enabled_events` +* [#1490](https://github.com/stripe/stripe-python/pull/1490) Handle external account + - Changes `external_account` field in `external_account_service.create` from `string` to a union type. + +## 12.1.0b1 - 2025-04-02 +* [#1455](https://github.com/stripe/stripe-python/pull/1455), [#1477](https://github.com/stripe/stripe-python/pull/1477), [#1482](https://github.com/stripe/stripe-python/pull/1482) Update generated code for beta + +This release changes the pinned API version to `2025-03-31.preview` + +### Breaking changes: +* Remove support for `AmountOverpaid` on `InvoicePayment` +* Remove support for values `out_of_band_payment` and `payment_record` from enum `InvoicePayment.Payment.type` +* Remove support for `RateCardSubscriptionDetails` on `InvoiceItemParent` +* Remove support for `ApplicationFeeAmount`, `PaidOutOfBand`, and `Paid` on `QuotePreviewInvoice` +* Remove support for `billing_thresholds` on `QuotePreviewSubscriptionSchedule.DefaultSetting`, `QuotePreviewSubscriptionSchedule.Phase.Item`, and `QuotePreviewSubscriptionSchedule.Phase` +* Remove support for `coupon` on `QuotePreviewSubscriptionSchedule.Phase` +* Change type of `QuotePreviewInvoice.Parent.SubscriptionDetail.subscription` from `string` to `expandable($Subscription)` +* Change `CheckoutSession.Permission.update` to be optional +* Change type of `PaymentAttemptRecord.PaymentMethodDetail.type` and `PaymentRecord.PaymentMethodDetail.type` from `literal('custom')` to `string` +* Change type of `PaymentAttemptRecord.payment_record` from `string` to `nullable(string)` +* Change `PaymentAttemptRecord.PaymentMethodDetail.custom` and `PaymentRecord.PaymentMethodDetail.custom` to be optional +* Change type of `PaymentRecord.latest_payment_attempt_record` from `string` to `nullable(string)` +* Change type of `Order.CreateParamsPaymentSettingPaymentMethodOptionWechatPay.client` and `Order.UpdateParamsPaymentSettingPaymentMethodOptionWechatPay.client` to be optional + +### Additions +* Add support for `payment_method_options` on `ConfirmationToken.CreateParams` +* Add support for `installments` on `ConfirmationToken.PaymentMethodOption.Card` +* Add support for `billie` on `PaymentIntent.ConfirmParamsPaymentMethodOption`, `PaymentIntent.CreateParamsPaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, and `PaymentIntent.UpdateParamsPaymentMethodOption` +* Add support for `update_line_items` on `CheckoutSession.Permission` and `checkout.Session.CreateParamsPermission` +* Add support for `new resources` BalanceSettings +* Add support for `modify` and `retrieve` methods on resource `BalanceSettings` +* Add support for `create`, `delete`, `list`, `modify`, and `retrieve` methods on a new `ExternalAccountService` to access cards and bank accounts made available in the new path `v1/external_accounts` +* Add support for `stripe_balance_payments` on `Account.Capability`, `Account.CreateParamsCapability`, and `Account.UpdateParamsCapability` +* Add support for new values `stripe_balance_payment_debit_reversal` and `stripe_balance_payment_debit` on enum `BalanceTransaction.type` +* Add support for `customer_account` on `BillingCreditBalanceSummary`, `BillingCreditGrant`, `BillingPortalSession`, `CheckoutSession`, `ConfirmationToken.PaymentMethodPreview`, `CreditNote.ListParams`, `CreditNote`, `CustomerBalanceTransaction`, `CustomerCashBalanceTransaction`, `CustomerCashBalance`, `CustomerPaymentMethod`, `CustomerSession.CreateParams`, `CustomerSession`, `CustomerTaxId.Owner`, `CustomerTaxId`, `Customer`, `Discount`, `FinancialConnectionsAccount.AccountHolder`, `FinancialConnectionsSession.AccountHolder`, `Invoice.CreateParams`, `Invoice.CreatePreviewParams`, `Invoice.ListParams`, `InvoiceItem.CreateParams`, `InvoiceItem.ListParams`, `InvoiceItem`, `Invoice`, `PaymentIntent.CreateParams`, `PaymentIntent.ListParams`, `PaymentIntent.UpdateParams`, `PaymentIntent`, `PaymentMethod.AttachParams`, `PaymentMethod`, `PromotionCode.CreateParams`, `PromotionCode.ListParams`, `PromotionCode`, `Quote.CreateParams`, `Quote.ListParams`, `Quote.UpdateParams`, `QuotePreviewInvoice`, `QuotePreviewSubscriptionSchedule`, `Quote`, `SetupAttempt`, `SetupIntent.CreateParams`, `SetupIntent.ListParams`, `SetupIntent.UpdateParams`, `SetupIntent`, `Subscription.CreateParams`, `Subscription.ListParams`, `SubscriptionSchedule.CreateParams`, `SubscriptionSchedule.ListParams`, `SubscriptionSchedule`, `Subscription`, `TaxId.CreateParamsOwner`, `TaxId.ListParamsOwner`, `TaxId.Owner`, `TaxId`, `billing.CreditBalanceSummary.RetrieveParams`, `billing.CreditBalanceTransaction.ListParams`, `billing.CreditGrant.CreateParams`, `billing.CreditGrant.ListParams`, `billingportal.Session.CreateParams`, `checkout.Session.CreateParams`, `checkout.Session.ListParams`, `financialconnections.Account.ListParamsAccountHolder`, and `financialconnections.Session.CreateParamsAccountHolder` +* Add support for `stripe_balance` on `Charge.PaymentMethodDetail`, `ConfirmationToken.CreateParamsPaymentMethodDatum`, `ConfirmationToken.PaymentMethodPreview`, `CustomerPaymentMethod`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntent.ConfirmParamsPaymentMethodDatum`, `PaymentIntent.ConfirmParamsPaymentMethodOption`, `PaymentIntent.CreateParamsPaymentMethodDatum`, `PaymentIntent.CreateParamsPaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, `PaymentIntent.UpdateParamsPaymentMethodDatum`, `PaymentIntent.UpdateParamsPaymentMethodOption`, `PaymentMethod.CreateParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.ConfirmParamsPaymentMethodDatum`, `SetupIntent.CreateParamsPaymentMethodDatum`, and `SetupIntent.UpdateParamsPaymentMethodDatum` +* Add support for `update_shipping_details` on `CheckoutSession.Permission` and `checkout.Session.CreateParamsPermission` +* Add support for `provider` on `CheckoutSession.AutomaticTax`, `Invoice.AutomaticTax`, `Quote.AutomaticTax`, and `QuotePreviewInvoice.AutomaticTax` +* Add support for `tax_calculation_reference` on `CreditNoteLineItem`, `CreditNotePreviewLines`, `InvoiceLineItem`, `LineItem`, `PaymentLinkLineItem`, `QuoteComputedUpfrontLineItems`, `QuoteLineItem`, and `SessionLineItem` +* Add support for `context` on `Event` +* Add support for `related_customer_account` on `IdentityVerificationSession`, `identity.VerificationSession.CreateParams`, and `identity.VerificationSession.ListParams` +* Add support for `payout_method` on `Payout.CreateParams` and `Payout` +* Add support for `confirmation_secret`, `parent`, and `total_taxes` on `QuotePreviewInvoice` +* Add support for new values `forwarding_api_retryable_upstream_error`, `setup_intent_mobile_wallet_unsupported`, `v2_account_disconnection_unsupported`, and `v2_account_missing_configuration` on enum `QuotePreviewInvoice.LastFinalizationError.code` +* Add support for new values `klarna`, `nz_bank_account`, and `stripe_balance` on enum `QuotePreviewInvoice.PaymentSetting.payment_method_types` +* Add support for `id` and `text` on `TerminalReader.Action.CollectInput.Input.Selection.Choice`, `TerminalReader.Action.CollectInput.Input.Selection`, and `terminal.Reader.CollectInputsParamsInputSelectionChoice` +* Add support for `network_data` on `IssuingDisputeSettlementDetail` +* Add support for `interchange_fees_amount`, `net_total_amount`, `network_fees_amount`, `other_fees_amount`, `other_fees_count`, and `transaction_amount` on `IssuingSettlement` +* Add support for `reported_by` on `PaymentAttemptRecord` + +#### New APIs for Money CardManagement + +* Add support for new resources `V2.FinancialAddressCreditSimulation`, `V2.FinancialAddressGeneratedMicrodeposits`, `V2.MoneyManagement.Adjustment`, `V2.MoneyManagement.FinancialAccount`, `V2.MoneyManagement.FinancialAddress`, `V2.MoneyManagement.InboundTransfer`, `V2.MoneyManagement.OutboundPaymentQuote`, `V2.MoneyManagement.OutboundPayment`, `V2.MoneyManagement.OutboundSetupIntent`, `V2.MoneyManagement.OutboundTransfer`, `V2.MoneyManagement.PayoutMethod`, `V2.MoneyManagement.PayoutMethodsBankAccountSpec`, `V2.MoneyManagement.ReceivedCredit`, `V2.MoneyManagement.ReceivedDebit`, `V2.MoneyManagement.TransactionEntry`, and `V2.MoneyManagement.Transaction` +* Add support for `create` method on resource `V2.MoneyManagement.OutboundPaymentQuote` +* Add support for `list` and `retrieve` methods on resources `V2.MoneyManagement.Adjustment`, `V2.MoneyManagement.FinancialAccount`, `V2.MoneyManagement.ReceivedCredit`, `V2.MoneyManagement.ReceivedDebit`, `V2.MoneyManagement.TransactionEntry`, and `V2.MoneyManagement.Transaction` +* Add support for `create`, `list`, and `retrieve` methods on resources `V2.MoneyManagement.FinancialAddress` and `V2.MoneyManagement.InboundTransfer` +* Add support for `cancel`, `create`, `list`, and `retrieve` methods on resources `V2.MoneyManagement.OutboundPayment` and `V2.MoneyManagement.OutboundTransfer` +* Add support for `archive`, `list`, `retrieve`, and `unarchive` methods on resource `V2.MoneyManagement.PayoutMethod` +* Add support for `cancel`, `create`, `list`, `modify`, and `retrieve` methods on resource `V2.MoneyManagement.OutboundSetupIntent` +* Add support for `retrieve` method on resource `V2.MoneyManagement.PayoutMethodsBankAccountSpec` +* Add support for `acknowledge_confirmation_of_payee`, `archive`, `create`, `initiate_confirmation_of_payee`, and `retrieve` methods on resource `V2.Core.Vault.GbBankAccount` +* Add support for `archive`, `create`, `modify`, and `retrieve` methods on resource `V2.Core.Vault.UsBankAccount` +* Add support for new values `account_number`, `fedwire_routing_number`, and `routing_number` on enum `InvalidPaymentMethod.invalid_param` +* Add support for new thin event `V2MoneyManagementFinancialAccountCreatedEvent` with related object `V2.MoneyManagement.FinancialAccount` +* Add support for new thin events `V2MoneyManagementFinancialAddressActivatedEvent` and `V2MoneyManagementFinancialAddressFailedEvent` with related object `V2.MoneyManagement.FinancialAddress` +* Add support for new thin events `V2MoneyManagementInboundTransferAvailableEvent`, `V2MoneyManagementInboundTransferBankDebitFailedEvent`, `V2MoneyManagementInboundTransferBankDebitProcessingEvent`, `V2MoneyManagementInboundTransferBankDebitQueuedEvent`, `V2MoneyManagementInboundTransferBankDebitReturnedEvent`, and `V2MoneyManagementInboundTransferBankDebitSucceededEvent` with related object `V2.MoneyManagement.InboundTransfer` +* Add support for new thin events `V2MoneyManagementOutboundPaymentCanceledEvent`, `V2MoneyManagementOutboundPaymentCreatedEvent`, `V2MoneyManagementOutboundPaymentFailedEvent`, `V2MoneyManagementOutboundPaymentPostedEvent`, and `V2MoneyManagementOutboundPaymentReturnedEvent` with related object `V2.MoneyManagement.OutboundPayment` +* Add support for new thin events `V2MoneyManagementOutboundTransferCanceledEvent`, `V2MoneyManagementOutboundTransferCreatedEvent`, `V2MoneyManagementOutboundTransferFailedEvent`, `V2MoneyManagementOutboundTransferPostedEvent`, and `V2MoneyManagementOutboundTransferReturnedEvent` with related object `V2.MoneyManagement.OutboundTransfer` +* Add support for new thin events `V2MoneyManagementReceivedCreditAvailableEvent`, `V2MoneyManagementReceivedCreditFailedEvent`, `V2MoneyManagementReceivedCreditReturnedEvent`, and `V2MoneyManagementReceivedCreditSucceededEvent` with related object `V2.MoneyManagement.ReceivedCredit` +* Add support for new thin events `V2MoneyManagementReceivedDebitCanceledEvent`, `V2MoneyManagementReceivedDebitFailedEvent`, `V2MoneyManagementReceivedDebitPendingEvent`, `V2MoneyManagementReceivedDebitSucceededEvent`, and `V2MoneyManagementReceivedDebitUpdatedEvent` with related object `V2.MoneyManagement.ReceivedDebit` +* Add support for new error types `AlreadyCanceledError`, `BlockedByStripeError`, `ControlledByDashboardError`, `FeatureNotEnabledError`, `FinancialAccountNotOpenError`, `InsufficientFundsError`, `InvalidPayoutMethodError`, `NotCancelableError`, and `RecipientNotNotifiableError` + +#### New APIs for Accounts v2 in private preview +See [SaaS platform payments with subscription billing using Accounts v2](https://docs.stripe.com/connect/accounts-v2/saas-platform-payments-billing) + +* Add support for new resources `V2.Core.AccountLink`, `V2.Core.Account`, `V2.Core.Person`, `V2.Core.Vault.GbBankAccount`, `V2.Core.Vault.UsBankAccount` +* Add support for `close`, `create`, `list`, `modify`, and `retrieve` methods on resource `V2.Core.Account` +* Add support for `create` method on resource `V2.Core.AccountLink` +* Add support for new thin events `V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationCustomerUpdatedEvent`, `V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationMerchantUpdatedEvent`, `V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationRecipientUpdatedEvent`, `V2CoreAccountIncludingIdentityUpdatedEvent`, and `V2CoreAccountIncludingRequirementsUpdatedEvent` +* Add support for new thin event `V2CoreAccountLinkCompletedEvent` with related object `V2.Core.AccountLink` +* Add support for new thin events `V2CoreAccountPersonCreatedEvent`, `V2CoreAccountPersonDeletedEvent`, and `V2CoreAccountPersonUpdatedEvent` with related object `V2.Core.Person` + +### Changes +* Change `CustomerSession.CreateParams.customer`, `InvoiceItem.CreateParams.customer`, `PaymentMethod.AttachParams.customer`, `Subscription.CreateParams.customer`, `billing.CreditBalanceSummary.RetrieveParams.customer`, `billing.CreditBalanceTransaction.ListParams.customer`, `billing.CreditGrant.CreateParams.customer`, and `billingportal.Session.CreateParams.customer` to be optional +* Change type of `Invoice.Parent.SubscriptionDetail.PauseCollection.behavior` and `QuotePreviewInvoice.Parent.SubscriptionDetail.PauseCollection.behavior` from `string` to `enum('keep_as_draft'|'mark_uncollectible'|'void')` +* Change `CreditNote.refunds` to be required +* Change `Invoice.amount_overpaid` and `QuotePreviewInvoice.amount_overpaid` to be required +* Change type of `InvoicePayment.is_default` from `nullable(boolean)` to `boolean` +* Change type of `PaymentAttemptRecord.PaymentMethodDetail.custom` and `PaymentRecord.PaymentMethodDetail.custom` from `nullable(PaymentsPrimitivesPaymentRecordsResourcePaymentMethodCustomDetails)` to `PaymentsPrimitivesPaymentRecordsResourcePaymentMethodCustomDetails` +* Change `PaymentRecord.ReportPaymentParams.payment_reference` to be optional + +* [#1476](https://github.com/stripe/stripe-python/pull/1476) Update add_beta_version logic + * ⚠️ stripe.add_beta_version` will use the highest version number used for a beta feature instead of raising an `Exception` on a conflict as it had done previously. + ## 12.0.1 - 2025-04-21 * [#1499](https://github.com/stripe/stripe-python/pull/1499) Encode bools with lower case - Serializes boolean query parameter values to `true`/`false` (lower case) before sending to the Stripe API for compatibility with Stripe V2 endpoints @@ -167,6 +371,13 @@ This release changes the pinned API version to `2025-04-30.basil`. * Rename `ThinEvent.related_object.type_` to `ThinEvent.related_object.type` * This was an unintentional typo before. The property name now correctly matches the value you get back from the API +## 11.7.0b1 - 2025-03-18 +* [#1469](https://github.com/stripe/stripe-python/pull/1469) Beta SDK updates between Open API versions 1473 and 1505 + + * Add support for `target_date` on parameter classes `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit`, `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit`, `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit`, and `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit` and resource classes `stripe.Order.Payment.Settings.PaymentMethodOptions.AcssDebit` and `stripe.Order.Payment.Settings.PaymentMethodOptions.SepaDebit` + * Add support for `succeed_input_collection` and `timeout_input_collection` on resource `stripe.terminal.Reader` +* [#1467](https://github.com/stripe/stripe-python/pull/1467) Merge python-beta + ## 11.6.0 - 2025-02-24 * [#1450](https://github.com/stripe/stripe-python/pull/1450) Update generated code * Add support for `target_date` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAcssDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsAuBecsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebit`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAcssDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsAuBecsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebit`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebit`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsUsBankAccount` and resource classes `stripe.PaymentIntent.PaymentMethodOptions.AcssDebit`, `stripe.PaymentIntent.PaymentMethodOptions.AuBecsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit`, `stripe.PaymentIntent.PaymentMethodOptions.SepaDebit`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount`, `stripe.checkout.Session.PaymentMethodOptions.AcssDebit`, `stripe.checkout.Session.PaymentMethodOptions.AuBecsDebit`, `stripe.checkout.Session.PaymentMethodOptions.BacsDebit`, `stripe.checkout.Session.PaymentMethodOptions.SepaDebit`, and `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount` @@ -217,6 +428,16 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list +## 11.6.0b1 - 2025-02-07 +* [#1449](https://github.com/stripe/stripe-python/pull/1449) Update generated code for beta + * Add support for `rejected_reason` on resource class `stripe.Account.RiskControls` + * Add support for `product_tax_code_selector` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `brand_product` on resource classes `stripe.Charge.PaymentMethodDetails.AmazonPay.Funding.Card` and `stripe.Charge.PaymentMethodDetails.RevolutPay.Funding.Card` + * Add support for `prices` on parameter classes `stripe.billing.CreditBalanceSummary.RetrieveParamsFilterApplicabilityScope` and `stripe.billing.CreditGrant.CreateParamsApplicabilityConfigScope` and resource class `stripe.billing.CreditGrant.ApplicabilityConfig.Scope` + * Add support for `restrictions` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Change type of `political_exposure` on `stripe.Account.CreatePersonParams`, `stripe.Account.ModifyPersonParams`, and `stripe.Token.CreateParamsPerson` from `str` to `Literal['existing', 'none']` + * Change type of `price_type` on `stripe.billing.CreditGrant.ApplicabilityConfig.Scope` from `Literal['metered']` to `Optional[Literal['metered']]` + ## 11.5.0 - 2025-01-27 * [#1443](https://github.com/stripe/stripe-python/pull/1443) Update generated code * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` @@ -253,6 +474,48 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1442](https://github.com/stripe/stripe-python/pull/1442) Fix V2 ListObject.data type hint - Change `stripe.v2.ListObject.data` type hint from `List[StripeObject]` to `List[T]` where T is the specific stripe object contained within the list +## 11.5.0b3 - 2025-01-23 +* [#1447](https://github.com/stripe/stripe-python/pull/1447) Update generated code for beta + * Remove support for `stripe_account` on resource classes `stripe.terminal.Reader.Action.CollectPaymentMethod`, `stripe.terminal.Reader.Action.ConfirmPaymentIntent`, `stripe.terminal.Reader.Action.ProcessPaymentIntent`, and `stripe.terminal.Reader.Action.RefundPayment` + +## 11.5.0b2 - 2025-01-17 +* [#1439](https://github.com/stripe/stripe-python/pull/1439) Update generated code for beta + * Add support for `pay_by_bank_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `directorship_declaration` on parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `proof_of_ultimate_beneficial_ownership` on parameter class `stripe.Account.CreateParamsDocuments` + * Add support for `financial_account` on resource class `stripe.AccountSession.Components` + * Add support for `issuing_card` on resource class `stripe.AccountSession.Components` + * Add support for `tax_threshold_monitoring` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `pay_by_bank` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `discounts` on resource `stripe.checkout.Session` + * Add support for `jpy` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Add support for `always_invoice` on enums `stripe.billing_portal.Configuration.Features.SubscriptionCancel.proration_behavior`, `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionCancel.proration_behavior`, and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionCancel.proration_behavior` + * Add support for `SD` on enums `stripe.checkout.Session.ShippingAddressCollection.allowed_countries`, `stripe.checkout.Session.CreateParamsShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.ShippingAddressCollection.allowed_countries`, `stripe.PaymentLink.CreateParamsShippingAddressCollection.allowed_countries`, and `stripe.PaymentLink.ModifyParamsShippingAddressCollection.allowed_countries` + * Add support for `pay_by_bank` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `2025-01-27.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` + +## 11.5.0b1 - 2025-01-09 +* [#1433](https://github.com/stripe/stripe-python/pull/1433) Update generated code for beta + * Add support for `directorship_declaration` on resource class `stripe.Account.Company` + * Add support for `ownership_exemption_reason` on resource class `stripe.Account.Company` and parameter classes `stripe.Account.CreateParamsCompany` and `stripe.Token.CreateParamsAccountCompany` + * Add support for `brand_product` on resource `stripe.Card` and resource classes `stripe.Source.Card`, `stripe.Source.CardPresent`, and `stripe.Source.ThreeDSecure` + * Add support for `advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.QuotePreviewInvoice.LastFinalizationError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `country` on resource classes `stripe.Charge.PaymentMethodDetails.Paypal`, `stripe.ConfirmationToken.PaymentMethodPreview.Paypal`, and `stripe.PaymentMethod.Paypal` + * Add support for `phone_number_collection` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for `nickname` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` + * Add support for `forwarding_settings` on parameter class `stripe.treasury.FinancialAccount.ModifyParams` + * Add support for `_cls_close` on resource `stripe.treasury.FinancialAccount` + * Add support for `close` on resource `stripe.treasury.FinancialAccount` + * Add support for `is_default` on resource `stripe.treasury.FinancialAccount` + * Add support for `destination_payment_method_data` on parameter class `stripe.treasury.OutboundTransfer.CreateParams` + * Add support for `financial_account` on resource class `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails` + * Add support for `outbound_transfer` on resource class `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails` + * Remove support for `always_invoice` on enums `stripe.billing_portal.Configuration.Features.SubscriptionCancel.proration_behavior`, `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionCancel.proration_behavior`, and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionCancel.proration_behavior` + * Add support for `al_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `financial_account` on enum `stripe.treasury.OutboundTransfer.DestinationPaymentMethodDetails.type` + * Add support for `outbound_transfer` on enums `stripe.treasury.ReceivedCredit.LinkedFlows.SourceFlowDetails.type` and `stripe.treasury.ReceivedCredit.ListParamsLinkedFlows.source_flow_type` + * Change type of `pretax_credit_amounts` on `stripe.CreditNote` and `stripe.CreditNoteLineItem` from `Optional[List[PretaxCreditAmount]]` to `List[PretaxCreditAmount]` + ## 11.4.1 - 2024-12-19 * [#1438](https://github.com/stripe/stripe-python/pull/1438) Fix regression when using httpx HTTP client @@ -324,6 +587,56 @@ This release changes the pinned API version to `2025-04-30.basil`. - Fixes an issue where `StripeError.http_body` may be None even when `json_body` is a valid dictionary. * [#1431](https://github.com/stripe/stripe-python/pull/1431) fix deprecation warning in httpx @ 0.28 +## 11.4.0b3 - 2024-12-12 +* [#1429](https://github.com/stripe/stripe-python/pull/1429) Update generated code for beta + * Add support for `allow_redisplay` on resources `stripe.Card` and `stripe.Source` + * Add support for `account` on resource classes `stripe.terminal.Reader.Action.CollectPaymentMethod`, `stripe.terminal.Reader.Action.ConfirmPaymentIntent`, `stripe.terminal.Reader.Action.ProcessPaymentIntent`, and `stripe.terminal.Reader.Action.RefundPayment` + * Remove support for `amount_refunded` on resource `stripe.PaymentRecord` + * Add support for `am_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `ao_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `ba_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `bb_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `bs_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `cd_nif` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `gn_nif` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `kh_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `me_pib` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `mk_vat` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `mr_nif` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `np_pan` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `sn_ninea` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `sr_fin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `tj_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `ug_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `zm_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `zw_tin` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Add support for `network_fallback` on enum `stripe.issuing.Authorization.RequestHistory.reason` + +## 11.4.0b2 - 2024-12-05 +* [#1426](https://github.com/stripe/stripe-python/pull/1426) Update generated code for beta + * Add support for `automatic_indirect_tax` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `disabled_reason` on resource classes `stripe.Invoice.AutomaticTax`, `stripe.QuotePreviewInvoice.AutomaticTax`, `stripe.QuotePreviewSubscriptionSchedule.DefaultSettings.AutomaticTax`, `stripe.QuotePreviewSubscriptionSchedule.Phase.AutomaticTax`, `stripe.Subscription.AutomaticTax`, `stripe.SubscriptionSchedule.DefaultSettings.AutomaticTax`, and `stripe.SubscriptionSchedule.Phase.AutomaticTax` + * Add support for `reference_prefix` on parameter classes `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsBacsDebitMandateOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions` and resource classes `stripe.Order.Payment.Settings.PaymentMethodOptions.SepaDebit.MandateOptions`, `stripe.PaymentIntent.PaymentMethodOptions.BacsDebit.MandateOptions`, `stripe.PaymentIntent.PaymentMethodOptions.SepaDebit.MandateOptions`, `stripe.SetupIntent.PaymentMethodOptions.BacsDebit.MandateOptions`, `stripe.SetupIntent.PaymentMethodOptions.SepaDebit.MandateOptions`, `stripe.checkout.Session.PaymentMethodOptions.BacsDebit.MandateOptions`, and `stripe.checkout.Session.PaymentMethodOptions.SepaDebit.MandateOptions` + * Add support for `trial_period_days` on parameter class `stripe.PaymentLink.ModifyParamsSubscriptionData` + * Add support for `payout_minimum_balance_hold` on enum `stripe.BalanceTransaction.type` + * Add support for `payout_minimum_balance_release` on enum `stripe.BalanceTransaction.type` + +## 11.4.0b1 - 2024-11-21 +* [#1425](https://github.com/stripe/stripe-python/pull/1425) Update generated code for beta + * Add support for `network_advice_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.QuotePreviewInvoice.LastFinalizationError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `network_decline_code` on resource classes `stripe.Charge.Outcome`, `stripe.Invoice.LastFinalizationError`, `stripe.PaymentIntent.LastPaymentError`, `stripe.QuotePreviewInvoice.LastFinalizationError`, `stripe.SetupAttempt.SetupError`, and `stripe.SetupIntent.LastSetupError` + * Add support for `funding` on resource classes `stripe.Charge.PaymentMethodDetails.AmazonPay` and `stripe.Charge.PaymentMethodDetails.RevolutPay` + * Add support for `amount_requested` on resource class `stripe.Charge.PaymentMethodDetails.Card` + * Add support for `partial_authorization` on resource class `stripe.Charge.PaymentMethodDetails.Card` + * Add support for `adjustable_quantity` on resource `stripe.LineItem` + * Add support for `display` on resource `stripe.LineItem` + * Add support for `metadata` on resource `stripe.LineItem` and parameter class `stripe.checkout.Session.CreateParamsLineItem` + * Add support for `request_partial_authorization` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCard`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCard`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCard` and resource class `stripe.PaymentIntent.PaymentMethodOptions.Card` + * Add support for `payment_method_options` on parameter class `stripe.PaymentIntent.IncrementAuthorizationParams` + * Add support for `line_items` on parameter classes `stripe.checkout.Session.CreateParamsPermissionsUpdate` and `stripe.checkout.Session.ModifyParams` and resource class `stripe.checkout.Session.Permissions.Update` + * Change type of `schedule_at_period_end` on `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` from `Optional[ScheduleAtPeriodEnd]` to `ScheduleAtPeriodEnd` + * Add support for `invoice.overpaid` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + ## 11.3.0 - 2024-11-20 * [#1424](https://github.com/stripe/stripe-python/pull/1424) This release changes the pinned API version to `2024-11-20.acacia`. * Add support for `authorizer` on parameter classes `stripe.Account.CreatePersonParamsRelationship`, `stripe.Account.ListPersonsParamsRelationship`, `stripe.Account.ModifyPersonParamsRelationship`, `stripe.Account.PersonsParamsRelationship`, and `stripe.Token.CreateParamsPersonRelationship` and resource class `stripe.Person.Relationship` @@ -348,6 +661,71 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `amount` on `stripe.issuing.Authorization.CreateParams` from `int` to `NotRequired[int]` * Change type of `origin_payment_method` on `stripe.treasury.InboundTransfer` from `str` to `Optional[str]` +## 11.3.0b3 - 2024-11-14 +* [#1422](https://github.com/stripe/stripe-python/pull/1422) Update generated code for beta + * Add support for `account_holder_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Iban`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.SortCode`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Zengin`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Iban`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.SortCode`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Zengin` + * Add support for `bank_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Iban`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.SortCode`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Zengin`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Iban`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.SortCode`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Zengin` + * Add support for `account_holder_name` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Spei` and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Spei` + * Add support for `subscribe` on enum `stripe.PaymentLink.ModifyParams.submit_type` + +## 11.3.0b2 - 2024-11-07 +* [#1421](https://github.com/stripe/stripe-python/pull/1421) Update generated code for beta + * Add support for `card_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardFeatures` + * Add support for `card_spend_dispute_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardFeatures` + * Add support for `cardholder_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardFeatures` + * Add support for `spend_control_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardFeatures` + * Add support for `disable_stripe_user_authentication` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardsListFeatures` + * Add support for `account_holder_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Aba`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Swift`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Aba`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Swift` + * Add support for `account_holder_name` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Aba`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Swift`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Aba`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Swift` + * Add support for `account_type` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Aba`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Swift`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Aba`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Swift` + * Add support for `bank_address` on resource classes `stripe.FundingInstructions.BankTransfer.FinancialAddress.Aba`, `stripe.FundingInstructions.BankTransfer.FinancialAddress.Swift`, `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Aba`, and `stripe.PaymentIntent.NextAction.DisplayBankTransferInstructions.FinancialAddress.Swift` + * Add support for `payment_record` on parameter class `stripe.Invoice.AttachPaymentParams` and resource class `stripe.InvoicePayment.Payment` + * Add support for `amount_overpaid` on resources `stripe.Invoice` and `stripe.QuotePreviewInvoice` + * Add support for resource `stripe.PaymentAttemptRecord` + * Add support for `submit_type` on parameter class `stripe.PaymentLink.ModifyParams` + * Add support for resource `stripe.PaymentRecord` + * Add support for `adaptive_pricing` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` + * Add support for `mandate_options` on parameter classes `stripe.checkout.Session.CreateParamsPaymentMethodOptionsBacsDebit` and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSepaDebit` and resource classes `stripe.checkout.Session.PaymentMethodOptions.BacsDebit` and `stripe.checkout.Session.PaymentMethodOptions.SepaDebit` + * Add support for `request_decremental_authorization` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `request_extended_authorization` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `request_incremental_authorization` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `request_multicapture` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `request_overcapture` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptionsCard` and resource class `stripe.checkout.Session.PaymentMethodOptions.Card` + * Add support for `capture_method` on parameter classes `stripe.checkout.Session.CreateParamsPaymentMethodOptionsKakaoPay`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsKrCard`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsNaverPay`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsPayco`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSamsungPay` + * Add support for `merchant_amount` on parameter class `stripe.issuing.Authorization.CreateParams` + * Add support for `merchant_currency` on parameter class `stripe.issuing.Authorization.CreateParams` + * Add support for resource `stripe.issuing.FraudLiabilityDebit` + * Remove support for `money_movement` on parameter class `stripe.AccountSession.CreateParamsComponentsFinancialAccountFeatures` + * Remove support for `out_of_band_payment` on parameter class `stripe.Invoice.AttachPaymentParams` and resource class `stripe.InvoicePayment.Payment` + * Change type of `disabled_reason` on `stripe.Account.FutureRequirements` and `stripe.Account.Requirements` from `str` to `Literal['action_required.requested_capabilities', 'listed', 'other', 'platform_paused', 'rejected.fraud', 'rejected.incomplete_verification', 'rejected.listed', 'rejected.other', 'rejected.platform_fraud', 'rejected.platform_other', 'rejected.platform_terms_of_service', 'rejected.terms_of_service', 'requirements.past_due', 'requirements.pending_verification', 'under_review']` + * Change type of `disable_stripe_user_authentication` on `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` from `Optional[bool]` to `bool` + * Add support for `li_vat` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `invoice.payment_attempt_required` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_fraud_liability_debit.created` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `custom` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `service_tax` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `payment_record` on enum `stripe.InvoicePayment.Payment.type` + * Add support for `link` on enums `stripe.PaymentIntent.PaymentMethodOptions.Card.network`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.PaymentMethodOptions.Card.network`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsCard.network`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsCard.network`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.Card.network`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCard.network`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCard.network` + * Change type of `amount` on `stripe.issuing.Authorization.CreateParams` from `int` to `NotRequired[int]` + * Change type of `origin_payment_method` on `stripe.treasury.InboundTransfer` from `str` to `Optional[str]` + +## 11.3.0b1 - 2024-10-29 +* [#1417](https://github.com/stripe/stripe-python/pull/1417) Update generated code for beta + * Add support for `id_bank_transfer_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `bank_bca_onboarding` on parameter class `stripe.Account.CreateParamsSettings` and resource class `stripe.Account.Settings` + * Add support for `send_money` on parameter class `stripe.AccountSession.CreateParamsComponentsRecipientsFeatures` + * Add support for `id_bank_transfer` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Invoice.PaymentSettings.PaymentMethodOptions`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.QuotePreviewInvoice.PaymentSettings.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, `stripe.SetupAttempt.PaymentMethodDetails`, and `stripe.Subscription.PaymentSettings.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptions`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptions`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptions`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `_cls_trigger_action` on resource `stripe.PaymentIntent` + * Add support for `trigger_action` on resource `stripe.PaymentIntent` + * Add support for `gopay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `qris` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `shopeepay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `id_bank_transfer` on enums `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, `stripe.SetupIntent.ModifyParamsPaymentMethodData.type`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Change type of `enhanced_eligibility_types` on `stripe.Dispute` from `Optional[List[Literal['visa_compelling_evidence_3']]]` to `List[Literal['visa_compelling_evidence_3']]` + * Change type of `enhanced_evidence` on `stripe.Dispute.Evidence` from `Optional[EnhancedEvidence]` to `EnhancedEvidence` + * Change type of `enhanced_eligibility` on `stripe.Dispute.EvidenceDetails` from `Optional[EnhancedEligibility]` to `EnhancedEligibility` + * Remove support for `payout_statement_descriptor_profanity` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 11.2.0 - 2024-10-29 * [#1411](https://github.com/stripe/stripe-python/pull/1411) This release changes the pinned API version to `2024-10-28.acacia`. * Add support for resource `stripe.v2.EventDestinations` @@ -382,6 +760,87 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` * Add support for `2024-10-28.acacia` on enum `stripe.WebhookEndpoint.CreateParams.api_version` +## 11.2.0b3 - 2024-10-18 +* [#1413](https://github.com/stripe/stripe-python/pull/1413) Update generated code for beta + * Add support for `alma_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `gopay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `kakao_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `kr_card_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `naver_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `payco_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `qris_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `samsung_pay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `shopeepay_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `treasury_evolve` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `treasury_fifth_third` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `treasury_goldman_sachs` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `alma` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.Refund.DestinationDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `gopay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `qris` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `shopeepay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `amazon_pay` on resource `stripe.PaymentMethodDomain` + * Add support for `schedule_at_period_end` on parameter classes `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` and `stripe.billing_portal.Configuration.ModifyParamsFeaturesSubscriptionUpdate` and resource class `stripe.billing_portal.Configuration.Features.SubscriptionUpdate` + * Add support for `metadata` on parameter class `stripe.forwarding.Request.CreateParams` + * Add support for `external_reference` on parameter class `stripe.tax.Form.ListParamsPayee` and resource class `stripe.tax.Form.Payee` + * Add support for `au_serr` on resource `stripe.tax.Form` + * Add support for `ca_mrdp` on resource `stripe.tax.Form` + * Add support for `eu_dac7` on resource `stripe.tax.Form` + * Add support for `gb_mrdp` on resource `stripe.tax.Form` + * Add support for `nz_mrdp` on resource `stripe.tax.Form` + * Add support for `pln` on parameter classes `stripe.terminal.Configuration.CreateParamsTipping` and `stripe.terminal.Configuration.ModifyParamsTipping` and resource class `stripe.terminal.Configuration.Tipping` + * Add support for `bank` on parameter classes `stripe.treasury.FinancialAccount.CreateParamsFeaturesFinancialAddressesAba`, `stripe.treasury.FinancialAccount.ModifyParamsFeaturesFinancialAddressesAba`, and `stripe.treasury.FinancialAccount.UpdateFeaturesParamsFinancialAddressesAba` and resource class `stripe.treasury.FinancialAccountFeatures.FinancialAddresses.Aba` + * Change type of `business_profile` on `stripe.billing_portal.Configuration.CreateParams` from `Configuration.CreateParamsBusinessProfile` to `NotRequired[Configuration.CreateParamsBusinessProfile]` + * Add support for `alma` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `gopay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `qris` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `shopeepay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, `stripe.PaymentLink.ModifyParams.payment_method_types`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `auto` on enum `stripe.Customer.ModifyParamsTax.validate_location` + * Add support for `jp_credit_transfer` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `kakao_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `kr_card` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `naver_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `payco` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` + * Add support for `au_serr` on enums `stripe.tax.Form.type` and `stripe.tax.Form.ListParams.type` + * Add support for `ca_mrdp` on enums `stripe.tax.Form.type` and `stripe.tax.Form.ListParams.type` + * Add support for `eu_dac7` on enums `stripe.tax.Form.type` and `stripe.tax.Form.ListParams.type` + * Add support for `gb_mrdp` on enums `stripe.tax.Form.type` and `stripe.tax.Form.ListParams.type` + * Add support for `nz_mrdp` on enums `stripe.tax.Form.type` and `stripe.tax.Form.ListParams.type` + * Add support for `external_reference` on enums `stripe.tax.Form.Payee.type` and `stripe.tax.Form.ListParamsPayee.type` + * Remove support for `expired` on enums `stripe.issuing.Authorization.status` and `stripe.issuing.Authorization.ListParams.status` + +## 11.2.0b2 - 2024-10-08 +* [#1396](https://github.com/stripe/stripe-python/pull/1396) Update generated code for beta + * Add support for `groups` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` + * Add support for `disable_stripe_user_authentication` on resource classes `stripe.AccountSession.Components.AccountManagement.Features`, `stripe.AccountSession.Components.AccountOnboarding.Features`, `stripe.AccountSession.Components.Balances.Features`, `stripe.AccountSession.Components.NotificationBanner.Features`, and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsAccountManagementFeatures`, `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures`, `stripe.AccountSession.CreateParamsComponentsBalancesFeatures`, `stripe.AccountSession.CreateParamsComponentsFinancialAccountFeatures`, `stripe.AccountSession.CreateParamsComponentsNotificationBannerFeatures`, and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` + * Add support for `card_spend_dispute_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardsListFeatures` + * Add support for `spend_control_management` on parameter class `stripe.AccountSession.CreateParamsComponentsIssuingCardsListFeatures` + * Add support for `kakao_pay` and `kr_card` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.Mandate.PaymentMethodDetails`, `stripe.PaymentIntent.PaymentMethodOptions`, and `stripe.SetupAttempt.PaymentMethodDetails`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `naver_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `payco` and `samsung_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `line_items` on parameter classes `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsPaypal`, `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsPaypal`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypal`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsPaypal`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsPaypal` and resource classes `stripe.Order.Payment.Settings.PaymentMethodOptions.Paypal` and `stripe.PaymentIntent.PaymentMethodOptions.Paypal` + * Add support for `flat_amount` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` + * Add support for `rate_type` on resource `stripe.TaxRate` and resource class `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails` + * Add support for `metadata` on resource `stripe.forwarding.Request` + * Add support for `_cls_submit_card` on resource `stripe.issuing.Card` + * Add support for `submit_card` on resource `stripe.issuing.Card` + * Add support for `by`, `cr`, `ec`, `ma`, `md`, `rs`, `ru`, `tz`, and `uz` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` + * Add support for `by_tin`, `ma_vat`, `md_vat`, `tz_vat`, `uz_tin`, and `uz_vat` on enums `stripe.checkout.Session.CollectedInformation.TaxId.type`, `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `kakao_pay`, `kr_card`, `naver_pay`, `payco`, and `samsung_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `refund.failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `payout_statement_descriptor_profanity` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `retail_delivery_fee` on enums `stripe.Invoice.AddLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.Invoice.UpdateLinesParamsLineTaxAmountTaxRateData.tax_type`, `stripe.InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type`, `stripe.tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Calculation.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.CalculationLineItem.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetails.tax_type`, `stripe.TaxRate.tax_type`, `stripe.TaxRate.CreateParams.tax_type`, and `stripe.TaxRate.ModifyParams.tax_type` + * Add support for `expired` on enums `stripe.issuing.Authorization.status` and `stripe.issuing.Authorization.ListParams.status` + * Add support for `state_retail_delivery_fee` on enums `stripe.tax.Registration.CountryOptions.Us.type` and `stripe.tax.Registration.CreateParamsCountryOptionsUs.type` + +## 11.2.0b1 - 2024-10-03 +* [#1407](https://github.com/stripe/stripe-python/pull/1407) Updates beta branch with changes in master & update generated code + * Add support for `reporting_chart` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `total_pretax_credit_amounts` on resource `stripe.QuotePreviewInvoice` + * Add support for `allow_redisplay` on parameter class `stripe.terminal.Reader.CollectPaymentMethodParamsCollectConfig` + * Remove support for `from_schedule` on resource class `stripe.Quote.SubscriptionData` + * Move `raw_request` and related methods from `_raw_request` module to the `StripeClient` class + * Remove `_preview` module; use raw request methods in the `StripeClient` class instead + ## 11.1.1 - 2024-10-18 * [#1414](https://github.com/stripe/stripe-python/pull/1414) Deserialize into correct v2 EventData types * Fixes a bug where v2 EventData was not being deserialized into the appropriate type for `V1BillingMeterErrorReportTriggeredEvent` and `V1BillingMeterNoMeterFoundEvent` @@ -427,6 +886,14 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `default_allowed_updates` on `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` from `Union[Literal[''], List[Literal['price', 'promotion_code', 'quantity']]]` to `NotRequired[Literal['']|List[Literal['price', 'promotion_code', 'quantity']]]` * Change type of `products` on `stripe.billing_portal.Configuration.CreateParamsFeaturesSubscriptionUpdate` from `Union[Literal[''], List[Configuration.CreateParamsFeaturesSubscriptionUpdateProduct]]` to `NotRequired[Literal['']|List[Configuration.CreateParamsFeaturesSubscriptionUpdateProduct]]` +## 10.13.0b1 - 2024-09-18 +* [#1395](https://github.com/stripe/stripe-python/pull/1395) Update generated code for beta + * Add support for `send_money` on parameter class `stripe.AccountSession.CreateParamsComponentsFinancialAccountFeatures` + * Add support for `transfer_balance` on parameter class `stripe.AccountSession.CreateParamsComponentsFinancialAccountFeatures` + * Add support for `automatically_finalizes_at` on resource `stripe.QuotePreviewInvoice` + * Remove support for resource `stripe.QuotePhase` + * Add support for `rechnung` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + * Add support for `terminal_reader_invalid_location_for_activation` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` ## 10.12.0 - 2024-09-18 * [#1394](https://github.com/stripe/stripe-python/pull/1394) Update generated code @@ -440,6 +907,19 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `amazon_pay` on enum `stripe.Dispute.PaymentMethodDetails.type` * Add support for `terminal_reader_invalid_location_for_activation` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +## 10.12.0b1 - 2024-09-13 +* [#1389](https://github.com/stripe/stripe-python/pull/1389) Update generated code for beta + * Add support for `template` on resource class `stripe.QuotePreviewInvoice.Rendering` + * Add support for resource `stripe.issuing.DisputeSettlementDetail` + * Add support for resource `stripe.issuing.Settlement` + * Add support for `settlement` on parameter class `stripe.issuing.Transaction.ListParams` and resource `stripe.issuing.Transaction` + * Remove support for `list` on resource `stripe.QuotePhase` + * Add support for `rechnung` on enum `stripe.checkout.Session.CreateParams.payment_method_types` + * Add support for `issuing_dispute_settlement_detail.created` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_dispute_settlement_detail.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_settlement.created` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `issuing_settlement.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + ## 10.11.0 - 2024-09-12 * [#1391](https://github.com/stripe/stripe-python/pull/1391) Update generated code * Add support for `template` on parameter classes `stripe.Customer.CreateParamsInvoiceSettingsRenderingOptions`, `stripe.Customer.ModifyParamsInvoiceSettingsRenderingOptions`, `stripe.Invoice.CreateParamsRendering`, and `stripe.Invoice.ModifyParamsRendering` and resource classes `stripe.Customer.InvoiceSettings.RenderingOptions` and `stripe.Invoice.Rendering` @@ -450,6 +930,25 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `tax_rates` on `stripe.InvoiceLineItem` from `Optional[List[TaxRate]]` to `List[TaxRate]` * Change type of `status_details` on `stripe.test_helpers.TestClock` from `Optional[StatusDetails]` to `StatusDetails` +## 10.11.0b1 - 2024-09-05 +* [#1387](https://github.com/stripe/stripe-python/pull/1387) Update generated code for beta + * Add support for `recipients` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for resource `stripe.billing.MeterErrorReport` + * Add support for `business_name` on resource class `stripe.checkout.Session.CollectedInformation` + * Add support for `tax_ids` on resource class `stripe.checkout.Session.CollectedInformation` + * Add support for `billing.meter_error_report.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `mb_way` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` +* [#1386](https://github.com/stripe/stripe-python/pull/1386) Merge from master +* [#1384](https://github.com/stripe/stripe-python/pull/1384) Merge from master after the changes to not pass api_mode from individual methods +* [#1380](https://github.com/stripe/stripe-python/pull/1380) Update generated code for beta + * Add support for `email` on resource class `stripe.checkout.Session.CollectedInformation` + * Add support for `phone` on resource class `stripe.checkout.Session.CollectedInformation` + * Add support for `regulatory_reporting_file` on parameter classes `stripe.issuing.CreditUnderwritingRecord.CorrectParams`, `stripe.issuing.CreditUnderwritingRecord.CreateFromProactiveReviewParams`, and `stripe.issuing.CreditUnderwritingRecord.ReportDecisionParams` and resource `stripe.issuing.CreditUnderwritingRecord` + * Add support for resource `stripe.terminal.ReaderCollectedData` + * Remove support for `rechnung` on parameter class `stripe.PaymentMethod.ModifyParams` + * Add support for `mb_way` on enum `stripe.checkout.Session.CreateParams.payment_method_types` + * Add support for `terminal_reader_collected_data_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 10.10.0 - 2024-09-05 * [#1376](https://github.com/stripe/stripe-python/pull/1376) Update generated code * Add support for `subscription` on parameter class `stripe.billing.Alert.CreateParamsFilter` @@ -462,6 +961,25 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `hr_oib` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `issuing_regulatory_reporting` on enums `stripe.File.purpose`, `stripe.File.CreateParams.purpose`, and `stripe.File.ListParams.purpose` +## 10.9.0b2 - 2024-08-22 +* [#1377](https://github.com/stripe/stripe-python/pull/1377) Update generated code for beta + * Add support for `mb_way_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `mb_way` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Remove support for `phases` on parameter classes `stripe.Quote.CreateParams` and `stripe.Quote.ModifyParams` + * Remove support for `from_schedule` on parameter class `stripe.Quote.CreateParamsSubscriptionData` + * Add support for `mb_way` on enums `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `hr_oib` on enums `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + * Remove support for `accepted` on enum `stripe.Dispute.EvidenceDetails.EnhancedEligibility.VisaCompellingEvidence3.status` + * Remove support for `partner_rejected` on enum `stripe.Dispute.EvidenceDetails.EnhancedEligibility.VisaCompellingEvidence3.status` + * Remove support for `submitted` on enum `stripe.Dispute.EvidenceDetails.EnhancedEligibility.VisaCompellingEvidence3.status` + +## 10.9.0b1 - 2024-08-15 +* [#1375](https://github.com/stripe/stripe-python/pull/1375) Update generated code for beta + * Add support for `capital_financing` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `permissions` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` + * Add support for `collected_information` on parameter class `stripe.checkout.Session.ModifyParams` and resource `stripe.checkout.Session` + * Add support for `shipping_options` on parameter class `stripe.checkout.Session.ModifyParams` + ## 10.8.0 - 2024-08-15 * [#1373](https://github.com/stripe/stripe-python/pull/1373) Update generated code * Add support for `authorization_code` on resource class `stripe.Charge.PaymentMethodDetails.Card` @@ -471,6 +989,15 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `chips` on resource classes `stripe.treasury.OutboundPayment.TrackingDetails.UsDomesticWire` and `stripe.treasury.OutboundTransfer.TrackingDetails.UsDomesticWire` and parameter classes `stripe.treasury.OutboundPayment.UpdateParamsTrackingDetailsUsDomesticWire` and `stripe.treasury.OutboundTransfer.UpdateParamsTrackingDetailsUsDomesticWire` * Change type of `imad` on `stripe.treasury.OutboundPayment.TrackingDetails.UsDomesticWire` and `stripe.treasury.OutboundTransfer.TrackingDetails.UsDomesticWire` from `str` to `Optional[str]` +## 10.8.0b1 - 2024-08-12 +* [#1372](https://github.com/stripe/stripe-python/pull/1372) Update generated code for beta + * Add support for `capital_financing` on resource class `stripe.AccountSession.Components` + * Add support for `payto` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptions` and resource class `stripe.checkout.Session.PaymentMethodOptions` + * ⚠️ Remove support for `risk_correlation_id` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRechnung`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRechnung`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRechnung` and resource class `stripe.PaymentIntent.PaymentMethodOptions.Rechnung` + * Add support for `custom` on enums `stripe.checkout.Session.ui_mode` and `stripe.checkout.Session.CreateParams.ui_mode` + * Add support for `payto` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` + * Add support for `invalid_mandate_reference_prefix_format` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + ## 10.7.0 - 2024-08-08 * [#1371](https://github.com/stripe/stripe-python/pull/1371) Update generated code * Add support for `type` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent.Offline`, `stripe.ConfirmationToken.PaymentMethodPreview.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, `stripe.PaymentMethod.Card.GeneratedFrom.PaymentMethodDetails.CardPresent.Offline`, and `stripe.SetupAttempt.PaymentMethodDetails.CardPresent.Offline` @@ -492,6 +1019,20 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `interval` on `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCardInstallmentsPlan` from `Literal['month']` to `NotRequired[Literal['month']]` * Change type of `account` on `stripe.Person.AdditionalTosAcceptances` from `Account` to `Optional[Account]` +## 10.7.0b1 - 2024-08-01 +* [#1370](https://github.com/stripe/stripe-python/pull/1370) Update generated code for beta + * Add support for `app_install` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `app_viewport` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `_cls_attach_payment` on resource `stripe.Invoice` + * Add support for `attach_payment` on resource `stripe.Invoice` + * Add support for `lines_invalid` on resource class `stripe.Quote.StatusDetails.Stale.LastReason` + * Add support for `last_price_migration_error` on resources `stripe.QuotePreviewSubscriptionSchedule`, `stripe.Subscription`, and `stripe.SubscriptionSchedule` + * Remove support for `partner_rejected_details` on resource class `stripe.Dispute.EvidenceDetails.EnhancedEligibility.VisaCompellingEvidence3` + * Add support for `customer.subscription.price_migration_failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `subscription_schedule.price_migration_failed` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `lines_invalid` on enum `stripe.Quote.StatusDetails.Stale.LastReason.type` + * Add support for `charge_exceeds_transaction_limit` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + ## 10.6.0 - 2024-08-01 * [#1369](https://github.com/stripe/stripe-python/pull/1369) Update generated code * Add support for resource `stripe.billing.Alert` @@ -499,6 +1040,23 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `billing.alert.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `charge_exceeds_transaction_limit` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +## 10.6.0b1 - 2024-07-25 +* [#1361](https://github.com/stripe/stripe-python/pull/1361) Update generated code for beta + * Add support for `capital` on parameter class `stripe.Account.CreateParamsSettings` and resource class `stripe.Account.Settings` + * Add support for `payment` on resource `stripe.InvoicePayment` + * Add support for `async_workflows` on parameter classes `stripe.PaymentIntent.CaptureParams`, `stripe.PaymentIntent.ConfirmParams`, `stripe.PaymentIntent.CreateParams`, `stripe.PaymentIntent.DecrementAuthorizationParams`, `stripe.PaymentIntent.IncrementAuthorizationParams`, and `stripe.PaymentIntent.ModifyParams` and resource `stripe.PaymentIntent` + * Add support for `payto` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for resource `stripe.billing.Alert` + * Add support for resource `stripe.tax.Association` + * Add support for `display_name` on parameter classes `stripe.treasury.FinancialAccount.CreateParams` and `stripe.treasury.FinancialAccount.ModifyParams` and resource `stripe.treasury.FinancialAccount` + * Remove support for `charge` on resource `stripe.InvoicePayment` + * Remove support for `payment_intent` on resource `stripe.InvoicePayment` + * Add support for `issuing.account_closed_for_not_providing_business_model_clarification` on enum `stripe.AccountNotice.reason` + * Add support for `issuing.account_closed_for_not_providing_url_clarification` on enum `stripe.AccountNotice.reason` + * Add support for `issuing.account_closed_for_not_providing_use_case_clarification` on enum `stripe.AccountNotice.reason` + * Add support for `billing.alert.triggered` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` + * Add support for `multibanco` on enum `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types` + ## 10.5.0 - 2024-07-25 * [#1368](https://github.com/stripe/stripe-python/pull/1368) Update generated code * Add support for `tax_registrations` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` @@ -523,6 +1081,16 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `stripe_s700` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` * [#1360](https://github.com/stripe/stripe-python/pull/1360) Update changelog +## 10.4.0b1 - 2024-07-11 +* [#1356](https://github.com/stripe/stripe-python/pull/1356) Update generated code for beta + * Change type of `payment_element` on `stripe.CustomerSession.Components` from `Optional[PaymentElement]` to `PaymentElement` + * Add support for `not_qualified` on enum `stripe.Dispute.EvidenceDetails.EnhancedEligibility.VisaCompellingEvidence3.status` + * Remove support for `billing_policy_remote_function_response_invalid` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + * Remove support for `billing_policy_remote_function_timeout` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + * Remove support for `billing_policy_remote_function_unexpected_status_code` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + * Remove support for `billing_policy_remote_function_unreachable` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + * Remove support for `payment_intent_fx_quote_invalid` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + ## 10.3.0 - 2024-07-11 * [#1358](https://github.com/stripe/stripe-python/pull/1358) Update generated code * Add support for `payment_method_options` on resource `stripe.ConfirmationToken` @@ -533,12 +1101,28 @@ This release changes the pinned API version to `2025-04-30.basil`. * ⚠️ Remove support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code`. The property was mistakenly released last week. * [#1357](https://github.com/stripe/stripe-python/pull/1357) don't auto-organize imports +## 10.3.0b1 - 2024-07-05 +* [#1355](https://github.com/stripe/stripe-python/pull/1355) Update generated code for beta + * ⚠️ Remove support for `payment_method_update` on resource class `stripe.CustomerSession.Components.PaymentElement.Features` and parameter class `stripe.CustomerSession.CreateParamsComponentsPaymentElementFeatures`. Users are expected to completely migrate from using payment_method_update. + * Add support for `payment_method_allow_redisplay_filters`, `payment_method_redisplay`, `payment_method_save_usage` on resource class `stripe.CustomerSession.Components.PaymentElement.Features` and parameter class `stripe.CustomerSession.CreateParamsComponentsPaymentElementFeatures` + * Add support for `institution` on parameter classes `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters`, and `stripe.financial_connections.Session.CreateParamsFilters` and resource classes `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, `stripe.QuotePreviewInvoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, `stripe.SetupIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters`, and `stripe.financial_connections.Session.Filters` + * Add support for resource `stripe.financial_connections.Institution` + * Add support for `balance` on enums `stripe.financial_connections.Account.subscriptions`, `stripe.financial_connections.Account.SubscribeParams.features`, and `stripe.financial_connections.Account.UnsubscribeParams.features` + * Add support for `financial_connections_institution_unavailable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `payment_intent_fx_quote_invalid` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + ## 10.2.0 - 2024-07-05 * [#1354](https://github.com/stripe/stripe-python/pull/1354) Update generated code * Add support for `_cls_add_lines`, `_cls_remove_lines`, `_cls_update_lines`, `add_lines`, `remove_lines`, `update_lines` on resource `stripe.Invoice` * Add support for `posted_at` on parameter class `stripe.tax.Transaction.CreateFromCalculationParams` and resource `stripe.tax.Transaction` * Add support for `payment_intent_fx_quote_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +## 10.2.0b1 - 2024-06-27 +* [#1349](https://github.com/stripe/stripe-python/pull/1349) Update generated code for beta + * Add support for `filters` on resource class `stripe.QuotePreviewInvoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections` + * Remove support for `payment_method_set_as_default` on resource class `stripe.CustomerSession.Components.PaymentElement.Features` and parameter class `stripe.CustomerSession.CreateParamsComponentsPaymentElementFeatures` + * Add support for `ch_uid` on enums `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + ## 10.1.0 - 2024-06-27 * [#1353](https://github.com/stripe/stripe-python/pull/1353) Update generated code * Add support for `email_type` on parameter classes `stripe.CreditNote.CreateParams`, `stripe.CreditNote.PreviewLinesParams`, and `stripe.CreditNote.PreviewParams` @@ -580,6 +1164,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `tax_id_collection` on parameter class `stripe.PaymentLink.ModifyParams` * Add support for `mobilepay` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` +## 9.12.0b1 - 2024-06-13 +* [#1343](https://github.com/stripe/stripe-python/pull/1343) Update generated code for beta + * Add support for `de_stn` on enums `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, and `stripe.QuotePreviewInvoice.CustomerTaxId.type` + ## 9.11.0 - 2024-06-13 * [#1342](https://github.com/stripe/stripe-python/pull/1342) Update generated code * Add support for `multibanco_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` @@ -592,11 +1180,21 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `multibanco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` * Add support for `twint` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` +## 9.11.0b1 - 2024-06-06 +* [#1339](https://github.com/stripe/stripe-python/pull/1339) Update generated code for beta + * Add support for `twint` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions` and resource class `stripe.PaymentIntent.PaymentMethodOptions` + * Add support for `swish` on enum `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types` + ## 9.10.0 - 2024-06-06 * [#1340](https://github.com/stripe/stripe-python/pull/1340) Update generated code * Add support for `gb_bank_transfer_payments`, `jp_bank_transfer_payments`, `mx_bank_transfer_payments`, `sepa_bank_transfer_payments`, `us_bank_transfer_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` * Add support for `swish` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` +## 9.10.0b1 - 2024-05-30 +* [#1334](https://github.com/stripe/stripe-python/pull/1334) Update generated code for beta + * Add support for `en-RO` on enums `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarna.preferred_locale` and `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna.preferred_locale` + * Add support for `ro-RO` on enums `stripe.Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarna.preferred_locale` and `stripe.Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna.preferred_locale` + ## 9.9.0 - 2024-05-30 * [#1335](https://github.com/stripe/stripe-python/pull/1335) Add method to list invoice line items * Add methods `list_lines()` and `list_lines_async()` on the class `Invoice` to list the invoice line items @@ -612,12 +1210,22 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `ro-RO` on enums `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna.preferred_locale`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsKlarna.preferred_locale`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna.preferred_locale` * Change type of `features` on `stripe.issuing.PhysicalBundle` from `Optional[Features]` to `Features` +## 9.9.0b1 - 2024-05-23 +* [#1331](https://github.com/stripe/stripe-python/pull/1331) Update generated code for beta + * Change type of `refund` on `stripe.CreditNote.CreateParamsRefund`, `stripe.CreditNote.PreviewParamsRefund`, and `stripe.CreditNote.PreviewLinesParamsRefund` from `str` to `NotRequired[str]` + * Add support for `terminal_reader_invalid_location_for_payment` on enum `stripe.QuotePreviewInvoice.LastFinalizationError.code` + ## 9.8.0 - 2024-05-23 * [#1332](https://github.com/stripe/stripe-python/pull/1332) Update generated code * Add support for `external_account_collection` on resource classes `stripe.AccountSession.Components.Balances.Features` and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsBalancesFeatures` and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` * Add support for `payment_method_remove` on resource class `stripe.checkout.Session.SavedPaymentMethodOptions` * Add support for `terminal_reader_invalid_location_for_payment` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` +## 9.8.0b1 - 2024-05-16 +* [#1327](https://github.com/stripe/stripe-python/pull/1327) Update generated code for beta + +* [#1330](https://github.com/stripe/stripe-python/pull/1330) (beta) swap from `black` to `ruff` for formatting + ## 9.7.0 - 2024-05-16 * [#1328](https://github.com/stripe/stripe-python/pull/1328) Update generated code * Add support for `fee_source` on resource `stripe.ApplicationFee` @@ -636,6 +1244,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `countries` on `stripe.financial_connections.Session.CreateParamsFilters` from `List[str]` to `NotRequired[List[str]]` * [#1329](https://github.com/stripe/stripe-python/pull/1329) Switch from `black` to `ruff` for formatting +## 9.7.0b1 - 2024-05-09 +* [#1321](https://github.com/stripe/stripe-python/pull/1321) Update generated code for beta + * No new beta features. Merging changes from the main branch. + ## 9.6.0 - 2024-05-09 * [#1323](https://github.com/stripe/stripe-python/pull/1323) Update generated code * Add support for `allow_redisplay` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` and resource `stripe.PaymentMethod` @@ -646,6 +1258,15 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `treasury.outbound_payment.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `treasury.outbound_transfer.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` +## 9.6.0b1 - 2024-05-02 +* [#1318](https://github.com/stripe/stripe-python/pull/1318) Update generated code for beta + * Add support for `rechnung_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` + * Add support for `rechnung` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` + * Add support for `multibanco` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptions` and resource class `stripe.checkout.Session.PaymentMethodOptions` + * Add support for `multibanco` on enum `stripe.checkout.Session.CreateParams.payment_method_types` + * Add support for `rechnung` on enums `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Change type of `transactions` on `stripe.gift_cards.Card` from `ListObject[Transaction]` to `Optional[ListObject[Transaction]]` + ## 9.5.0 - 2024-05-02 * [#1317](https://github.com/stripe/stripe-python/pull/1317) Update generated code * Add support for `paypal` on resource class `stripe.Dispute.PaymentMethodDetails` @@ -657,6 +1278,13 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `metadata` on `stripe.entitlements.Feature.ModifyParams` from `Dict[str, str]` to `Literal['']|Dict[str, str]` * [#1319](https://github.com/stripe/stripe-python/pull/1319) Fix type change entries in Python Changelog +## 9.5.0b1 - 2024-04-25 +* [#1308](https://github.com/stripe/stripe-python/pull/1308) Update generated code for beta + * Add support for `payment_method_settings` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `cancel_subscription_schedule` on parameter classes `stripe.Quote.CreateParamsLine` and `stripe.Quote.ModifyParamsLine` and resource `stripe.QuoteLine` + * Add support for `amazon_pay` on enum `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types` + * Add support for `revolut_pay` on enum `stripe.QuotePreviewInvoice.PaymentSettings.payment_method_types` + ## 9.4.0 - 2024-04-25 * [#1316](https://github.com/stripe/stripe-python/pull/1316) Update generated code * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` @@ -672,6 +1300,26 @@ This release changes the pinned API version to `2025-04-30.basil`. * Remove support for inadvertently released identity verification features `email` and `phone` on parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions` * [#1307](https://github.com/stripe/stripe-python/pull/1307) Bump aiohttp from 3.9.2 to 3.9.4 +## 9.4.0b1 - 2024-04-18 +* [#1302](https://github.com/stripe/stripe-python/pull/1302) Update generated code for beta + * Add support for `balances` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `payouts_list` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `capital_overview` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `tax_registrations` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `tax_settings` on parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `external_account_collection` on parameter class `stripe.AccountSession.CreateParamsComponentsFinancialAccountFeatures` + * Add support for `allow_redisplay` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Customer.ListPaymentMethodsParams`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData` + * Add support for `subscription_trial_from_plan` on parameter classes `stripe.Invoice.UpcomingLinesParams` and `stripe.Invoice.UpcomingParams` + * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `payment_method_data` on parameter class `stripe.checkout.Session.CreateParams` + * Add support for `saved_payment_method_options` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` + * Add support for `mobilepay` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptions` and resource class `stripe.checkout.Session.PaymentMethodOptions` + * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request` + * Change type of fields `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` of `destination_on_behalf_of_charge_management` + * Change type of field `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` of `timestamp` + * Add support for `mobilepay` on enum `stripe.checkout.Session.CreateParams.payment_method_types` + * Add support for `other` on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` + ## 9.3.0 - 2024-04-18 * [#1305](https://github.com/stripe/stripe-python/pull/1305) Update generated code * Add support for `allow_redisplay` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Customer.ListPaymentMethodsParams`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData` @@ -697,6 +1345,28 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `timestamp` on `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` +## 9.2.0b1 - 2024-04-11 +* [#1296](https://github.com/stripe/stripe-python/pull/1296) Update generated code for beta + * Add support for `external_account_collection` on resource class `stripe.AccountSession.Components.AccountOnboarding.Features` and parameter class `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures` + * Add support for `account_management` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `notification_banner` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` + * Add support for `amazon_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, `stripe.SetupIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` + * Add support for `capture_method` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay` and resource class `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay` + * Change type of field `stripe.billing.MeterEventAdjustment` from `Cancel` to `Optional[Cancel]` of `cancel` + * Change type of field `stripe.billing.MeterEventAdjustment.Cancel` from `str` to `Optional[str]` of `identifier` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParamsCancel` from `str` to `NotRequired[str]` of `identifier` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `MeterEventAdjustment.CreateParamsCancel` to `NotRequired[MeterEventAdjustment.CreateParamsCancel]` of `cancel` + * Change type of field `stripe.billing.MeterEventAdjustment.CreateParams` from `NotRequired[Literal['cancel']]` to `Literal['cancel']` of `type` + * Add support for `bh_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `kz_bin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `ng_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `om_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.Order.TaxDetails.TaxId.type`, `stripe.Order.CreateParamsTaxDetailsTaxId.type`, `stripe.Order.ModifyParamsTaxDetailsTaxId.type`, `stripe.QuotePreviewInvoice.CustomerTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` + * Add support for `amazon_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` + * Add support for `billing_policy_remote_function_response_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_timeout` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_unexpected_status_code` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + * Add support for `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.QuotePreviewInvoice.LastFinalizationError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` + ## 9.1.0 - 2024-04-11 * [#1300](https://github.com/stripe/stripe-python/pull/1300) Update generated code * Add support for `external_account_collection` on resource class `stripe.AccountSession.Components.AccountOnboarding.Features` and parameter class `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures` @@ -772,9 +1442,6 @@ This release changes the pinned API version to `2025-04-30.basil`. * Remove the deprecated value `obligation` for `ReportRun.CreateParamsParameters.reporting_category` and `ReportRunService.CreateParamsParameters.reporting_category` * Remove the legacy field `rendering_options` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` and resource `stripe.Invoice`. Use `rendering` instead. - - - ## 8.11.0 - 2024-04-09 * [#1295](https://github.com/stripe/stripe-python/pull/1295) Update generated code * Add support for `fees`, `losses`, `requirement_collection` & `stripe_dashboard` on resource class `stripe.Account.Controller` @@ -790,6 +1457,37 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1299](https://github.com/stripe/stripe-python/pull/1299) Fix README.md * [#1292](https://github.com/stripe/stripe-python/pull/1292) Tweak changelog for python async note +## 8.11.0b1 - 2024-04-04 +* [#1293](https://github.com/stripe/stripe-python/pull/1293) Update generated code for beta + * Add support for `risk_controls` on parameter class `stripe.Account.CreateParams` and resource `stripe.Account` + * Add support for `promotion_code` on parameter classes `stripe.Invoice.AddLinesParamsLineDiscount`, `stripe.Invoice.CreateParamsDiscount`, `stripe.Invoice.ModifyParamsDiscount`, `stripe.Invoice.UpdateLinesParamsLineDiscount`, `stripe.InvoiceItem.CreateParamsDiscount`, `stripe.InvoiceItem.ModifyParamsDiscount`, `stripe.InvoiceLineItem.ModifyParamsDiscount`, `stripe.Quote.CreateParamsDiscount`, `stripe.Quote.CreateParamsLineActionAddDiscount`, `stripe.Quote.CreateParamsLineItemDiscount`, `stripe.Quote.CreateParamsPhaseLineItemDiscount`, `stripe.Quote.ModifyParamsDiscount`, `stripe.Quote.ModifyParamsLineActionAddDiscount`, `stripe.Quote.ModifyParamsLineItemDiscount`, and `stripe.Quote.ModifyParamsPhaseLineItemDiscount` + * Add support for `zip` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` + * Add support for `offline` on resource class `stripe.SetupAttempt.PaymentMethodDetails.CardPresent` + * Add support for `card_present` on parameter classes `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, and `stripe.SetupIntent.ModifyParamsPaymentMethodOptions` and resource class `stripe.SetupIntent.PaymentMethodOptions` + * Add support for `modify` on resource `stripe.entitlements.Feature` + * Add support for `email` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` + * Add support for `phone` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` + * Add support for `verification_flow` on resources `stripe.identity.VerificationReport` and `stripe.identity.VerificationSession` and parameter class `stripe.identity.VerificationSession.CreateParams` + * Add support for `provided_details` on parameter classes `stripe.identity.VerificationSession.CreateParams` and `stripe.identity.VerificationSession.ModifyParams` and resource `stripe.identity.VerificationSession` + * Add support for `allowed_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` + * Add support for `blocked_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` + * Change type of field `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSwish` from `Literal['']|str` to `str` of `reference` + * Add support for `verification_flow` on enums `stripe.identity.VerificationReport.type` and `stripe.identity.VerificationSession.type` + * Add support for `email_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `email_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `phone_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `phone_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` + * Add support for `mobile_phone_reader` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` + * Change type of field `stripe.identity.VerificationSession.CreateParams` from `Literal['document', 'id_number']` to `NotRequired[Literal['document', 'id_number']]` of `type` + * Change type of fields `stripe.Invoice`, `stripe.InvoiceLineItem`, `stripe.QuotePreviewInvoice`, `stripe.Subscription`, and `stripe.SubscriptionItem` from `Optional[List[ExpandableField[Discount]]]` to `List[ExpandableField[Discount]]` of `discounts` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `data` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_png` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` of `image_url_svg` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `hosted_instructions_url` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` of `mobile_auth_url` + * Change type of field `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` of `qr_code` + * Change type of fields `stripe.QuoteLine.Action.AddItem`, `stripe.QuoteLine.Action.SetItem`, `stripe.QuotePreviewSubscriptionSchedule.Phase.AddInvoiceItem`, `stripe.QuotePreviewSubscriptionSchedule.Phase.Item`, `stripe.QuotePreviewSubscriptionSchedule.Phase`, `stripe.SubscriptionSchedule.Phase.AddInvoiceItem`, `stripe.SubscriptionSchedule.Phase.Item`, and `stripe.SubscriptionSchedule.Phase` from `Optional[List[Discount]]` to `List[Discount]` of `discounts` + ## 8.10.0 - 2024-04-04 * [#1288](https://github.com/stripe/stripe-python/pull/1288) Port **async support** from beta to the stable channel. To use it, add an `_async` suffix to any request-making method. @@ -830,6 +1528,12 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type of `qr_code` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` * [#1289](https://github.com/stripe/stripe-python/pull/1289) Bump aiohttp from 3.9.0 to 3.9.2 +## 8.10.0b1 - 2024-03-28 +* [#1277](https://github.com/stripe/stripe-python/pull/1277) Update generated code for beta + * Add support for `financial_account_transactions`, `financial_account`, `issuing_card`, and `issuing_cards_list` on `AccountSession.CreateParamsComponents` and `AccountSessionService.CreateParamsComponents` + * Remove support for `subscription_billing_cycle_anchor`, `subscription_cancel_at_period_end`, `subscription_cancel_at`, `subscription_cancel_now`, `subscription_default_tax_rates`, `subscription_items`, `subscription_prebilling`, `subscription_proration_behavior`, `subscription_proration_date`, `subscription_resume_at`, `subscription_start_date`, and `subscription_trial_end` on `Invoice.CreatePreviewParams` and `InvoiceService.CreatePreviewParams` + +* [#1283](https://github.com/stripe/stripe-python/pull/1283) Fix unneccessary quotes ## 8.9.0 - 2024-03-28 * [#1276](https://github.com/stripe/stripe-python/pull/1276) Update generated code @@ -845,6 +1549,12 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1278](https://github.com/stripe/stripe-python/pull/1278) Types: remove unnecessary quotes * [#1279](https://github.com/stripe/stripe-python/pull/1279) Update README.md +## 8.9.0b1 - 2024-03-21 +* [#1272](https://github.com/stripe/stripe-python/pull/1272) Update generated code for beta + * Add support for new resources `Entitlements.ActiveEntitlementSummary` and `Entitlements.ActiveEntitlement` + * Add support for `list` method on resource `ActiveEntitlement` +* [#1271](https://github.com/stripe/stripe-python/pull/1271) Support AIOHTTPClient init without running event loop + ## 8.8.0 - 2024-03-21 * [#1273](https://github.com/stripe/stripe-python/pull/1273) Update generated code * Add support for new resources `ConfirmationToken` and `Forwarding.Request` @@ -861,7 +1571,14 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for new value `mobilepay` on enums `PaymentIntentService.ConfirmParamsPaymentMethodData.type`, `PaymentIntentService.CreateParamsPaymentMethodData.type`, `PaymentIntentService.UpdateParamsPaymentMethodData.type`, `SetupIntentService.ConfirmParamsPaymentMethodData.type`, `SetupIntentService.CreateParamsPaymentMethodData.type`, and `SetupIntentService.UpdateParamsPaymentMethodData.type` * Add support for new value `mobilepay` on enum `PaymentMethod.type` - +## 8.8.0b1 - 2024-03-14 +* [#1270](https://github.com/stripe/stripe-python/pull/1270) Update generated code for beta + * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter` + * Add support for `create`, `deactivate`, `list`, `modify`, `reactivate`, and `retrieve` methods on resource `Meter` + * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent` + * Add support for `create` test helper method on resource `ConfirmationToken` + * Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice` +* [#1266](https://github.com/stripe/stripe-python/pull/1266) Beta: record usage of async interface ## 8.7.0 - 2024-03-14 * [#1269](https://github.com/stripe/stripe-python/pull/1269) Update generated code @@ -871,6 +1588,9 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for resource `stripe.issuing.PhysicalBundle` * Change type from `float` to `Literal['']|float` of `application_fee_percent` on fields `stripe.Subscription.CreateParams`, `stripe.Subscription.ModifyParams`, `SubscriptionService.UpdateParams`, and `SubscriptionService.CreateParams` +## 8.7.0b1 - 2024-03-07 +* [#1265](https://github.com/stripe/stripe-python/pull/1265) Update generated code for beta + * Add support for new value `billing_period_end` on enums `Quote.CreateParamsLineEndsAt.type`, `QuoteLine.EndsAt.type`, and `Quote.ModifyParamsLineEndsAt.type` ## 8.6.0 - 2024-03-07 * [#1267](https://github.com/stripe/stripe-python/pull/1267) Update generated code @@ -880,6 +1600,12 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `sepa_debit` on `Invoice.PaymentSettings.PaymentMethodOptions`, `InvoiceCreateParams.PaymentSettings.PaymentMethodOptions`, and `InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions` * [#1268](https://github.com/stripe/stripe-python/pull/1268) Update README.md +## 8.6.0b1 - 2024-02-29 +* [#1251](https://github.com/stripe/stripe-python/pull/1251) Update generated code for beta + * Remove support for resource `Entitlements.Event` +* [#1264](https://github.com/stripe/stripe-python/pull/1264) Remove unconditional import of TCPConnector from aiohttp in _http_client +* [#1259](https://github.com/stripe/stripe-python/pull/1259) Add helper to add beta version + ## 8.5.0 - 2024-02-29 * [#1255](https://github.com/stripe/stripe-python/pull/1255) Update generated code * Change `identity.VerificationReport.type` to be required @@ -892,6 +1618,23 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1260](https://github.com/stripe/stripe-python/pull/1260) Update README to use add_beta_version * [#1250](https://github.com/stripe/stripe-python/pull/1250) Fix type of ErrorObject.code +## 8.5.0b3 - 2024-02-27 +* [#1262](https://github.com/stripe/stripe-python/pull/1262) Beta: fix ssl for AIOHTTP client + +## 8.5.0b2 - 2024-02-27 +* **Python async** - In this beta release, async support is now "feature complete". If you notice missing async support for something, it's probably a bug! Usage instructions for the async interface are available in the [README.md](https://github.com/stripe/stripe-python/blob/beta/README.md#async). + * [#1253](https://github.com/stripe/stripe-python/pull/1253) Beta: Support 'allow_sync_methods=False' in HTTPXClient + * [#1254](https://github.com/stripe/stripe-python/pull/1254) Beta: add AIOHTTP http client + * [#1247](https://github.com/stripe/stripe-python/pull/1247) Make `ListObject.auto_paging_iter()` implement `AsyncIterator` + +## 8.5.0b1 - 2024-02-22 +* [#1246](https://github.com/stripe/stripe-python/pull/1246) Update generated code for beta + +* [#1239](https://github.com/stripe/stripe-python/pull/1239) Beta: Collapse HTTPClientAsync into HTTPClient + * ⚠️ Removes the `stripe.default_http_client_async` global and the `stripe.HTTPClientAsync` class. + * To set your own async-enabled http client, set `stripe.default_http_client` to a subclass of `stripe.HTTPClient` such as `stripe.HTTPXClient` that implements `.request_async`, `.sleep_async`, `.request_stream_async`, and `.close_async`. + * The default http client of the library is still `RequestsClient` for synchronous methods, that "falls back" to a `HTTPXClient` when asynchronous methods are called. + ## 8.4.0 - 2024-02-22 * [#1241](https://github.com/stripe/stripe-python/pull/1241) Update generated code - Add `InvoiceLineItem.modify` method. @@ -901,6 +1644,13 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1243](https://github.com/stripe/stripe-python/pull/1243) Remove http client base * [#1242](https://github.com/stripe/stripe-python/pull/1242) Testing: unify http client mock +## 8.4.0b1 - 2024-02-16 +* [#1235](https://github.com/stripe/stripe-python/pull/1235) Update generated code for beta + * Add support for `payto` and `twint` payment methods throughout the API + * Add support for `decrement_authorization` method on resource `PaymentIntent` +* [#1236](https://github.com/stripe/stripe-python/pull/1236) Beta: StripeStreamResponseAsync.read helper +* [#1233](https://github.com/stripe/stripe-python/pull/1233) Beta: async streaming + ## 8.3.0 - 2024-02-15 * [#1230](https://github.com/stripe/stripe-python/pull/1230) Update generated code * Add support for `networks` on `Card`, `PaymentMethod.CreateParamsCard`, `PaymentMethod.ModifyParamsCard`, and `Token.CreateParamsCard` @@ -913,6 +1663,11 @@ This release changes the pinned API version to `2025-04-30.basil`. * Bugfix: remove support for `CreditNoteLineItem.list`, `CustomerCashBalanceTransaction.list`, and `CustomerCashBalanceTransaction.retrieve`. These methods were included in the library unintentionally and never functioned. * [#1232](https://github.com/stripe/stripe-python/pull/1232) Improve types in _http_client.py +## 8.3.0b1 - 2024-02-08 +* [#1226](https://github.com/stripe/stripe-python/pull/1226) Update generated code for beta + * Add support for `payment_method_options` on `ConfirmationToken` +* [#1228](https://github.com/stripe/stripe-python/pull/1228) Beta: add `_async` methods for StripeClient + ## 8.2.0 - 2024-02-08 * [#1225](https://github.com/stripe/stripe-python/pull/1225) Update generated code * Add support for `invoices` on `Account.Settings` @@ -923,6 +1678,17 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1223](https://github.com/stripe/stripe-python/pull/1223) Move StripeClient usage collection onto StripeService * [#1220](https://github.com/stripe/stripe-python/pull/1220) Measure StripeClient usage +## 8.2.0b1 - 2024-02-05 +* [#1218](https://github.com/stripe/stripe-python/pull/1218) Update generated code for beta + * Add support for new resources `Entitlements.Event` and `Entitlements.Feature` + * Add support for `create` method on resource `Event` + * Add support for `create` and `list` methods on resource `Feature` +* [#1171](https://github.com/stripe/stripe-python/pull/1171) Beta: codegenned async methods on resources +* [#1219](https://github.com/stripe/stripe-python/pull/1219) Beta: more async infrastructure +* [#1210](https://github.com/stripe/stripe-python/pull/1210) Beta: better support for trio in HTTPClientAsync + * Fixes support for `trio` on HttpClientAsync. +* [#1209](https://github.com/stripe/stripe-python/pull/1209) Beta: Fix HTTPXClient retries + ## 8.1.0 - 2024-02-01 * [#1213](https://github.com/stripe/stripe-python/pull/1213) Update generated code * Add support for `swish` payment method throughout the API @@ -930,6 +1696,11 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `jurisdiction_level` on resource `TaxRate` * Change type from `str` to `Literal["offline", "online"]` of `status` on field `terminal.Reader` +## 8.1.0b1 - 2024-01-25 +* [#1198](https://github.com/stripe/stripe-python/pull/1198) Update generated code for beta + * Add support for `create_preview` method on resource `Invoice` +* [#1211](https://github.com/stripe/stripe-python/pull/1211) Merge master into beta + ## 8.0.0 - 2024-01-25 * [#1206](https://github.com/stripe/stripe-python/pull/1206) stripe-python v8 release This release introduces `StripeClient` and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern: @@ -988,6 +1759,14 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `promotion_code` on `Invoice.UpcomingLinesParams.discounts[]`, `Invoice.UpcomingLinesParams.invoice_items[].discounts[]`, `Invoice.UpcomingParams.discounts[]`, and `Invoice.UpcomingParams.invoice_items[].discounts[]` * Add support for `account_type` on `PaymentMethod.UpdateParams.us_bank_account` +## 7.14.0b1 - 2024-01-18 +* [#1197](https://github.com/stripe/stripe-python/pull/1197) Update generated code for beta + Release specs are identical. +* [#1192](https://github.com/stripe/stripe-python/pull/1192) Update generated code for beta + * Add support for new value `nn` on enum `ConfirmationToken.PaymentMethodPreview.Ideal.bank` + * Add support for new value `NNBANL2G` on enum `ConfirmationToken.PaymentMethodPreview.Ideal.bic` + * Change `Invoice.AutomaticTax.liability`, `Invoice.issuer`, and `Subscription.AutomaticTax.liability` to be required + ## 7.13.0 - 2024-01-18 * [#1193](https://github.com/stripe/stripe-python/pull/1193) Update generated code * Add support for providing details about `BankAccount`, `Card`, and `CardToken` on `Account.CreateExternalAccountParams.external_account` and `Account.CreateParams.external_account` @@ -1002,6 +1781,11 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `customer_balance` on `PaymentMethodConfiguration.CreateParams`, `PaymentMethodConfiguration.UpdateParams`, and `PaymentMethodConfiguration` * Add support for `invoice_settings` on `Subscription.CreateParams` and `Subscription.UpdateParams` +## 7.13.0b1 - 2024-01-12 +* [#1189](https://github.com/stripe/stripe-python/pull/1189) Update generated code for beta +* [#1191](https://github.com/stripe/stripe-python/pull/1191) Beta: report `raw_request` usage +* [#1165](https://github.com/stripe/stripe-python/pull/1165) Beta: raw_request_async with HTTPX + ## 7.12.0 - 2024-01-12 * [#1188](https://github.com/stripe/stripe-python/pull/1188) Update generated code * Add support for new resource `CustomerSession` @@ -1011,6 +1795,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * Remove support for value `obligation` from enum `Reporting.ReportRunCreateParams.parameters.reporting_category` * Add support for `billing_cycle_anchor_config` on `SubscriptionCreateParams` and `Subscription` +## 7.12.0b1 - 2024-01-04 +* [#1187](https://github.com/stripe/stripe-python/pull/1187) Update generated code for beta + * Updated stable APIs to the latest version + ## 7.11.0 - 2024-01-04 * [#1186](https://github.com/stripe/stripe-python/pull/1186) Update generated code * Add support for `retrieve` on resource `tax.Registration` @@ -1020,6 +1808,8 @@ This release changes the pinned API version to `2025-04-30.basil`. * Change type from `Optional[Features]` to `Features` of `features` on fields `AccountSession.Components.PaymentDetails`, `AccountSession.Components.Payments`, and `AccountSession.Components.Payouts` * Change type from `Optional[InvoiceSettings]` to `InvoiceSettings` of `invoice_settings` on field `SubscriptionSchedule.DefaultSettings` +## 7.11.0b1 - 2023-12-22 +* [#1177](https://github.com/stripe/stripe-python/pull/1177) Update generated code for beta ## 7.10.0 - 2023-12-22 * [#1176](https://github.com/stripe/stripe-python/pull/1176) Update generated code @@ -1045,6 +1835,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1184](https://github.com/stripe/stripe-python/pull/1184) Remove api_base from RequestOptions type * [#1178](https://github.com/stripe/stripe-python/pull/1178) Support accessing reserved word resource properties via attribute +## 7.10.0b1 - 2023-12-14 +* [#1166](https://github.com/stripe/stripe-python/pull/1166) Update generated code for beta +* [#1164](https://github.com/stripe/stripe-python/pull/1164) Beta: revert broken logger + ## 7.9.0 - 2023-12-14 * [#1161](https://github.com/stripe/stripe-python/pull/1161) Update generated code @@ -1056,6 +1850,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1101](https://github.com/stripe/stripe-python/pull/1101) Mark defunct and internal methods as deprecated * [#1169](https://github.com/stripe/stripe-python/pull/1169) Add more types to _http_client.py +## 7.9.0b1 - 2023-12-08 +* [#1163](https://github.com/stripe/stripe-python/pull/1163) Update generated code for beta + * Add support for `retrieve` method on resource `FinancialConnections.Transaction` + ## 7.8.2 - 2023-12-11 * [#1168](https://github.com/stripe/stripe-python/pull/1168) Do not raise a DeprecationWarning in `stripe.app_info` @@ -1105,6 +1903,9 @@ This release changes the pinned API version to `2025-04-30.basil`. stripe.APIError ``` +## 7.8.0b1 - 2023-11-30 +* [#1148](https://github.com/stripe/stripe-python/pull/1148) Update generated code for beta + ## 7.7.0 - 2023-11-30 * [#1147](https://github.com/stripe/stripe-python/pull/1147) Update generated code * Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier` @@ -1120,6 +1921,11 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for new values `climate.order.canceled`, `climate.order.created`, `climate.order.delayed`, `climate.order.delivered`, `climate.order.product_substituted`, `climate.product.created`, and `climate.product.pricing_updated` on enums `WebhookEndpoint.CreateParams.enabled_events[]` and `WebhookEndpoint.ModifyParams.enabled_events[]` * [#1145](https://github.com/stripe/stripe-python/pull/1145) Refactor integration test +## 7.7.0b1 - 2023-11-21 +* [#1141](https://github.com/stripe/stripe-python/pull/1141) Update generated code for beta +* Rename `receipient` to `recipient` beneath `PaymentDetails` on `Charge` and `PaymentIntent` APIs.* Add support for `electronic_commerce_indicator` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure` and `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure` +* Add support for `components` on parameter class `CustomerSession.CreateParams` and resource `CustomerSession` + ## 7.6.0 - 2023-11-21 * [#1138](https://github.com/stripe/stripe-python/pull/1138) Update generated code * Add support for `electronic_commerce_indicator` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure` and `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure` @@ -1133,6 +1939,15 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `requested_at` on resource class `issuing.Authorization.RequestHistory` * Add support for `authorization_code` on resource class `issuing.Transaction.NetworkData` +## 7.6.0b1 - 2023-11-16 +* [#1128](https://github.com/stripe/stripe-python/pull/1128) Update generated code for beta + * Add support for `issuing_card` and `issuing_cards_list` on `AccountSession.CreateParamsComponents` + * Add support for `event_details` and `subscription` on `payment_details` types + * Add support for `affiliate` and `delivery` on `payment_details.flight`, `payment_details.lodging`, and `payment_details.car_rental` types + * Add support for `drivers` on `payment_details.car_rental` types + * Add support for `passengers` on `payment_details.flight` and `payment_details.lodging` types + * Add support for `created` on `CustomerSession` + ## 7.5.0 - 2023-11-16 * [#1127](https://github.com/stripe/stripe-python/pull/1127) Update generated code * Add support for `bacs_debit_payments` on `Account.CreateParamsSettings` @@ -1151,12 +1966,19 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1125](https://github.com/stripe/stripe-python/pull/1125) Add support for Python 3.11/3.12 * [#1123](https://github.com/stripe/stripe-python/pull/1123) Move to python3 venv and update vscode settings +## 7.5.0b1 - 2023-11-10 +* [#1120](https://github.com/stripe/stripe-python/pull/1120) Update generated code for beta + ## 7.4.0 - 2023-11-09 * [#1119](https://github.com/stripe/stripe-python/pull/1119) Update generated code * Add support for new value `terminal_reader_hardware_fault` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` * Add support for `metadata` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, and `QuoteUpdateParams.subscription_data` * [#1121](https://github.com/stripe/stripe-python/pull/1121) [types] Remove `None` from optional param types +## 7.4.0b1 - 2023-11-02 +* [#1110](https://github.com/stripe/stripe-python/pull/1110) Update generated code for beta + * Add support for `attach_payment_intent` method on resource `Invoice` + ## 7.3.0 - 2023-11-02 * [#1112](https://github.com/stripe/stripe-python/pull/1112) Update generated code * Add support for new resource `Tax.Registration` @@ -1180,16 +2002,51 @@ This release changes the pinned API version to `2025-04-30.basil`. # Changelog + +## 7.2.0b1 - 2023-10-26 +* [#1107](https://github.com/stripe/stripe-python/pull/1107) Update generated code for beta + * Add support for new resource `Margin` + * Add support for `create`, `list`, `modify`, and `retrieve` methods on resource `Margin` + +## 7.1.0b1 - 2023-10-17 +* [#1084](https://github.com/stripe/stripe-python/pull/1084) Update generated code for beta + - Update pinned API version to `2023-10-16` +* [#1083](https://github.com/stripe/stripe-python/pull/1083) Update generated code for beta + ## 7.0.0 - 2023-10-16 * This release changes the pinned API version to `2023-10-16`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2023-10-16) and carefully review the API changes before upgrading `stripe-python`. * [#1085](https://github.com/stripe/stripe-python/pull/1085) Update generated code - Updated pinned API version +## 6.8.0b3 - 2023-10-13 + + +## 6.8.0b2 - 2023-10-11 +* [#1073](https://github.com/stripe/stripe-python/pull/1073) Update generated code for beta + Release specs are identical. +* [#1061](https://github.com/stripe/stripe-python/pull/1061) Types: inner resource classes + +## 6.8.0b1 - 2023-10-05 +* [#1066](https://github.com/stripe/stripe-python/pull/1066) Update generated code for beta + * Add support for `mark_draft` and `mark_stale` methods on resource `Quote` + * Remove support for `draft_quote` and `mark_stale_quote` methods on resource `Quote` + * Rename `preview_invoice_lines` to `list_preview_invoice_lines` on resource `Quote` +* [#1059](https://github.com/stripe/stripe-python/pull/1059) Update generated code for beta + * Rename resources `Issuing.CardDesign` and `Issuing.CardBundle` to `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle` + ## 6.7.0 - 2023-10-05 * [#1065](https://github.com/stripe/stripe-python/pull/1065) Update generated code * Add support for new resource `Issuing.Token` * Add support for `list`, `modify`, and `retrieve` methods on resource `Token` +## 6.7.0b2 - 2023-09-28 +* [#1059](https://github.com/stripe/stripe-python/pull/1059) Update generated code for beta + * Rename resources `Issuing.CardDesign` and `Issuing.CardBundle` to `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle` +* [#997](https://github.com/stripe/stripe-python/pull/997) Remove developer_message support + +## 6.7.0b1 - 2023-09-21 +* [#1053](https://github.com/stripe/stripe-python/pull/1053) Update generated code for beta + ## 6.6.0 - 2023-09-21 * [#1056](https://github.com/stripe/stripe-python/pull/1056) Update generated code @@ -1197,6 +2054,13 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1057](https://github.com/stripe/stripe-python/pull/1057) Add optional types to non-required fields * [#1054](https://github.com/stripe/stripe-python/pull/1054) Types: add deleted field +## 6.6.0b1 - 2023-09-14 +* [#1048](https://github.com/stripe/stripe-python/pull/1048) Update generated code for beta + * Add support for new resource `ConfirmationToken` + * Add support for `retrieve` method on resource `ConfirmationToken` + * Add support for `create` method on resource `Issuing.CardDesign` + * Add support for `reject_testmode` test helper method on resource `Issuing.CardDesign` + ## 6.5.0 - 2023-09-14 * [#1052](https://github.com/stripe/stripe-python/pull/1052) Update generated code * Add support for new resource `PaymentMethodConfiguration` @@ -1208,6 +2072,12 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1030](https://github.com/stripe/stripe-python/pull/1030) Explicitly define CRUDL methods in each resource * [#1050](https://github.com/stripe/stripe-python/pull/1050) Generate explicit nested resource class methods +## 6.5.0b1 - 2023-09-07 +* [#1045](https://github.com/stripe/stripe-python/pull/1045) Update generated code for beta + * Release specs are identical. +* [#1034](https://github.com/stripe/stripe-python/pull/1034) Update generated code for beta + * Remove support for `submit_card` test helper method on resource `Issuing.Card` + ## 6.4.0 - 2023-09-07 * [#1033](https://github.com/stripe/stripe-python/pull/1033) Update generated code * Add support for new resource `PaymentMethodDomain` @@ -1219,6 +2089,10 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1042](https://github.com/stripe/stripe-python/pull/1042) Require typing_extensions >= 4.0.0 * [#1026](https://github.com/stripe/stripe-python/pull/1026) Types: annotate resource properties +## 6.3.0b1 - 2023-08-31 +* [#1029](https://github.com/stripe/stripe-python/pull/1029) Update generated code for beta + * Rename `Quote.preview_invoices` and `Quote.preview_subscription_schedules` to `Quote.list_preview_invoices` and `Quote.list_preview_schedules`. + ## 6.2.0 - 2023-08-31 * [#1024](https://github.com/stripe/stripe-python/pull/1024) Update generated code * Add support for new resource `AccountSession` @@ -1229,6 +2103,12 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1016](https://github.com/stripe/stripe-python/pull/1016) Update generated code * [#1020](https://github.com/stripe/stripe-python/pull/1020) Adds type annotations, and dependency on `typing_extensions`. +## 6.1.0b2 - 2023-08-23 +* [#1006](https://github.com/stripe/stripe-python/pull/1006) [#1017](https://github.com/stripe/stripe-python/pull/1017) Update generated code for beta +* [#1020](https://github.com/stripe/stripe-python/pull/1020) Adds type_annotations, and dependency on `typing_extensions`. + +## 6.1.0b1 - 2023-08-23 + * Updated stable APIs to the latest version ## 6.0.0 - 2023-08-16 **⚠️ ACTION REQUIRED: the breaking change in this release likely affects you ⚠️** @@ -1270,26 +2150,111 @@ This release changes the pinned API version to `2025-04-30.basil`. * [#1015](https://github.com/stripe/stripe-python/pull/1015) ⚠️Assert types of pagination responses * Pagination will raise an exception if the API response is not of the correct type. This should never happen in production use but may break tests that use mock data. +## 5.6.0b3 - 2023-08-03 +* [#1004](https://github.com/stripe/stripe-python/pull/1004) Update generated code for beta + * Add support for `submit_card` test helper method on resource `Issuing.Card` +* [#999](https://github.com/stripe/stripe-python/pull/999) Update generated code for beta + +* [#997](https://github.com/stripe/stripe-python/pull/997) Remove developer_message support + +## 5.6.0b2 - 2023-07-28 +* [#995](https://github.com/stripe/stripe-python/pull/995) Update generated code for beta + * Add support for new resource `Tax.Form` + * Add support for `list`, `pdf`, and `retrieve` methods on resource `Form` +* [#992](https://github.com/stripe/stripe-python/pull/992) Update generated code for beta + +## 5.6.0b1 - 2023-07-13 +* [#991](https://github.com/stripe/stripe-python/pull/991) Update generated code for beta + Release specs are identical. +* [#989](https://github.com/stripe/stripe-python/pull/989) Update generated code for beta + * Add support for new resource `PaymentMethodConfiguration` + * Add support for `create`, `list`, `modify`, and `retrieve` methods on resource `PaymentMethodConfiguration` +* [#985](https://github.com/stripe/stripe-python/pull/985) Update generated code for beta + +* [#986](https://github.com/stripe/stripe-python/pull/986) Consolidate beta SDKs section + ## 5.5.0 - 2023-07-13 * [#990](https://github.com/stripe/stripe-python/pull/990) Update generated code * Add support for new resource `Tax.Settings` * Add support for `modify` and `retrieve` methods on resource `Settings` +## 5.5.0b5 - 2023-06-22 +* [#982](https://github.com/stripe/stripe-python/pull/982) Update generated code for beta + * Add support for new resource `CustomerSession` + * Add support for `create` method on resource `CustomerSession` +* [#979](https://github.com/stripe/stripe-python/pull/979) Update generated code for beta +* [#976](https://github.com/stripe/stripe-python/pull/976) Update generated code for beta + +## 5.5.0b4 - 2023-06-02 +* [#973](https://github.com/stripe/stripe-python/pull/973) Update generated code for beta +* [#969](https://github.com/stripe/stripe-python/pull/969) Update generated code for beta +* [#971](https://github.com/stripe/stripe-python/pull/971) Handle developer message in preview error responses + +## 5.5.0b3 - 2023-05-19 +* [#966](https://github.com/stripe/stripe-python/pull/966) Update generated code for beta + * Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account` +* [#965](https://github.com/stripe/stripe-python/pull/965) Add raw_request +* [#964](https://github.com/stripe/stripe-python/pull/964) Update generated code for beta +* [#961](https://github.com/stripe/stripe-python/pull/961) Update generated code for beta + +## 5.5.0b2 - 2023-04-13 +* [#954](https://github.com/stripe/stripe-python/pull/954) Update generated code for beta + * Add support for `collect_payment_method` and `confirm_payment_intent` methods on resource `Terminal.Reader` +* [#953](https://github.com/stripe/stripe-python/pull/953) Update generated code for beta + +## 5.5.0b1 - 2023-03-30 +* [#950](https://github.com/stripe/stripe-python/pull/950) Update generated code for beta + ## 5.4.0 - 2023-03-30 * [#951](https://github.com/stripe/stripe-python/pull/951) Update generated code * Remove support for `create` method on resource `Tax.Transaction` * This is not a breaking change, as this method was deprecated before the Tax Transactions API was released in favor of the `create_from_calculation` method. +## 5.4.0b1 - 2023-03-23 +* [#941](https://github.com/stripe/stripe-python/pull/941) Update generated code for beta (new) + * Add support for new resources `Tax.CalculationLineItem` and `Tax.TransactionLineItem` + * Add support for `collect_inputs` method on resource `Terminal.Reader` + ## 5.3.0 - 2023-03-23 * [#947](https://github.com/stripe/stripe-python/pull/947) Update generated code * Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction` * Add support for `create` and `list_line_items` methods on resource `Calculation` * Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction` +## 5.3.0b4 - 2023-03-16 +* [#940](https://github.com/stripe/stripe-python/pull/940) Update generated code for beta (new) + * Add support for `create_from_calculation` method on resource `Tax.Transaction` +* [#938](https://github.com/stripe/stripe-python/pull/938) Update generated code for beta (new) + * Remove support for resources `Capital.FinancingOffer` and `Capital.FinancingSummary` + * Remove support for `list`, `mark_delivered`, and `retrieve` methods on resource `FinancingOffer` + * Remove support for `retrieve` method on resource `FinancingSummary` + +## 5.3.0b3 - 2023-03-09 +* [#936](https://github.com/stripe/stripe-python/pull/936) API Updates for beta branch + * Updated stable APIs to the latest version + * Remove support for `list_transactions` method on resource `Tax.Transaction` + +## 5.3.0b2 - 2023-03-03 +* [#935](https://github.com/stripe/stripe-python/pull/935) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for new resources `Issuing.CardBundle` and `Issuing.CardDesign` + * Add support for `list` and `retrieve` methods on resource `CardBundle` + * Add support for `list`, `modify`, and `retrieve` methods on resource `CardDesign` + +## 5.3.0b1 - 2023-02-23 +* [#931](https://github.com/stripe/stripe-python/pull/931) API Updates for beta branch + * Updated stable APIs to the latest version + ## 5.2.0 - 2023-02-16 * [#924](https://github.com/stripe/stripe-python/pull/924) API Updates * Add support for `refund_payment` method on resource `Terminal.Reader` +## 5.2.0b1 - 2023-02-02 +* [#921](https://github.com/stripe/stripe-python/pull/921) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for new resource `FinancialConnections.Transaction` + * Add support for `list` method on resource `Transaction` + ## 5.1.1 - 2023-02-06 * [#923](https://github.com/stripe/stripe-python/pull/923) Bugfix: revert "Pass params into logger.{info,debug}" @@ -1298,6 +2263,45 @@ This release changes the pinned API version to `2025-04-30.basil`. * Add support for `resume` method on resource `Subscription` * [#913](https://github.com/stripe/stripe-python/pull/913) Pass params into logger.{info,debug} +## 5.1.0b7 - 2023-01-26 +* [#917](https://github.com/stripe/stripe-python/pull/917) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for `list_transactions` method on resource `Tax.Transaction` + +## 5.1.0b6 - 2023-01-19 +* [#915](https://github.com/stripe/stripe-python/pull/915) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for `Tax.Settings` resource. + +## 5.1.0b5 - 2023-01-12 +* [#914](https://github.com/stripe/stripe-python/pull/914) API Updates for beta branch + * Updated stable APIs to the latest version + * Change `quote.draft_quote` implementation to from calling `POST /v1/quotes/{quote}/draft` to `POST /v1/quotes/{quote}/mark_draft` + * Add support for `tax.Registration` resource + +## 5.1.0b4 - 2023-01-05 +* [#912](https://github.com/stripe/stripe-python/pull/912) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for `mark_stale_quote` method on resource `Quote` + +## 5.1.0b3 - 2022-12-22 +* [#910](https://github.com/stripe/stripe-python/pull/910) API Updates for beta branch + * Updated stable APIs to the latest version + * Move `stripe.TaxCalculation` and `stripe.TaxTranscation` to `stripe.tax.Calculation` and `stripe.tax.Transaction`. + +## 5.1.0b2 - 2022-12-15 +* [#906](https://github.com/stripe/stripe-python/pull/906) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for new resources `QuoteLine`, `TaxCalculation`, and `TaxTransaction` + * Add support for `create` and `list_line_items` methods on resource `TaxCalculation` + * Add support for `create_reversal`, `create`, and `retrieve` methods on resource `TaxTransaction` + +## 5.1.0b1 - 2022-12-08 +* [#902](https://github.com/stripe/stripe-python/pull/902) API Updates for beta branch + * Updated stable APIs to the latest version +* [#898](https://github.com/stripe/stripe-python/pull/898) API Updates for beta branch + * Updated stable APIs to the latest version + ## 5.0.0 - 2022-11-16 Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15. @@ -1310,25 +2314,17 @@ Breaking changes that arose during code generation of the library that we postpo * [#888](https://github.com/stripe/stripe-python/pull/888) Do not run Coveralls if secret token is not available * [#875](https://github.com/stripe/stripe-python/pull/875) hide misleading ssl security warning in python>=2.7.9 -### ⚠️ Changed -- Dropped support for Python version 3.4 and 3.5 (#881). We now support Python 2.7 or 3.6+. -- Fixed mistyped names for two OAuth exceptions: `UnsupportedGrantTypError`->`UnsupportedGrantTypeError` and `UnsupportedResponseTypError`->`UnsupportedResponseTypeError` (#872). +## 4.3.0b3 - 2022-11-02 +* [#890](https://github.com/stripe/stripe-python/pull/890) API Updates for beta branch + * Updated beta APIs to the latest stable version +* [#885](https://github.com/stripe/stripe-python/pull/885) Update changelog for the Gift Card API +* [#884](https://github.com/stripe/stripe-python/pull/884) API Updates for beta branch + * Updated stable APIs to the latest version -### Deprecated -- Deprecate `save` method on resources (#887). Use `modify` instead. - ```python - # Before - customer = stripe.Customer.retrieve("cus_123") - customer.email = "example@test.com" - customer.save() - - # After - stripe.Customer.modify("cus_123", email="example@test.com") - ``` - -### ⚠️ Removed -- Removed `Orders` resource (#882). -- Removed `SKU` resource (#883). +## 4.3.0b1 - 2022-09-26 +* [#878](https://github.com/stripe/stripe-python/pull/878) API Updates for beta branch + * Updated stable APIs to the latest version + * Add `FinancingOffer`, `FinancingSummary` and `FinancingTransaction` resources. ## 4.2.0 - 2022-09-23 * [#877](https://github.com/stripe/stripe-python/pull/877) API Updates @@ -1337,12 +2333,32 @@ Breaking changes that arose during code generation of the library that we postpo * [#867](https://github.com/stripe/stripe-python/pull/867) API Updates * Update links in documentation to be absolute. +## 4.2.0b2 - 2022-08-26 +* [#869](https://github.com/stripe/stripe-python/pull/869) API Updates for beta branch + * Updated stable APIs to the latest version + * Add support for the beta [Gift Card API](https://stripe.com/docs/gift-cards). + +## 4.2.0b1 - 2022-08-23 +* [#866](https://github.com/stripe/stripe-python/pull/866) API Updates for beta branch + - Updated stable APIs to the latest version + - `Stripe-Version` beta headers are not pinned by-default and need to be manually specified, please refer to [beta SDKs README section](https://github.com/stripe/stripe-dotnet/blob/master/README.md#beta-sdks) + ## 4.1.0 - 2022-08-19 * [#861](https://github.com/stripe/stripe-python/pull/861) API Updates * Add support for new resource `CustomerCashBalanceTransaction` * [#860](https://github.com/stripe/stripe-python/pull/860) Add a support section to the readme * [#717](https://github.com/stripe/stripe-python/pull/717) Fix test TestCharge.test_is_saveable(). +## 4.1.0b2 - 2022-08-11 +* [#859](https://github.com/stripe/stripe-python/pull/859) API Updates for beta branch + - Updated stable APIs to the latest version + - Add `refund_payment` method to Terminal resource + +## 4.1.0b1 - 2022-08-03 +* [#848](https://github.com/stripe/stripe-python/pull/848) API Updates for beta branch + - Updated stable APIs to the latest version + - Added the `Order` resource support + ## 4.0.2 - 2022-08-03 * [#855](https://github.com/stripe/stripe-python/pull/855) Fix issue where auto_paging_iter failed on nested list objects. @@ -1361,21 +2377,19 @@ Breaking changes that arose during code generation of the library that we postpo * [#836](https://github.com/stripe/stripe-python/pull/836) API Updates. Add Price.create tests. * [#835](https://github.com/stripe/stripe-python/pull/835) API Updates. Use auto-generation for credit_note and invoice methods. -### ⚠️ Removed -- Removed deprecated `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `IssuerFraudRecord`, `Recipient`, `RecipientTransfer`, and `ThreeDSecure` classes. -- Removed deprecated `Charge.update_dispute` and `Charge.close_dispute` methods that were using legacy REST API endpoint. Prefer [Dispute.modify](https://stripe.com/docs/api/disputes/update?lang=python) and [Dispute.close](https://stripe.com/docs/api/disputes/close?lang=python) -- Removed deprecated `Card.details` method and `CardDetails` resource. The REST API endpoint is not longer supported. -- Removed the deprecated `Source.source_transactions` method. Prefer `SubscriptionItem.list_source_transactions` -- Removed the deprecated `SubscriptionItem.usage_record_summaries` method. Prefer `SubscriptionItem.list_usage_record_summaries` -- Removed the deprecated `Charge.refund` method. Prefer [Refund.create](https://stripe.com/docs/api/refunds/create) - -### ⚠️ Changed -- To be consistent with other resource methods, `ApplicationFee.refund` returns an instance of `ApplicationFee` and doesn't mutate the instance of `ApplicationFee`. -- To be consistent with other resource methods, the `Customer.delete_discount` no longer resets the `discount` property to `None` and returns the deleted discount instead. If you were relying on this behavior, reset the discount property manually: -- The `LineItem` resource now inherits from `StripeObject` as it has no methods of it's own. -- To be consistent with other resource methods, the `Subscription.delete_discount` returns an instance of deleted discount and doesn't mutate the instance of `Subscription`. -- Update the CA certificate bundle. -- Request sending logic unified across standard and custom methods (https://github.com/stripe/stripe-python/pull/832) +## 3.6.0b1 - 2022-07-22 +* [#843](https://github.com/stripe/stripe-python/pull/843) API Updates for beta branch + - Updated stable APIs to the latest version + - Add `QuotePhase` resource +* [#840](https://github.com/stripe/stripe-python/pull/840) API Updates for beta branch + - Updated stable APIs to the latest version + - Add `SubscriptionSchedule.amend` method. +* [#837](https://github.com/stripe/stripe-python/pull/837) API Updates for beta branch + - Include `server_side_confirmation_beta=v1` beta + - Add `secretKeyConfirmation` to `PaymentIntent` +* [#834](https://github.com/stripe/stripe-python/pull/834) API Updates for beta branch + - Updated stable APIs to the latest version +* [#826](https://github.com/stripe/stripe-python/pull/826) Use the generated API version ## 3.5.0 - 2022-06-30 * [#831](https://github.com/stripe/stripe-python/pull/831) API Updates @@ -1405,7 +2419,6 @@ Breaking changes that arose during code generation of the library that we postpo * [#806](https://github.com/stripe/stripe-python/pull/806) Start testing on pypy-3.8 * [#811](https://github.com/stripe/stripe-python/pull/811) Add sanitize_id method - ## 3.0.0 - 2022-05-09 * [#809](https://github.com/stripe/stripe-python/pull/809) Release of major version v3.0.0. The [migration guide](https://github.com/stripe/stripe-python/wiki/Migration-Guide-for-v3) contains more information. (⚠️ = breaking changes): @@ -2153,11 +3166,6 @@ Pull requests included in this release: * PEP8ified the codebase and enforced with a test. * Proper encoding of timezone aware datetimes -### Backwards incompatible changes -* The `to_dict` and `values` methods on resources no longer recursively convert objects to plain `dict`s. All resources now inherit from `dict` but are functionally different in that you cannot set a value to an empty string and cannot delete items. -* The `previous_metadata` attribute on resources is now protected. -* Timezone aware `datetime` objects passed to the API will now be encoded in a way that does not depend on the local system time. If you are passing timezone-aware datetimes to our API and your server time is not already in UTC, this will change the value passed to our API. - ## 1.10.8 - 2013-12-02 * Add stripe.ApplicationFee resource @@ -2234,3 +3242,4 @@ Pull requests included in this release: ## 1.6.1 - 2011-09-14 * Parameters with value None are no longer included in API requests + diff --git a/VERSION b/VERSION index 685332623..94b98c710 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.2.0 +12.3.0b1 diff --git a/stripe/__init__.py b/stripe/__init__.py index 5b98fd411..c6e405ae5 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -123,6 +123,39 @@ def set_app_info( } +# Add a beta version to the API version. +def add_beta_version( + beta_name: str, + beta_version: str, +): + # Validate beta_version format + if not beta_version.startswith("v") or not beta_version[1:].isdigit(): + raise ValueError( + f"Invalid beta_version format: {beta_version}. Expected format is 'v' followed by a number (e.g., 'v3')." + ) + + # Check if beta_name already exists + beta_entry = f"; {beta_name}=" + if beta_entry in stripe.api_version: + start_index = stripe.api_version.index(beta_entry) + len(beta_entry) + end_index = stripe.api_version.find(";", start_index) + end_index = end_index if end_index != -1 else len(stripe.api_version) + existing_version = int( + stripe.api_version[(start_index + 1) : end_index] + ) + new_version = int(beta_version[1:]) + if new_version <= existing_version: + return # Keep the higher version, no update needed + # Remove the existing beta entry + stripe.api_version = ( + stripe.api_version[: stripe.api_version.index(beta_entry)] + + stripe.api_version[end_index:] + ) + + # Add the new beta version + stripe.api_version = f"{stripe.api_version}; {beta_name}={beta_version}" + + # Infrastructure types from stripe._api_resource import APIResource as APIResource from stripe._error_object import ErrorObject as ErrorObject @@ -257,6 +290,7 @@ def __getattr__(name): apps as apps, billing as billing, billing_portal as billing_portal, + capital as capital, checkout as checkout, climate as climate, entitlements as entitlements, @@ -265,6 +299,7 @@ def __getattr__(name): forwarding as forwarding, identity as identity, issuing as issuing, + privacy as privacy, radar as radar, reporting as reporting, sigma as sigma, @@ -288,6 +323,10 @@ def __getattr__(name): from stripe._account_login_link_service import ( AccountLoginLinkService as AccountLoginLinkService, ) +from stripe._account_notice import AccountNotice as AccountNotice +from stripe._account_notice_service import ( + AccountNoticeService as AccountNoticeService, +) from stripe._account_person_service import ( AccountPersonService as AccountPersonService, ) @@ -314,6 +353,10 @@ def __getattr__(name): from stripe._apps_service import AppsService as AppsService from stripe._balance import Balance as Balance from stripe._balance_service import BalanceService as BalanceService +from stripe._balance_settings import BalanceSettings as BalanceSettings +from stripe._balance_settings_service import ( + BalanceSettingsService as BalanceSettingsService, +) from stripe._balance_transaction import ( BalanceTransaction as BalanceTransaction, ) @@ -326,6 +369,7 @@ def __getattr__(name): ) from stripe._billing_service import BillingService as BillingService from stripe._capability import Capability as Capability +from stripe._capital_service import CapitalService as CapitalService from stripe._card import Card as Card from stripe._cash_balance import CashBalance as CashBalance from stripe._charge import Charge as Charge @@ -400,6 +444,17 @@ def __getattr__(name): EphemeralKeyService as EphemeralKeyService, ) from stripe._error import ( + AlreadyCanceledError as AlreadyCanceledError, + BlockedByStripeError as BlockedByStripeError, + ControlledByDashboardError as ControlledByDashboardError, + FeatureNotEnabledError as FeatureNotEnabledError, + FinancialAccountNotOpenError as FinancialAccountNotOpenError, + InsufficientFundsError as InsufficientFundsError, + InvalidPaymentMethodError as InvalidPaymentMethodError, + InvalidPayoutMethodError as InvalidPayoutMethodError, + NotCancelableError as NotCancelableError, + QuotaExceededError as QuotaExceededError, + RecipientNotNotifiableError as RecipientNotNotifiableError, TemporarySessionExpiredError as TemporarySessionExpiredError, ) from stripe._event import Event as Event @@ -408,6 +463,9 @@ def __getattr__(name): from stripe._exchange_rate_service import ( ExchangeRateService as ExchangeRateService, ) +from stripe._external_account_service import ( + ExternalAccountService as ExternalAccountService, +) from stripe._file import File as File from stripe._file_link import FileLink as FileLink from stripe._file_link_service import FileLinkService as FileLinkService @@ -419,6 +477,8 @@ def __getattr__(name): from stripe._funding_instructions import ( FundingInstructions as FundingInstructions, ) +from stripe._fx_quote import FxQuote as FxQuote +from stripe._fx_quote_service import FxQuoteService as FxQuoteService from stripe._identity_service import IdentityService as IdentityService from stripe._invoice import Invoice as Invoice from stripe._invoice_item import InvoiceItem as InvoiceItem @@ -430,9 +490,6 @@ def __getattr__(name): InvoiceLineItemService as InvoiceLineItemService, ) from stripe._invoice_payment import InvoicePayment as InvoicePayment -from stripe._invoice_payment_service import ( - InvoicePaymentService as InvoicePaymentService, -) from stripe._invoice_rendering_template import ( InvoiceRenderingTemplate as InvoiceRenderingTemplate, ) @@ -445,7 +502,26 @@ def __getattr__(name): from stripe._login_link import LoginLink as LoginLink from stripe._mandate import Mandate as Mandate from stripe._mandate_service import MandateService as MandateService +from stripe._margin import Margin as Margin +from stripe._margin_service import MarginService as MarginService +from stripe._order import Order as Order +from stripe._order_line_item_service import ( + OrderLineItemService as OrderLineItemService, +) +from stripe._order_service import OrderService as OrderService +from stripe._payment_attempt_record import ( + PaymentAttemptRecord as PaymentAttemptRecord, +) +from stripe._payment_attempt_record_service import ( + PaymentAttemptRecordService as PaymentAttemptRecordService, +) from stripe._payment_intent import PaymentIntent as PaymentIntent +from stripe._payment_intent_amount_details_line_item import ( + PaymentIntentAmountDetailsLineItem as PaymentIntentAmountDetailsLineItem, +) +from stripe._payment_intent_amount_details_line_item_service import ( + PaymentIntentAmountDetailsLineItemService as PaymentIntentAmountDetailsLineItemService, +) from stripe._payment_intent_service import ( PaymentIntentService as PaymentIntentService, ) @@ -472,6 +548,10 @@ def __getattr__(name): from stripe._payment_method_service import ( PaymentMethodService as PaymentMethodService, ) +from stripe._payment_record import PaymentRecord as PaymentRecord +from stripe._payment_record_service import ( + PaymentRecordService as PaymentRecordService, +) from stripe._payout import Payout as Payout from stripe._payout_service import PayoutService as PayoutService from stripe._person import Person as Person @@ -479,6 +559,7 @@ def __getattr__(name): from stripe._plan_service import PlanService as PlanService from stripe._price import Price as Price from stripe._price_service import PriceService as PriceService +from stripe._privacy_service import PrivacyService as PrivacyService from stripe._product import Product as Product from stripe._product_feature import ProductFeature as ProductFeature from stripe._product_feature_service import ( @@ -493,9 +574,23 @@ def __getattr__(name): from stripe._quote_computed_upfront_line_items_service import ( QuoteComputedUpfrontLineItemsService as QuoteComputedUpfrontLineItemsService, ) +from stripe._quote_line import QuoteLine as QuoteLine from stripe._quote_line_item_service import ( QuoteLineItemService as QuoteLineItemService, ) +from stripe._quote_line_service import QuoteLineService as QuoteLineService +from stripe._quote_preview_invoice import ( + QuotePreviewInvoice as QuotePreviewInvoice, +) +from stripe._quote_preview_invoice_service import ( + QuotePreviewInvoiceService as QuotePreviewInvoiceService, +) +from stripe._quote_preview_subscription_schedule import ( + QuotePreviewSubscriptionSchedule as QuotePreviewSubscriptionSchedule, +) +from stripe._quote_preview_subscription_schedule_service import ( + QuotePreviewSubscriptionScheduleService as QuotePreviewSubscriptionScheduleService, +) from stripe._quote_service import QuoteService as QuoteService from stripe._radar_service import RadarService as RadarService from stripe._refund import Refund as Refund diff --git a/stripe/_account.py b/stripe/_account.py index 0cd137a47..477610a59 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -198,6 +198,12 @@ class Capabilities(StripeObject): """ The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. """ + automatic_indirect_tax: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the automatic_indirect_tax capability of the account. + """ bacs_debit_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. @@ -260,10 +266,26 @@ class Capabilities(StripeObject): """ The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. """ + gopay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Gopay capability of the account, or whether the account can directly process Gopay payments. + """ grabpay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. """ + id_bank_transfer_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the Indonesia Bank Transfer payments capability of the account, or whether the account can directly process Indonesia Bank Transfer charges. + """ + id_bank_transfer_payments_bca: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of Bank BCA onboarding of the account. + """ ideal_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. @@ -308,6 +330,10 @@ class Capabilities(StripeObject): """ The status of the link_payments capability of the account, or whether the account can directly process Link charges. """ + mb_way_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the MB WAY payments capability of the account, or whether the account can directly process MB WAY charges. + """ mobilepay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. @@ -354,6 +380,14 @@ class Capabilities(StripeObject): """ The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. """ + paypal_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the PayPal payments capability of the account, or whether the account can directly process PayPal charges. + """ + payto_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the PayTo capability of the account, or whether the account can directly process PayTo charges. + """ pix_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the pix payments capability of the account, or whether the account can directly process pix charges. @@ -362,6 +396,14 @@ class Capabilities(StripeObject): """ The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. """ + qris_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Qris capability of the account, or whether the account can directly process Qris payments. + """ + rechnung_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Rechnung capability of the account, or whether the account can directly process Rechnung payments. + """ revolut_pay_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -388,10 +430,20 @@ class Capabilities(StripeObject): """ The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. """ + shopeepay_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. + """ sofort_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. """ + stripe_balance_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the stripe_balance payments capability of the account, or whether the account can directly process stripe_balance charges. + """ swish_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Swish capability of the account, or whether the account can directly process Swish payments. @@ -416,6 +468,22 @@ class Capabilities(StripeObject): """ The status of the banking capability, or whether the account can have bank accounts. """ + treasury_evolve: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the treasury_evolve capability of the account. + """ + treasury_fifth_third: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the treasury_fifth_third capability of the account. + """ + treasury_goldman_sachs: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the treasury_goldman_sachs capability of the account. + """ twint_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. @@ -708,12 +776,33 @@ class Document(StripeObject): } class Controller(StripeObject): + class Application(StripeObject): + loss_liable: bool + """ + `true` if the Connect application is responsible for negative balances and should manage credit and fraud risk on the account. + """ + onboarding_owner: bool + """ + `true` if the Connect application is responsible for onboarding the account. + """ + pricing_controls: bool + """ + `true` if the Connect application is responsible for paying Stripe fees on pricing-control eligible products. + """ + + class Dashboard(StripeObject): + type: Literal["express", "full", "none"] + """ + Whether this account has access to the full Stripe dashboard (`full`), to the Express dashboard (`express`), or to no dashboard (`none`). + """ + class Fees(StripeObject): payer: Literal[ "account", "application", "application_custom", "application_express", + "application_unified_accounts_beta", ] """ A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). @@ -731,6 +820,8 @@ class StripeDashboard(StripeObject): A value indicating the Stripe dashboard this account has access to independent of the Connect application. """ + application: Optional[Application] + dashboard: Optional[Dashboard] fees: Optional[Fees] is_controller: Optional[bool] """ @@ -747,6 +838,8 @@ class StripeDashboard(StripeObject): The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. """ _inner_class_types = { + "application": Application, + "dashboard": Dashboard, "fees": Fees, "losses": Losses, "stripe_dashboard": StripeDashboard, @@ -1104,6 +1197,38 @@ class Error(StripeObject): """ _inner_class_types = {"alternatives": Alternative, "errors": Error} + class RiskControls(StripeObject): + class Charges(StripeObject): + pause_requested: bool + """ + Whether a pause of the risk control has been requested. + """ + + class Payouts(StripeObject): + pause_requested: bool + """ + Whether a pause of the risk control has been requested. + """ + + charges: Charges + payouts: Payouts + rejected_reason: Optional[ + Literal[ + "credit", + "fraud", + "fraud_no_intent_to_fulfill", + "fraud_other", + "fraud_payment_method_casher", + "fraud_payment_method_tester", + "other", + "terms_of_service", + ] + ] + """ + Represents the rejected reason of the account. Empty if account is not rejected, or rejected by Stripe. Please see [this page for more details](https://stripe.com/docs/connect/) + """ + _inner_class_types = {"charges": Charges, "payouts": Payouts} + class Settings(StripeObject): class BacsDebitPayments(StripeObject): display_name: Optional[str] @@ -1115,6 +1240,16 @@ class BacsDebitPayments(StripeObject): The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. """ + class BankBcaOnboarding(StripeObject): + account_holder_name: Optional[str] + """ + Bank BCA business account holder name. + """ + business_account_number: Optional[str] + """ + Bank BCA business account number. + """ + class Branding(StripeObject): icon: Optional[ExpandableField["File"]] """ @@ -1133,6 +1268,16 @@ class Branding(StripeObject): A CSS hex color value representing the secondary branding color for this account """ + class Capital(StripeObject): + payout_destination: Optional[Dict[str, str]] + """ + Per-currency mapping of user-selected destination accounts used to pay out loans. + """ + payout_destination_selector: Optional[Dict[str, List[str]]] + """ + Per-currency mapping of all destination accounts eligible to receive loan payouts. + """ + class CardIssuing(StripeObject): class TosAcceptance(StripeObject): date: Optional[int] @@ -1257,6 +1402,12 @@ class SepaDebitPayments(StripeObject): SEPA creditor identifier that identifies the company making the payment. """ + class TaxForms(StripeObject): + consented_to_paperless_delivery: bool + """ + Whether the account opted out of receiving their tax forms by postal delivery. + """ + class Treasury(StripeObject): class TosAcceptance(StripeObject): date: Optional[int] @@ -1276,7 +1427,9 @@ class TosAcceptance(StripeObject): _inner_class_types = {"tos_acceptance": TosAcceptance} bacs_debit_payments: Optional[BacsDebitPayments] + bank_bca_onboarding: Optional[BankBcaOnboarding] branding: Branding + capital: Optional[Capital] card_issuing: Optional[CardIssuing] card_payments: CardPayments dashboard: Dashboard @@ -1284,10 +1437,13 @@ class TosAcceptance(StripeObject): payments: Payments payouts: Optional[Payouts] sepa_debit_payments: Optional[SepaDebitPayments] + tax_forms: Optional[TaxForms] treasury: Optional[Treasury] _inner_class_types = { "bacs_debit_payments": BacsDebitPayments, + "bank_bca_onboarding": BankBcaOnboarding, "branding": Branding, + "capital": Capital, "card_issuing": CardIssuing, "card_payments": CardPayments, "dashboard": Dashboard, @@ -1295,6 +1451,7 @@ class TosAcceptance(StripeObject): "payments": Payments, "payouts": Payouts, "sepa_debit_payments": SepaDebitPayments, + "tax_forms": TaxForms, "treasury": Treasury, } @@ -1470,6 +1627,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + risk_controls: NotRequired["Account.CreateParamsRiskControls"] + """ + A hash to configure risk controls on the account. Please see [this page for more details](https://docs.stripe.com/connect/pausing-payments-or-payouts-on-connected-accounts). + """ settings: NotRequired["Account.CreateParamsSettings"] """ Options for customizing how the account functions within Stripe. @@ -1663,6 +1824,12 @@ class CreateParamsCapabilities(TypedDict): """ The au_becs_debit_payments capability. """ + automatic_indirect_tax: NotRequired[ + "Account.CreateParamsCapabilitiesAutomaticIndirectTax" + ] + """ + The automatic_indirect_tax capability. + """ bacs_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesBacsDebitPayments" ] @@ -1747,12 +1914,30 @@ class CreateParamsCapabilities(TypedDict): """ The giropay_payments capability. """ + gopay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesGopayPayments" + ] + """ + The gopay_payments capability. + """ grabpay_payments: NotRequired[ "Account.CreateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "Account.CreateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "Account.CreateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "Account.CreateParamsCapabilitiesIdealPayments" ] @@ -1813,6 +1998,12 @@ class CreateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mb_way_payments: NotRequired[ + "Account.CreateParamsCapabilitiesMbWayPayments" + ] + """ + The mb_way_payments capability. + """ mobilepay_payments: NotRequired[ "Account.CreateParamsCapabilitiesMobilepayPayments" ] @@ -1873,6 +2064,18 @@ class CreateParamsCapabilities(TypedDict): """ The paynow_payments capability. """ + paypal_payments: NotRequired[ + "Account.CreateParamsCapabilitiesPaypalPayments" + ] + """ + The paypal_payments capability. + """ + payto_payments: NotRequired[ + "Account.CreateParamsCapabilitiesPaytoPayments" + ] + """ + The payto_payments capability. + """ pix_payments: NotRequired[ "Account.CreateParamsCapabilitiesPixPayments" ] @@ -1885,6 +2088,18 @@ class CreateParamsCapabilities(TypedDict): """ The promptpay_payments capability. """ + qris_payments: NotRequired[ + "Account.CreateParamsCapabilitiesQrisPayments" + ] + """ + The qris_payments capability. + """ + rechnung_payments: NotRequired[ + "Account.CreateParamsCapabilitiesRechnungPayments" + ] + """ + The rechnung_payments capability. + """ revolut_pay_payments: NotRequired[ "Account.CreateParamsCapabilitiesRevolutPayPayments" ] @@ -1915,12 +2130,24 @@ class CreateParamsCapabilities(TypedDict): """ The sepa_debit_payments capability. """ + shopeepay_payments: NotRequired[ + "Account.CreateParamsCapabilitiesShopeepayPayments" + ] + """ + The shopeepay_payments capability. + """ sofort_payments: NotRequired[ "Account.CreateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ + stripe_balance_payments: NotRequired[ + "Account.CreateParamsCapabilitiesStripeBalancePayments" + ] + """ + The stripe_balance_payments capability. + """ swish_payments: NotRequired[ "Account.CreateParamsCapabilitiesSwishPayments" ] @@ -1947,6 +2174,24 @@ class CreateParamsCapabilities(TypedDict): """ The treasury capability. """ + treasury_evolve: NotRequired[ + "Account.CreateParamsCapabilitiesTreasuryEvolve" + ] + """ + The treasury_evolve capability. + """ + treasury_fifth_third: NotRequired[ + "Account.CreateParamsCapabilitiesTreasuryFifthThird" + ] + """ + The treasury_fifth_third capability. + """ + treasury_goldman_sachs: NotRequired[ + "Account.CreateParamsCapabilitiesTreasuryGoldmanSachs" + ] + """ + The treasury_goldman_sachs capability. + """ twint_payments: NotRequired[ "Account.CreateParamsCapabilitiesTwintPayments" ] @@ -2008,6 +2253,12 @@ class CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesAutomaticIndirectTax(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -2092,12 +2343,30 @@ class CreateParamsCapabilitiesGiropayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesGopayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -2158,6 +2427,12 @@ class CreateParamsCapabilitiesLinkPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesMbWayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2218,6 +2493,18 @@ class CreateParamsCapabilitiesPaynowPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesPaypalPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesPaytoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesPixPayments(TypedDict): requested: NotRequired[bool] """ @@ -2230,6 +2517,18 @@ class CreateParamsCapabilitiesPromptpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesQrisPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesRechnungPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2260,12 +2559,24 @@ class CreateParamsCapabilitiesSepaDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesShopeepayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesStripeBalancePayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ @@ -2296,6 +2607,24 @@ class CreateParamsCapabilitiesTreasury(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesTreasuryEvolve(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesTreasuryFifthThird(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesTreasuryGoldmanSachs(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ @@ -2589,6 +2918,14 @@ class CreateParamsCompanyVerificationDocument(TypedDict): """ class CreateParamsController(TypedDict): + application: NotRequired["Account.CreateParamsControllerApplication"] + """ + A hash of configuration describing the Connect application that controls the account. + """ + dashboard: NotRequired["Account.CreateParamsControllerDashboard"] + """ + Properties of the account's dashboard. + """ fees: NotRequired["Account.CreateParamsControllerFees"] """ A hash of configuration for who pays Stripe fees for product usage on this account. @@ -2608,6 +2945,26 @@ class CreateParamsController(TypedDict): A hash of configuration for Stripe-hosted dashboards. """ + class CreateParamsControllerApplication(TypedDict): + loss_liable: bool + """ + Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + """ + onboarding_owner: NotRequired[bool] + """ + Whether the controller owns onboarding for this account. + """ + pricing_controls: NotRequired[bool] + """ + Whether the controller has pricing controls for this account. + """ + + class CreateParamsControllerDashboard(TypedDict): + type: NotRequired[Literal["express", "full", "none"]] + """ + Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. + """ + class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ @@ -3010,6 +3367,30 @@ class CreateParamsIndividualVerificationDocument(TypedDict): The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class CreateParamsRiskControls(TypedDict): + charges: NotRequired["Account.CreateParamsRiskControlsCharges"] + """ + Represents the risk control status of charges. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + payouts: NotRequired["Account.CreateParamsRiskControlsPayouts"] + """ + Represents the risk control status of payouts. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + + class CreateParamsRiskControlsCharges(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + + class CreateParamsRiskControlsPayouts(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + class CreateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "Account.CreateParamsSettingsBacsDebitPayments" @@ -3017,10 +3398,20 @@ class CreateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit. """ + bank_bca_onboarding: NotRequired[ + "Account.CreateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["Account.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ + capital: NotRequired["Account.CreateParamsSettingsCapital"] + """ + Settings specific to the account's use of the Capital product. + """ card_issuing: NotRequired["Account.CreateParamsSettingsCardIssuing"] """ Settings specific to the account's use of the Card Issuing product. @@ -3041,6 +3432,10 @@ class CreateParamsSettings(TypedDict): """ Settings specific to the account's payouts. """ + tax_forms: NotRequired["Account.CreateParamsSettingsTaxForms"] + """ + Settings specific to the account's tax forms. + """ treasury: NotRequired["Account.CreateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. @@ -3052,6 +3447,16 @@ class CreateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class CreateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ @@ -3070,6 +3475,16 @@ class CreateParamsSettingsBranding(TypedDict): A CSS hex color value representing the secondary branding color for this account. """ + class CreateParamsSettingsCapital(TypedDict): + payout_destination: NotRequired[Dict[str, str]] + """ + Per-currency mapping of user-selected destination accounts used to pay out loans. + """ + payout_destination_selector: NotRequired[Dict[str, List[str]]] + """ + Per-currency mapping of all destination accounts eligible to receive Capital financing payouts. + """ + class CreateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "Account.CreateParamsSettingsCardIssuingTosAcceptance" @@ -3186,6 +3601,12 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + class CreateParamsSettingsTaxForms(TypedDict): + consented_to_paperless_delivery: NotRequired[bool] + """ + Whether the account opted out of receiving their tax forms by postal delivery. + """ + class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "Account.CreateParamsSettingsTreasuryTosAcceptance" @@ -4494,6 +4915,7 @@ class RetrievePersonParams(RequestOptions): Whether the funds in this account can be paid out. """ requirements: Optional[Requirements] + risk_controls: Optional[RiskControls] settings: Optional[Settings] """ Options for customizing how the account functions within Stripe. @@ -5606,6 +6028,7 @@ async def create_person_async( "future_requirements": FutureRequirements, "groups": Groups, "requirements": Requirements, + "risk_controls": RiskControls, "settings": Settings, "tos_acceptance": TosAcceptance, } diff --git a/stripe/_account_link.py b/stripe/_account_link.py index dce24a0c6..25ac786cf 100644 --- a/stripe/_account_link.py +++ b/stripe/_account_link.py @@ -43,7 +43,12 @@ class CreateParams(RequestOptions): """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ - type: Literal["account_onboarding", "account_update"] + type: Literal[ + "account_onboarding", + "account_update", + "capital_financing_offer", + "capital_financing_reporting", + ] """ The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. """ diff --git a/stripe/_account_link_service.py b/stripe/_account_link_service.py index 793610084..d454ae65b 100644 --- a/stripe/_account_link_service.py +++ b/stripe/_account_link_service.py @@ -35,7 +35,12 @@ class CreateParams(TypedDict): """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ - type: Literal["account_onboarding", "account_update"] + type: Literal[ + "account_onboarding", + "account_update", + "capital_financing_offer", + "capital_financing_reporting", + ] """ The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. """ diff --git a/stripe/_account_notice.py b/stripe/_account_notice.py new file mode 100644 index 000000000..182420add --- /dev/null +++ b/stripe/_account_notice.py @@ -0,0 +1,264 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id +from typing import ClassVar, Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class AccountNotice( + ListableAPIResource["AccountNotice"], + UpdateableAPIResource["AccountNotice"], +): + """ + A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself. + + See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts. + """ + + OBJECT_NAME: ClassVar[Literal["account_notice"]] = "account_notice" + + class Email(StripeObject): + plain_text: str + """ + Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use. + """ + recipient: str + """ + Email address of the recipient. + """ + subject: str + """ + Subject of the email. + """ + + class LinkedObjects(StripeObject): + capability: Optional[str] + """ + Associated [Capability](https://stripe.com/docs/api/capabilities) + """ + issuing_credit_underwriting_record: Optional[str] + """ + Associated [Credit Underwriting Record](https://stripe.com/docs/api/issuing/credit_underwriting_record) + """ + issuing_dispute: Optional[str] + """ + Associated [Issuing Dispute](https://stripe.com/docs/api/issuing/disputes) + """ + + class ListParams(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. + """ + sent: NotRequired[bool] + """ + Set to false to only return unsent AccountNotices. + """ + 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. + """ + + class ModifyParams(RequestOptions): + email: "AccountNotice.ModifyParamsEmail" + """ + Information about the email you sent. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + sent_at: int + """ + Date when you sent the notice. + """ + + class ModifyParamsEmail(TypedDict): + plain_text: str + """ + Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use. + """ + recipient: str + """ + Email address of the recipient. + """ + subject: str + """ + Subject of the email. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + deadline: Optional[int] + """ + When present, the deadline for sending the notice to meet the relevant regulations. + """ + email: Optional[Email] + """ + Information about the email when sent. + """ + id: str + """ + Unique identifier for the object. + """ + linked_objects: Optional[LinkedObjects] + """ + Information about objects related to the notice. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["account_notice"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + reason: Literal[ + "issuing.account_closed_for_inactivity", + "issuing.account_closed_for_not_providing_business_model_clarification", + "issuing.account_closed_for_not_providing_url_clarification", + "issuing.account_closed_for_not_providing_use_case_clarification", + "issuing.account_closed_for_terms_of_service_violation", + "issuing.application_rejected_for_failure_to_verify", + "issuing.credit_application_rejected", + "issuing.credit_increase_application_rejected", + "issuing.credit_limit_decreased", + "issuing.credit_line_closed", + "issuing.dispute_lost", + "issuing.dispute_submitted", + "issuing.dispute_won", + ] + """ + Reason the notice is being sent. The reason determines what copy the notice must contain. See the [regulated customer notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) guide. All reasons might not apply to your integration, and Stripe might add new reasons in the future, so we recommend an internal warning when you receive an unknown reason. + """ + sent_at: Optional[int] + """ + Date when the notice was sent. When absent, you must send the notice, update the content of the email and date when it was sent. + """ + + @classmethod + def list( + cls, **params: Unpack["AccountNotice.ListParams"] + ) -> ListObject["AccountNotice"]: + """ + Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + 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["AccountNotice.ListParams"] + ) -> ListObject["AccountNotice"]: + """ + Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + 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 modify( + cls, id: str, **params: Unpack["AccountNotice.ModifyParams"] + ) -> "AccountNotice": + """ + Updates an AccountNotice object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "AccountNotice", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["AccountNotice.ModifyParams"] + ) -> "AccountNotice": + """ + Updates an AccountNotice object. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "AccountNotice", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["AccountNotice.RetrieveParams"] + ) -> "AccountNotice": + """ + Retrieves an AccountNotice object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["AccountNotice.RetrieveParams"] + ) -> "AccountNotice": + """ + Retrieves an AccountNotice object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"email": Email, "linked_objects": LinkedObjects} diff --git a/stripe/_account_notice_service.py b/stripe/_account_notice_service.py new file mode 100644 index 000000000..390dfd7cb --- /dev/null +++ b/stripe/_account_notice_service.py @@ -0,0 +1,197 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._account_notice import AccountNotice +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Dict, List, cast +from typing_extensions import NotRequired, TypedDict + + +class AccountNoticeService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + sent: NotRequired[bool] + """ + Set to false to only return unsent AccountNotices. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + email: "AccountNoticeService.UpdateParamsEmail" + """ + Information about the email you sent. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + sent_at: int + """ + Date when you sent the notice. + """ + + class UpdateParamsEmail(TypedDict): + plain_text: str + """ + Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use. + """ + recipient: str + """ + Email address of the recipient. + """ + subject: str + """ + Subject of the email. + """ + + def list( + self, + params: "AccountNoticeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[AccountNotice]: + """ + Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + return cast( + ListObject[AccountNotice], + self._request( + "get", + "/v1/account_notices", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "AccountNoticeService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[AccountNotice]: + """ + Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + return cast( + ListObject[AccountNotice], + await self._request_async( + "get", + "/v1/account_notices", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + account_notice: str, + params: "AccountNoticeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> AccountNotice: + """ + Retrieves an AccountNotice object. + """ + return cast( + AccountNotice, + self._request( + "get", + "/v1/account_notices/{account_notice}".format( + account_notice=sanitize_id(account_notice), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + account_notice: str, + params: "AccountNoticeService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> AccountNotice: + """ + Retrieves an AccountNotice object. + """ + return cast( + AccountNotice, + await self._request_async( + "get", + "/v1/account_notices/{account_notice}".format( + account_notice=sanitize_id(account_notice), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + account_notice: str, + params: "AccountNoticeService.UpdateParams", + options: RequestOptions = {}, + ) -> AccountNotice: + """ + Updates an AccountNotice object. + """ + return cast( + AccountNotice, + self._request( + "post", + "/v1/account_notices/{account_notice}".format( + account_notice=sanitize_id(account_notice), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + account_notice: str, + params: "AccountNoticeService.UpdateParams", + options: RequestOptions = {}, + ) -> AccountNotice: + """ + Updates an AccountNotice object. + """ + return cast( + AccountNotice, + await self._request_async( + "post", + "/v1/account_notices/{account_notice}".format( + account_notice=sanitize_id(account_notice), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_service.py b/stripe/_account_service.py index aa66785b3..58fb8c9c7 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -99,6 +99,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + risk_controls: NotRequired["AccountService.CreateParamsRiskControls"] + """ + A hash to configure risk controls on the account. Please see [this page for more details](https://docs.stripe.com/connect/pausing-payments-or-payouts-on-connected-accounts). + """ settings: NotRequired["AccountService.CreateParamsSettings"] """ Options for customizing how the account functions within Stripe. @@ -292,6 +296,12 @@ class CreateParamsCapabilities(TypedDict): """ The au_becs_debit_payments capability. """ + automatic_indirect_tax: NotRequired[ + "AccountService.CreateParamsCapabilitiesAutomaticIndirectTax" + ] + """ + The automatic_indirect_tax capability. + """ bacs_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBacsDebitPayments" ] @@ -376,12 +386,30 @@ class CreateParamsCapabilities(TypedDict): """ The giropay_payments capability. """ + gopay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesGopayPayments" + ] + """ + The gopay_payments capability. + """ grabpay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "AccountService.CreateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesIdealPayments" ] @@ -442,6 +470,12 @@ class CreateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mb_way_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesMbWayPayments" + ] + """ + The mb_way_payments capability. + """ mobilepay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesMobilepayPayments" ] @@ -502,6 +536,18 @@ class CreateParamsCapabilities(TypedDict): """ The paynow_payments capability. """ + paypal_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesPaypalPayments" + ] + """ + The paypal_payments capability. + """ + payto_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesPaytoPayments" + ] + """ + The payto_payments capability. + """ pix_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPixPayments" ] @@ -514,6 +560,18 @@ class CreateParamsCapabilities(TypedDict): """ The promptpay_payments capability. """ + qris_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesQrisPayments" + ] + """ + The qris_payments capability. + """ + rechnung_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesRechnungPayments" + ] + """ + The rechnung_payments capability. + """ revolut_pay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesRevolutPayPayments" ] @@ -544,12 +602,24 @@ class CreateParamsCapabilities(TypedDict): """ The sepa_debit_payments capability. """ + shopeepay_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesShopeepayPayments" + ] + """ + The shopeepay_payments capability. + """ sofort_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ + stripe_balance_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesStripeBalancePayments" + ] + """ + The stripe_balance_payments capability. + """ swish_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSwishPayments" ] @@ -580,6 +650,24 @@ class CreateParamsCapabilities(TypedDict): """ The treasury capability. """ + treasury_evolve: NotRequired[ + "AccountService.CreateParamsCapabilitiesTreasuryEvolve" + ] + """ + The treasury_evolve capability. + """ + treasury_fifth_third: NotRequired[ + "AccountService.CreateParamsCapabilitiesTreasuryFifthThird" + ] + """ + The treasury_fifth_third capability. + """ + treasury_goldman_sachs: NotRequired[ + "AccountService.CreateParamsCapabilitiesTreasuryGoldmanSachs" + ] + """ + The treasury_goldman_sachs capability. + """ twint_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesTwintPayments" ] @@ -641,6 +729,12 @@ class CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesAutomaticIndirectTax(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -725,12 +819,30 @@ class CreateParamsCapabilitiesGiropayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesGopayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -791,6 +903,12 @@ class CreateParamsCapabilitiesLinkPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesMbWayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ @@ -851,6 +969,18 @@ class CreateParamsCapabilitiesPaynowPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesPaypalPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesPaytoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesPixPayments(TypedDict): requested: NotRequired[bool] """ @@ -863,6 +993,18 @@ class CreateParamsCapabilitiesPromptpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesQrisPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesRechnungPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -893,12 +1035,24 @@ class CreateParamsCapabilitiesSepaDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesShopeepayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesStripeBalancePayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ @@ -929,6 +1083,24 @@ class CreateParamsCapabilitiesTreasury(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesTreasuryEvolve(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesTreasuryFifthThird(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class CreateParamsCapabilitiesTreasuryGoldmanSachs(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ @@ -1228,6 +1400,18 @@ class CreateParamsCompanyVerificationDocument(TypedDict): """ class CreateParamsController(TypedDict): + application: NotRequired[ + "AccountService.CreateParamsControllerApplication" + ] + """ + A hash of configuration describing the Connect application that controls the account. + """ + dashboard: NotRequired[ + "AccountService.CreateParamsControllerDashboard" + ] + """ + Properties of the account's dashboard. + """ fees: NotRequired["AccountService.CreateParamsControllerFees"] """ A hash of configuration for who pays Stripe fees for product usage on this account. @@ -1247,6 +1431,26 @@ class CreateParamsController(TypedDict): A hash of configuration for Stripe-hosted dashboards. """ + class CreateParamsControllerApplication(TypedDict): + loss_liable: bool + """ + Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + """ + onboarding_owner: NotRequired[bool] + """ + Whether the controller owns onboarding for this account. + """ + pricing_controls: NotRequired[bool] + """ + Whether the controller has pricing controls for this account. + """ + + class CreateParamsControllerDashboard(TypedDict): + type: NotRequired[Literal["express", "full", "none"]] + """ + Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. + """ + class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ @@ -1657,6 +1861,30 @@ class CreateParamsIndividualVerificationDocument(TypedDict): The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class CreateParamsRiskControls(TypedDict): + charges: NotRequired["AccountService.CreateParamsRiskControlsCharges"] + """ + Represents the risk control status of charges. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + payouts: NotRequired["AccountService.CreateParamsRiskControlsPayouts"] + """ + Represents the risk control status of payouts. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + + class CreateParamsRiskControlsCharges(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + + class CreateParamsRiskControlsPayouts(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + class CreateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "AccountService.CreateParamsSettingsBacsDebitPayments" @@ -1664,10 +1892,20 @@ class CreateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit. """ + bank_bca_onboarding: NotRequired[ + "AccountService.CreateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["AccountService.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ + capital: NotRequired["AccountService.CreateParamsSettingsCapital"] + """ + Settings specific to the account's use of the Capital product. + """ card_issuing: NotRequired[ "AccountService.CreateParamsSettingsCardIssuing" ] @@ -1692,6 +1930,10 @@ class CreateParamsSettings(TypedDict): """ Settings specific to the account's payouts. """ + tax_forms: NotRequired["AccountService.CreateParamsSettingsTaxForms"] + """ + Settings specific to the account's tax forms. + """ treasury: NotRequired["AccountService.CreateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. @@ -1703,6 +1945,16 @@ class CreateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class CreateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ @@ -1721,6 +1973,16 @@ class CreateParamsSettingsBranding(TypedDict): A CSS hex color value representing the secondary branding color for this account. """ + class CreateParamsSettingsCapital(TypedDict): + payout_destination: NotRequired[Dict[str, str]] + """ + Per-currency mapping of user-selected destination accounts used to pay out loans. + """ + payout_destination_selector: NotRequired[Dict[str, List[str]]] + """ + Per-currency mapping of all destination accounts eligible to receive Capital financing payouts. + """ + class CreateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "AccountService.CreateParamsSettingsCardIssuingTosAcceptance" @@ -1839,6 +2101,12 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + class CreateParamsSettingsTaxForms(TypedDict): + consented_to_paperless_delivery: NotRequired[bool] + """ + Whether the account opted out of receiving their tax forms by postal delivery. + """ + class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "AccountService.CreateParamsSettingsTreasuryTosAcceptance" @@ -2012,6 +2280,10 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + risk_controls: NotRequired["AccountService.UpdateParamsRiskControls"] + """ + A hash to configure risk controls on the account. Please see [this page for more details](https://docs.stripe.com/connect/pausing-payments-or-payouts-on-connected-accounts). + """ settings: NotRequired["AccountService.UpdateParamsSettings"] """ Options for customizing how the account functions within Stripe. @@ -2201,6 +2473,12 @@ class UpdateParamsCapabilities(TypedDict): """ The au_becs_debit_payments capability. """ + automatic_indirect_tax: NotRequired[ + "AccountService.UpdateParamsCapabilitiesAutomaticIndirectTax" + ] + """ + The automatic_indirect_tax capability. + """ bacs_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBacsDebitPayments" ] @@ -2285,12 +2563,30 @@ class UpdateParamsCapabilities(TypedDict): """ The giropay_payments capability. """ + gopay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesGopayPayments" + ] + """ + The gopay_payments capability. + """ grabpay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ + id_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesIdBankTransferPayments" + ] + """ + The id_bank_transfer_payments capability. + """ + id_bank_transfer_payments_bca: NotRequired[ + "AccountService.UpdateParamsCapabilitiesIdBankTransferPaymentsBca" + ] + """ + The id_bank_transfer_payments_bca capability. + """ ideal_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesIdealPayments" ] @@ -2351,6 +2647,12 @@ class UpdateParamsCapabilities(TypedDict): """ The link_payments capability. """ + mb_way_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesMbWayPayments" + ] + """ + The mb_way_payments capability. + """ mobilepay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesMobilepayPayments" ] @@ -2411,6 +2713,18 @@ class UpdateParamsCapabilities(TypedDict): """ The paynow_payments capability. """ + paypal_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesPaypalPayments" + ] + """ + The paypal_payments capability. + """ + payto_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesPaytoPayments" + ] + """ + The payto_payments capability. + """ pix_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPixPayments" ] @@ -2423,6 +2737,18 @@ class UpdateParamsCapabilities(TypedDict): """ The promptpay_payments capability. """ + qris_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesQrisPayments" + ] + """ + The qris_payments capability. + """ + rechnung_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesRechnungPayments" + ] + """ + The rechnung_payments capability. + """ revolut_pay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesRevolutPayPayments" ] @@ -2453,12 +2779,24 @@ class UpdateParamsCapabilities(TypedDict): """ The sepa_debit_payments capability. """ + shopeepay_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesShopeepayPayments" + ] + """ + The shopeepay_payments capability. + """ sofort_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ + stripe_balance_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesStripeBalancePayments" + ] + """ + The stripe_balance_payments capability. + """ swish_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSwishPayments" ] @@ -2489,6 +2827,24 @@ class UpdateParamsCapabilities(TypedDict): """ The treasury capability. """ + treasury_evolve: NotRequired[ + "AccountService.UpdateParamsCapabilitiesTreasuryEvolve" + ] + """ + The treasury_evolve capability. + """ + treasury_fifth_third: NotRequired[ + "AccountService.UpdateParamsCapabilitiesTreasuryFifthThird" + ] + """ + The treasury_fifth_third capability. + """ + treasury_goldman_sachs: NotRequired[ + "AccountService.UpdateParamsCapabilitiesTreasuryGoldmanSachs" + ] + """ + The treasury_goldman_sachs capability. + """ twint_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesTwintPayments" ] @@ -2550,6 +2906,12 @@ class UpdateParamsCapabilitiesAuBecsDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesAutomaticIndirectTax(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ @@ -2634,12 +2996,30 @@ class UpdateParamsCapabilitiesGiropayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesGopayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesIdBankTransferPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesIdBankTransferPaymentsBca(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ @@ -2700,6 +3080,12 @@ class UpdateParamsCapabilitiesLinkPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesMbWayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2760,6 +3146,18 @@ class UpdateParamsCapabilitiesPaynowPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesPaypalPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesPaytoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesPixPayments(TypedDict): requested: NotRequired[bool] """ @@ -2772,6 +3170,18 @@ class UpdateParamsCapabilitiesPromptpayPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesQrisPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesRechnungPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ @@ -2802,12 +3212,24 @@ class UpdateParamsCapabilitiesSepaDebitPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesShopeepayPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesStripeBalancePayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ @@ -2838,6 +3260,24 @@ class UpdateParamsCapabilitiesTreasury(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesTreasuryEvolve(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesTreasuryFifthThird(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class UpdateParamsCapabilitiesTreasuryGoldmanSachs(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ @@ -3528,6 +3968,30 @@ class UpdateParamsIndividualVerificationDocument(TypedDict): The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class UpdateParamsRiskControls(TypedDict): + charges: NotRequired["AccountService.UpdateParamsRiskControlsCharges"] + """ + Represents the risk control status of charges. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + payouts: NotRequired["AccountService.UpdateParamsRiskControlsPayouts"] + """ + Represents the risk control status of payouts. Please see [this page for more details](https://stripe.com/docs/connect/pausing-payments-or-payouts-on-connected-accounts). + """ + + class UpdateParamsRiskControlsCharges(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + + class UpdateParamsRiskControlsPayouts(TypedDict): + pause_requested: NotRequired[bool] + """ + To request to pause a risk control, pass `true`. To request to unpause a risk control, pass `false`. + There can be a delay before the risk control is paused or unpaused. + """ + class UpdateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "AccountService.UpdateParamsSettingsBacsDebitPayments" @@ -3535,10 +3999,20 @@ class UpdateParamsSettings(TypedDict): """ Settings specific to Bacs Direct Debit payments. """ + bank_bca_onboarding: NotRequired[ + "AccountService.UpdateParamsSettingsBankBcaOnboarding" + ] + """ + Settings specific to bank BCA onboarding for Indonesia bank transfers payments method. + """ branding: NotRequired["AccountService.UpdateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ + capital: NotRequired["AccountService.UpdateParamsSettingsCapital"] + """ + Settings specific to the account's use of the Capital product. + """ card_issuing: NotRequired[ "AccountService.UpdateParamsSettingsCardIssuing" ] @@ -3563,6 +4037,10 @@ class UpdateParamsSettings(TypedDict): """ Settings specific to the account's payouts. """ + tax_forms: NotRequired["AccountService.UpdateParamsSettingsTaxForms"] + """ + Settings specific to the account's tax forms. + """ treasury: NotRequired["AccountService.UpdateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. @@ -3574,6 +4052,16 @@ class UpdateParamsSettingsBacsDebitPayments(TypedDict): The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ + class UpdateParamsSettingsBankBcaOnboarding(TypedDict): + account_holder_name: NotRequired[str] + """ + Bank BCA business account holder name + """ + business_account_number: NotRequired[str] + """ + Bank BCA business account number + """ + class UpdateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ @@ -3592,6 +4080,16 @@ class UpdateParamsSettingsBranding(TypedDict): A CSS hex color value representing the secondary branding color for this account. """ + class UpdateParamsSettingsCapital(TypedDict): + payout_destination: NotRequired[Dict[str, str]] + """ + Per-currency mapping of user-selected destination accounts used to pay out loans. + """ + payout_destination_selector: NotRequired[Dict[str, List[str]]] + """ + Per-currency mapping of all destination accounts eligible to receive Capital financing payouts. + """ + class UpdateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "AccountService.UpdateParamsSettingsCardIssuingTosAcceptance" @@ -3714,6 +4212,12 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + class UpdateParamsSettingsTaxForms(TypedDict): + consented_to_paperless_delivery: NotRequired[bool] + """ + Whether the account opted out of receiving their tax forms by postal delivery. + """ + class UpdateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "AccountService.UpdateParamsSettingsTreasuryTosAcceptance" diff --git a/stripe/_account_session.py b/stripe/_account_session.py index e23a8c044..3d547fe58 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, cast +from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -87,6 +87,39 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class CapitalFinancing(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class CapitalFinancingApplication(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class CapitalFinancingPromotion(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class DisputesList(StripeObject): class Features(StripeObject): capture_payments: bool @@ -378,6 +411,9 @@ class Features(StripeObject): account_management: AccountManagement account_onboarding: AccountOnboarding balances: Balances + capital_financing: Optional[CapitalFinancing] + capital_financing_application: Optional[CapitalFinancingApplication] + capital_financing_promotion: Optional[CapitalFinancingPromotion] disputes_list: DisputesList documents: Documents financial_account: FinancialAccount @@ -396,6 +432,9 @@ class Features(StripeObject): "account_management": AccountManagement, "account_onboarding": AccountOnboarding, "balances": Balances, + "capital_financing": CapitalFinancing, + "capital_financing_application": CapitalFinancingApplication, + "capital_financing_promotion": CapitalFinancingPromotion, "disputes_list": DisputesList, "documents": Documents, "financial_account": FinancialAccount, @@ -439,10 +478,46 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + app_install: NotRequired[ + "AccountSession.CreateParamsComponentsAppInstall" + ] + """ + Configuration for the app install component. + """ + app_viewport: NotRequired[ + "AccountSession.CreateParamsComponentsAppViewport" + ] + """ + Configuration for the app viewport component. + """ balances: NotRequired["AccountSession.CreateParamsComponentsBalances"] """ Configuration for the balances embedded component. """ + capital_financing: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancing" + ] + """ + Configuration for the capital financing embedded component. + """ + capital_financing_application: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancingApplication" + ] + """ + Configuration for the capital financing application embedded component. + """ + capital_financing_promotion: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancingPromotion" + ] + """ + Configuration for the capital financing promotion embedded component. + """ + capital_overview: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalOverview" + ] + """ + Configuration for the capital overview embedded component. + """ disputes_list: NotRequired[ "AccountSession.CreateParamsComponentsDisputesList" ] @@ -455,6 +530,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + export_tax_transactions: NotRequired[ + "AccountSession.CreateParamsComponentsExportTaxTransactions" + ] + """ + Configuration for the export tax transactions embedded component. + """ financial_account: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccount" ] @@ -497,6 +578,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payment disputes embedded component. """ + payment_method_settings: NotRequired[ + "AccountSession.CreateParamsComponentsPaymentMethodSettings" + ] + """ + Configuration for the payment method settings embedded component. + """ payments: NotRequired["AccountSession.CreateParamsComponentsPayments"] """ Configuration for the payments embedded component. @@ -511,6 +598,24 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts list embedded component. """ + product_tax_code_selector: NotRequired[ + "AccountSession.CreateParamsComponentsProductTaxCodeSelector" + ] + """ + Configuration for the product tax code selector embedded component. + """ + recipients: NotRequired[ + "AccountSession.CreateParamsComponentsRecipients" + ] + """ + Configuration for the recipients component. + """ + reporting_chart: NotRequired[ + "AccountSession.CreateParamsComponentsReportingChart" + ] + """ + Configuration for the reporting chart embedded component. + """ tax_registrations: NotRequired[ "AccountSession.CreateParamsComponentsTaxRegistrations" ] @@ -523,6 +628,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the tax settings embedded component. """ + tax_threshold_monitoring: NotRequired[ + "AccountSession.CreateParamsComponentsTaxThresholdMonitoring" + ] + """ + Configuration for the tax threshold monitoring embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -568,6 +679,42 @@ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ + class CreateParamsComponentsAppInstall(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsAppInstallFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAppInstallFeatures(TypedDict): + allowed_apps: NotRequired["Literal['']|List[str]"] + """ + List of apps allowed to be enabled for this account session. + """ + + class CreateParamsComponentsAppViewport(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsAppViewportFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAppViewportFeatures(TypedDict): + allowed_apps: NotRequired["Literal['']|List[str]"] + """ + List of apps allowed to be enabled for this account session. + """ + class CreateParamsComponentsBalances(TypedDict): enabled: bool """ @@ -602,6 +749,66 @@ class CreateParamsComponentsBalancesFeatures(TypedDict): Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + class CreateParamsComponentsCapitalFinancing(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancingFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingApplication(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancingApplicationFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingApplicationFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalFinancingFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalFinancingPromotion(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalFinancingPromotionFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingPromotionFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalOverview(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsCapitalOverviewFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalOverviewFeatures(TypedDict): + pass + class CreateParamsComponentsDisputesList(TypedDict): enabled: bool """ @@ -647,6 +854,21 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsExportTaxTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsExportTaxTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsExportTaxTransactionsFeatures(TypedDict): + pass + class CreateParamsComponentsFinancialAccount(TypedDict): enabled: bool """ @@ -839,6 +1061,21 @@ class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): Whether to allow sending refunds. This is `true` by default. """ + class CreateParamsComponentsPaymentMethodSettings(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsPaymentMethodSettingsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPaymentMethodSettingsFeatures(TypedDict): + pass + class CreateParamsComponentsPayments(TypedDict): enabled: bool """ @@ -918,6 +1155,51 @@ class CreateParamsComponentsPayoutsList(TypedDict): class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass + class CreateParamsComponentsProductTaxCodeSelector(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsProductTaxCodeSelectorFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsProductTaxCodeSelectorFeatures(TypedDict): + pass + + class CreateParamsComponentsRecipients(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsRecipientsFeatures" + ] + + class CreateParamsComponentsRecipientsFeatures(TypedDict): + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + + class CreateParamsComponentsReportingChart(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsReportingChartFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsReportingChartFeatures(TypedDict): + pass + class CreateParamsComponentsTaxRegistrations(TypedDict): enabled: bool """ @@ -948,6 +1230,21 @@ class CreateParamsComponentsTaxSettings(TypedDict): class CreateParamsComponentsTaxSettingsFeatures(TypedDict): pass + class CreateParamsComponentsTaxThresholdMonitoring(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsTaxThresholdMonitoringFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxThresholdMonitoringFeatures(TypedDict): + pass + account: str """ The ID of the account the AccountSession was created for diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 5b88d2ff2..7980cf9e1 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -4,7 +4,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class AccountSessionService(StripeService): @@ -35,12 +35,48 @@ class CreateParamsComponents(TypedDict): """ Configuration for the account onboarding embedded component. """ + app_install: NotRequired[ + "AccountSessionService.CreateParamsComponentsAppInstall" + ] + """ + Configuration for the app install component. + """ + app_viewport: NotRequired[ + "AccountSessionService.CreateParamsComponentsAppViewport" + ] + """ + Configuration for the app viewport component. + """ balances: NotRequired[ "AccountSessionService.CreateParamsComponentsBalances" ] """ Configuration for the balances embedded component. """ + capital_financing: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancing" + ] + """ + Configuration for the capital financing embedded component. + """ + capital_financing_application: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancingApplication" + ] + """ + Configuration for the capital financing application embedded component. + """ + capital_financing_promotion: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancingPromotion" + ] + """ + Configuration for the capital financing promotion embedded component. + """ + capital_overview: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalOverview" + ] + """ + Configuration for the capital overview embedded component. + """ disputes_list: NotRequired[ "AccountSessionService.CreateParamsComponentsDisputesList" ] @@ -53,6 +89,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + export_tax_transactions: NotRequired[ + "AccountSessionService.CreateParamsComponentsExportTaxTransactions" + ] + """ + Configuration for the export tax transactions embedded component. + """ financial_account: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccount" ] @@ -95,6 +137,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payment disputes embedded component. """ + payment_method_settings: NotRequired[ + "AccountSessionService.CreateParamsComponentsPaymentMethodSettings" + ] + """ + Configuration for the payment method settings embedded component. + """ payments: NotRequired[ "AccountSessionService.CreateParamsComponentsPayments" ] @@ -113,6 +161,24 @@ class CreateParamsComponents(TypedDict): """ Configuration for the payouts list embedded component. """ + product_tax_code_selector: NotRequired[ + "AccountSessionService.CreateParamsComponentsProductTaxCodeSelector" + ] + """ + Configuration for the product tax code selector embedded component. + """ + recipients: NotRequired[ + "AccountSessionService.CreateParamsComponentsRecipients" + ] + """ + Configuration for the recipients component. + """ + reporting_chart: NotRequired[ + "AccountSessionService.CreateParamsComponentsReportingChart" + ] + """ + Configuration for the reporting chart embedded component. + """ tax_registrations: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxRegistrations" ] @@ -125,6 +191,12 @@ class CreateParamsComponents(TypedDict): """ Configuration for the tax settings embedded component. """ + tax_threshold_monitoring: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxThresholdMonitoring" + ] + """ + Configuration for the tax threshold monitoring embedded component. + """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool @@ -170,6 +242,42 @@ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. """ + class CreateParamsComponentsAppInstall(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsAppInstallFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAppInstallFeatures(TypedDict): + allowed_apps: NotRequired["Literal['']|List[str]"] + """ + List of apps allowed to be enabled for this account session. + """ + + class CreateParamsComponentsAppViewport(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsAppViewportFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsAppViewportFeatures(TypedDict): + allowed_apps: NotRequired["Literal['']|List[str]"] + """ + List of apps allowed to be enabled for this account session. + """ + class CreateParamsComponentsBalances(TypedDict): enabled: bool """ @@ -204,6 +312,66 @@ class CreateParamsComponentsBalancesFeatures(TypedDict): Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ + class CreateParamsComponentsCapitalFinancing(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancingFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingApplication(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancingApplicationFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingApplicationFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalFinancingFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalFinancingPromotion(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalFinancingPromotionFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalFinancingPromotionFeatures(TypedDict): + pass + + class CreateParamsComponentsCapitalOverview(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsCapitalOverviewFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsCapitalOverviewFeatures(TypedDict): + pass + class CreateParamsComponentsDisputesList(TypedDict): enabled: bool """ @@ -249,6 +417,21 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsExportTaxTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsExportTaxTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsExportTaxTransactionsFeatures(TypedDict): + pass + class CreateParamsComponentsFinancialAccount(TypedDict): enabled: bool """ @@ -441,6 +624,21 @@ class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): Whether to allow sending refunds. This is `true` by default. """ + class CreateParamsComponentsPaymentMethodSettings(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsPaymentMethodSettingsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsPaymentMethodSettingsFeatures(TypedDict): + pass + class CreateParamsComponentsPayments(TypedDict): enabled: bool """ @@ -520,6 +718,51 @@ class CreateParamsComponentsPayoutsList(TypedDict): class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass + class CreateParamsComponentsProductTaxCodeSelector(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsProductTaxCodeSelectorFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsProductTaxCodeSelectorFeatures(TypedDict): + pass + + class CreateParamsComponentsRecipients(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsRecipientsFeatures" + ] + + class CreateParamsComponentsRecipientsFeatures(TypedDict): + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + + class CreateParamsComponentsReportingChart(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsReportingChartFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsReportingChartFeatures(TypedDict): + pass + class CreateParamsComponentsTaxRegistrations(TypedDict): enabled: bool """ @@ -550,6 +793,21 @@ class CreateParamsComponentsTaxSettings(TypedDict): class CreateParamsComponentsTaxSettingsFeatures(TypedDict): pass + class CreateParamsComponentsTaxThresholdMonitoring(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsTaxThresholdMonitoringFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsTaxThresholdMonitoringFeatures(TypedDict): + pass + def create( self, params: "AccountSessionService.CreateParams", diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index c0fa8a561..dd850e207 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -36,7 +36,10 @@ import stripe.oauth_error as oauth_error from stripe._multipart_data_generator import MultipartDataGenerator from urllib.parse import urlencode -from stripe._encode import _api_encode, _json_encode_date_callback +from stripe._encode import ( + _api_encode, + _json_encode_date_callback, +) from stripe._stripe_response import ( StripeResponse, StripeStreamResponse, @@ -368,6 +371,31 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): # switchCases: The beginning of the section generated from our OpenAPI spec elif type == "temporary_session_expired": return error.TemporarySessionExpiredError(**error_args) + elif type == "financial_account_not_open": + return error.FinancialAccountNotOpenError(**error_args) + elif type == "blocked_by_stripe": + return error.BlockedByStripeError(**error_args) + elif type == "already_canceled": + return error.AlreadyCanceledError(**error_args) + elif type == "not_cancelable": + return error.NotCancelableError(**error_args) + elif type == "insufficient_funds": + return error.InsufficientFundsError(**error_args) + elif type == "quota_exceeded": + return error.QuotaExceededError(**error_args) + elif type == "recipient_not_notifiable": + return error.RecipientNotNotifiableError(**error_args) + elif type == "feature_not_enabled": + return error.FeatureNotEnabledError(**error_args) + elif type == "invalid_payout_method": + return error.InvalidPayoutMethodError(**error_args) + elif type == "controlled_by_dashboard": + return error.ControlledByDashboardError(**error_args) + elif type == "invalid_payment_method": + return error.InvalidPaymentMethodError( + **error_args, + invalid_param=error_data.get("invalid_param"), + ) # switchCases: The end of the section generated from our OpenAPI spec return self.specific_v1_api_error( diff --git a/stripe/_api_version.py b/stripe/_api_version.py index bced0a8d9..f4435ce79 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-05-28.basil" + CURRENT = "2025-05-28.preview" diff --git a/stripe/_balance_settings.py b/stripe/_balance_settings.py new file mode 100644 index 000000000..73364b657 --- /dev/null +++ b/stripe/_balance_settings.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._singleton_api_resource import SingletonAPIResource +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from typing import ClassVar, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class BalanceSettings( + SingletonAPIResource["BalanceSettings"], + UpdateableAPIResource["BalanceSettings"], +): + """ + Options for customizing account balances and payout settings for a Stripe platform's connected accounts. + + This API is only available for users enrolled in the public preview for Accounts v2 on Stripe Connect. + If you are not in this preview, please use the [Accounts v1 API](https://docs.stripe.com/api/accounts?api-version=2025-03-31.basil) + to manage your connected accounts' balance settings instead. + """ + + OBJECT_NAME: ClassVar[Literal["balance_settings"]] = "balance_settings" + + class Payouts(StripeObject): + class Schedule(StripeObject): + interval: Optional[Literal["daily", "manual", "monthly", "weekly"]] + """ + How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. + """ + monthly_anchor: Optional[int] + """ + The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + """ + weekly_anchor: Optional[ + Literal["friday", "monday", "thursday", "tuesday", "wednesday"] + ] + """ + The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. + """ + + schedule: Optional[Schedule] + """ + Details on when funds from charges are available, and when they are paid out to an external account. See our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation for details. + """ + statement_descriptor: Optional[str] + """ + The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + """ + status: Literal["disabled", "enabled"] + """ + Whether the funds in this account can be paid out. + """ + _inner_class_types = {"schedule": Schedule} + + class SettlementTiming(StripeObject): + delay_days: int + """ + The number of days charge funds are held before becoming available. + """ + + class ModifyParams(RequestOptions): + debit_negative_balances: NotRequired[bool] + """ + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payouts: NotRequired["BalanceSettings.ModifyParamsPayouts"] + """ + Settings specific to the account's payouts. + """ + settlement_timing: NotRequired[ + "BalanceSettings.ModifyParamsSettlementTiming" + ] + """ + Settings related to the account's balance settlement timing. + """ + + class ModifyParamsPayouts(TypedDict): + schedule: NotRequired["BalanceSettings.ModifyParamsPayoutsSchedule"] + """ + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. + """ + statement_descriptor: NotRequired[str] + """ + The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + """ + + class ModifyParamsPayoutsSchedule(TypedDict): + interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] + """ + How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + """ + monthly_anchor: NotRequired[int] + """ + The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + """ + weekly_anchor: NotRequired[ + Literal["friday", "monday", "thursday", "tuesday", "wednesday"] + ] + """ + The day of the week when available funds are paid out (required and applicable only if `interval` is `weekly`.) + """ + + class ModifyParamsSettlementTiming(TypedDict): + delay_days: NotRequired[int] + """ + The number of days charge funds are held before becoming available. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `payouts.schedule.interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + debit_negative_balances: Optional[bool] + """ + A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](https://docs.stripe.com/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. + """ + object: Literal["balance_settings"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payouts: Optional[Payouts] + """ + Settings specific to the account's payouts. + """ + settlement_timing: SettlementTiming + + @classmethod + def modify( + cls, **params: Unpack["BalanceSettings.ModifyParams"] + ) -> "BalanceSettings": + """ + Updates balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + "BalanceSettings", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, **params: Unpack["BalanceSettings.ModifyParams"] + ) -> "BalanceSettings": + """ + Updates balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + "BalanceSettings", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, **params: Unpack["BalanceSettings.RetrieveParams"] + ) -> "BalanceSettings": + """ + Retrieves balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + instance = cls(None, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, **params: Unpack["BalanceSettings.RetrieveParams"] + ) -> "BalanceSettings": + """ + Retrieves balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/balance_settings" + + _inner_class_types = { + "payouts": Payouts, + "settlement_timing": SettlementTiming, + } diff --git a/stripe/_balance_settings_service.py b/stripe/_balance_settings_service.py new file mode 100644 index 000000000..2b203127f --- /dev/null +++ b/stripe/_balance_settings_service.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._balance_settings import BalanceSettings +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class BalanceSettingsService(StripeService): + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + debit_negative_balances: NotRequired[bool] + """ + A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payouts: NotRequired["BalanceSettingsService.UpdateParamsPayouts"] + """ + Settings specific to the account's payouts. + """ + settlement_timing: NotRequired[ + "BalanceSettingsService.UpdateParamsSettlementTiming" + ] + """ + Settings related to the account's balance settlement timing. + """ + + class UpdateParamsPayouts(TypedDict): + schedule: NotRequired[ + "BalanceSettingsService.UpdateParamsPayoutsSchedule" + ] + """ + Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. + """ + statement_descriptor: NotRequired[str] + """ + The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + """ + + class UpdateParamsPayoutsSchedule(TypedDict): + interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] + """ + How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + """ + monthly_anchor: NotRequired[int] + """ + The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + """ + weekly_anchor: NotRequired[ + Literal["friday", "monday", "thursday", "tuesday", "wednesday"] + ] + """ + The day of the week when available funds are paid out (required and applicable only if `interval` is `weekly`.) + """ + + class UpdateParamsSettlementTiming(TypedDict): + delay_days: NotRequired[int] + """ + The number of days charge funds are held before becoming available. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `payouts.schedule.interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). + """ + + def retrieve( + self, + params: "BalanceSettingsService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> BalanceSettings: + """ + Retrieves balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + BalanceSettings, + self._request( + "get", + "/v1/balance_settings", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: "BalanceSettingsService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> BalanceSettings: + """ + Retrieves balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + BalanceSettings, + await self._request_async( + "get", + "/v1/balance_settings", + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + params: "BalanceSettingsService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> BalanceSettings: + """ + Updates balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + BalanceSettings, + self._request( + "post", + "/v1/balance_settings", + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + params: "BalanceSettingsService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> BalanceSettings: + """ + Updates balance settings for a given connected account. + Related guide: [Making API calls for connected accounts](https://docs.stripe.com/connect/authentication) + """ + return cast( + BalanceSettings, + await self._request_async( + "post", + "/v1/balance_settings", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_capital_service.py b/stripe/_capital_service.py new file mode 100644 index 000000000..9a9fa3097 --- /dev/null +++ b/stripe/_capital_service.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.capital._financing_offer_service import FinancingOfferService +from stripe.capital._financing_summary_service import FinancingSummaryService +from stripe.capital._financing_transaction_service import ( + FinancingTransactionService, +) + + +class CapitalService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.financing_offers = FinancingOfferService(self._requestor) + self.financing_summary = FinancingSummaryService(self._requestor) + self.financing_transactions = FinancingTransactionService( + self._requestor, + ) diff --git a/stripe/_card.py b/stripe/_card.py index fc8aaa48b..356004925 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -81,6 +81,10 @@ class DeleteParams(RequestOptions): """ Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. diff --git a/stripe/_cash_balance.py b/stripe/_cash_balance.py index 287e786a8..6aab8c917 100644 --- a/stripe/_cash_balance.py +++ b/stripe/_cash_balance.py @@ -32,6 +32,10 @@ class Settings(StripeObject): """ The ID of the customer whose cash balance this object represents. """ + customer_account: Optional[str] + """ + The ID of the account whose cash balance this object represents. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. diff --git a/stripe/_charge.py b/stripe/_charge.py index a72febb79..ecc5cf171 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -317,6 +317,10 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. @@ -450,6 +454,12 @@ class Checks(StripeObject): If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ + class DecrementalAuthorization(StripeObject): + status: Literal["available", "unavailable"] + """ + Indicates whether or not the decremental authorization feature is supported. + """ + class ExtendedAuthorization(StripeObject): status: Literal["disabled", "enabled"] """ @@ -506,6 +516,17 @@ class Overcapture(StripeObject): Indicates whether or not the authorized amount can be over-captured. """ + class PartialAuthorization(StripeObject): + status: Literal[ + "declined", + "fully_authorized", + "not_requested", + "partially_authorized", + ] + """ + Indicates whether the transaction requested for partial authorization feature and the authorization outcome. + """ + class ThreeDSecure(StripeObject): authentication_flow: Optional[ Literal["challenge", "frictionless"] @@ -769,6 +790,10 @@ class ShippingAddress(StripeObject): """ The authorized amount. """ + amount_requested: Optional[int] + """ + The latest amount intended to be authorized by this charge. + """ authorization_code: Optional[str] """ Authorization code on the charge. @@ -789,6 +814,7 @@ class ShippingAddress(StripeObject): """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ + decremental_authorization: Optional[DecrementalAuthorization] description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) @@ -853,6 +879,7 @@ class ShippingAddress(StripeObject): This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ overcapture: Optional[Overcapture] + partial_authorization: Optional[PartialAuthorization] regulated_status: Optional[Literal["regulated", "unregulated"]] """ Status of a card based on the card issuer. @@ -867,12 +894,14 @@ class ShippingAddress(StripeObject): """ _inner_class_types = { "checks": Checks, + "decremental_authorization": DecrementalAuthorization, "extended_authorization": ExtendedAuthorization, "incremental_authorization": IncrementalAuthorization, "installments": Installments, "multicapture": Multicapture, "network_token": NetworkToken, "overcapture": Overcapture, + "partial_authorization": PartialAuthorization, "three_d_secure": ThreeDSecure, "wallet": Wallet, } @@ -1162,12 +1191,37 @@ class Giropay(StripeObject): Giropay rarely provides this information so the attribute is usually empty. """ + class Gopay(StripeObject): + pass + class Grabpay(StripeObject): transaction_id: Optional[str] """ Unique transaction id generated by GrabPay """ + class IdBankTransfer(StripeObject): + account_number: str + """ + Account number of the bank account to transfer funds to. + """ + bank: Literal["bca", "bni", "bri", "cimb", "permata"] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1456,6 +1510,9 @@ class Link(StripeObject): You could use this attribute to get a sense of international fees. """ + class MbWay(StripeObject): + pass + class Mobilepay(StripeObject): class Card(StripeObject): brand: Optional[str] @@ -1608,6 +1665,58 @@ class SellerProtection(StripeObject): Indicates whether the transaction is eligible for PayPal's seller protection. """ + class Shipping(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class VerifiedAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + country: Optional[str] """ Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. @@ -1630,11 +1739,55 @@ class SellerProtection(StripeObject): """ The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. """ + shipping: Optional[Shipping] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ transaction_id: Optional[str] """ A unique ID generated by PayPal for this transaction. """ - _inner_class_types = {"seller_protection": SellerProtection} + verified_address: Optional[VerifiedAddress] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + _inner_class_types = { + "seller_protection": SellerProtection, + "shipping": Shipping, + "verified_address": VerifiedAddress, + } + + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ class Pix(StripeObject): bank_transaction_id: Optional[str] @@ -1648,6 +1801,12 @@ class Promptpay(StripeObject): Bill reference generated by PromptPay """ + class Qris(StripeObject): + pass + + class Rechnung(StripeObject): + pass + class RevolutPay(StripeObject): class Funding(StripeObject): class Card(StripeObject): @@ -1655,6 +1814,10 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. @@ -1735,6 +1898,9 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). """ + class Shopeepay(StripeObject): + pass + class Sofort(StripeObject): bank_code: Optional[str] """ @@ -1780,6 +1946,16 @@ class Sofort(StripeObject): class StripeAccount(StripeObject): pass + class StripeBalance(StripeObject): + account: Optional[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: Literal["bank_account", "card", "fpx"] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class Swish(StripeObject): fingerprint: Optional[str] """ @@ -1876,7 +2052,9 @@ class Zip(StripeObject): eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -1884,6 +2062,7 @@ class Zip(StripeObject): konbini: Optional[Konbini] kr_card: Optional[KrCard] link: Optional[Link] + mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] @@ -1894,15 +2073,20 @@ class Zip(StripeObject): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] promptpay: Optional[Promptpay] + qris: Optional[Qris] + rechnung: Optional[Rechnung] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] + stripe_balance: Optional[StripeBalance] swish: Optional[Swish] twint: Optional[Twint] type: str @@ -1937,7 +2121,9 @@ class Zip(StripeObject): "eps": Eps, "fpx": Fpx, "giropay": Giropay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -1945,6 +2131,7 @@ class Zip(StripeObject): "konbini": Konbini, "kr_card": KrCard, "link": Link, + "mb_way": MbWay, "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, @@ -1955,15 +2142,20 @@ class Zip(StripeObject): "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "promptpay": Promptpay, + "qris": Qris, + "rechnung": Rechnung, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, + "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, @@ -2061,6 +2253,10 @@ class CaptureParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + payment_details: NotRequired["Charge.CaptureParamsPaymentDetails"] + """ + Provides industry-specific information about the charge. + """ receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. @@ -2084,125 +2280,217 @@ class CaptureParams(RequestOptions): A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ - class CaptureParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsPaymentDetails(TypedDict): + car_rental: NotRequired["Charge.CaptureParamsPaymentDetailsCarRental"] """ - The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["Charge.CaptureParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired["Charge.CaptureParamsPaymentDetailsLodging"] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "Charge.CaptureParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent """ - class CreateParams(RequestOptions): - amount: NotRequired[int] + class CaptureParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalAffiliate" + ] """ - Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + Affiliate details for this purchase. """ - application_fee: NotRequired[int] - application_fee_amount: NotRequired[int] + booking_number: str """ - A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). + The booking number associated with the car rental. """ - capture: NotRequired[bool] + car_class_code: NotRequired[str] """ - Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + Class code of the car. """ - currency: NotRequired[str] + car_make: NotRequired[str] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Make of the car. """ - customer: NotRequired[str] + car_model: NotRequired[str] """ - The ID of an existing customer that will be charged in this request. + Model of the car. """ - description: NotRequired[str] + company: NotRequired[str] """ - An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + The name of the rental car company. """ - destination: NotRequired["Charge.CreateParamsDestination"] - expand: NotRequired[List[str]] + customer_service_phone_number: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The customer service phone number of the car rental company. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + days_rented: int """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + Number of days the car is being rented. """ - on_behalf_of: NotRequired[str] + delivery: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalDelivery" + ] """ - The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). + Delivery details for this purchase. """ - radar_options: NotRequired["Charge.CreateParamsRadarOptions"] + distance: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalDistance" + ] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + The details of the distance traveled during the rental period. """ - receipt_email: NotRequired[str] + drivers: NotRequired[ + List["Charge.CaptureParamsPaymentDetailsCarRentalDriver"] + ] """ - The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + The details of the passengers in the travel reservation """ - shipping: NotRequired["Charge.CreateParamsShipping"] + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] """ - Shipping information for the charge. Helps prevent fraud on charges for physical goods. + List of additional charges being billed. """ - source: NotRequired[str] + no_show: NotRequired[bool] """ - A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + Indicates if the customer did not keep nor cancel their booking. """ - statement_descriptor: NotRequired[str] + pickup_address: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalPickupAddress" + ] """ - For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - - For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + Car pick-up address. """ - statement_descriptor_suffix: NotRequired[str] + pickup_at: int """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Car pick-up time. Measured in seconds since the Unix epoch. """ - transfer_data: NotRequired["Charge.CreateParamsTransferData"] + pickup_location_name: NotRequired[str] """ - An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + Name of the pickup location. """ - transfer_group: NotRequired[str] + rate_amount: NotRequired[int] """ - A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + Rental rate. """ - - class CreateParamsDestination(TypedDict): - account: str + rate_interval: NotRequired[Literal["day", "month", "week"]] """ - ID of an existing, connected Stripe account. + The frequency at which the rate amount is applied. One of `day`, `week` or `month` """ - amount: NotRequired[int] + renter_name: NotRequired[str] """ - The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. """ - class CreateParamsRadarOptions(TypedDict): - session: NotRequired[str] + class CaptureParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + The name of the affiliate that originated the purchase. """ - class CreateParamsShipping(TypedDict): - address: "Charge.CreateParamsShippingAddress" + class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Shipping address. + The delivery method for the payment """ - carrier: NotRequired[str] + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" + ] """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + Details of the recipient. """ - name: str + + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Recipient name. + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. """ phone: NotRequired[str] """ - Recipient phone (including extension). + The phone number of the recipient the ticket is delivered to. """ - tracking_number: NotRequired[str] + + class CaptureParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - class CreateParamsShippingAddress(TypedDict): + class CaptureParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ + + class CaptureParamsPaymentDetailsCarRentalPickupAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -2228,124 +2516,1420 @@ class CreateParamsShippingAddress(TypedDict): State, county, province, or region. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + City, district, suburb, town, or village. """ - destination: str + country: NotRequired[str] """ - ID of an existing, connected Stripe account. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - - class ListParams(RequestOptions): - created: NotRequired["Charge.ListParamsCreated|int"] + line1: NotRequired[str] """ - Only return charges that were created during the given date interval. + Address line 1 (e.g., street, PO Box, or company name). """ - customer: NotRequired[str] + line2: NotRequired[str] """ - Only return charges for the customer specified by this customer ID. + Address line 2 (e.g., apartment, suite, unit, or building). """ - ending_before: NotRequired[str] + postal_code: 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. + ZIP or postal code. """ - expand: NotRequired[List[str]] + state: NotRequired[str] """ - Specifies which fields in the response should be expanded. + State, county, province, or region. """ - limit: NotRequired[int] + + class CaptureParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Indicates if the tickets are digitally checked when entering the venue. """ - payment_intent: NotRequired[str] + address: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetailsAddress" + ] """ - Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + The event location's address. """ - starting_after: NotRequired[str] + affiliate: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetailsAffiliate" + ] """ - 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. + Affiliate details for this purchase. """ - transfer_group: NotRequired[str] + company: NotRequired[str] """ - Only return charges for this transfer group, limited to 100. + The name of the company """ - - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + delivery: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. + """ + + class CaptureParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CaptureParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CaptureParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "Charge.CaptureParamsPaymentDetailsFlightAffiliate" + ] + """ + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "Charge.CaptureParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["Charge.CaptureParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List["Charge.CaptureParamsPaymentDetailsFlightSegment"] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. + """ + + class CaptureParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CaptureParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ + + class CaptureParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ + + class CaptureParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "Charge.CaptureParamsPaymentDetailsLodgingAddress" + ] + """ + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "Charge.CaptureParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "Charge.CaptureParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["Charge.CaptureParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ + + class CaptureParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CaptureParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CaptureParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class CaptureParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "Charge.CaptureParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "Charge.CaptureParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class CaptureParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + class CaptureParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + """ + + class CreateParams(RequestOptions): + amount: NotRequired[int] + """ + Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee: NotRequired[int] + application_fee_amount: NotRequired[int] + """ + A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). + """ + capture: NotRequired[bool] + """ + Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The ID of an existing customer that will be charged in this request. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + """ + destination: NotRequired["Charge.CreateParamsDestination"] + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). + """ + radar_options: NotRequired["Charge.CreateParamsRadarOptions"] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + receipt_email: NotRequired[str] + """ + The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + """ + shipping: NotRequired["Charge.CreateParamsShipping"] + """ + Shipping information for the charge. Helps prevent fraud on charges for physical goods. + """ + source: NotRequired[str] + """ + A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + """ + statement_descriptor: NotRequired[str] + """ + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + """ + transfer_data: NotRequired["Charge.CreateParamsTransferData"] + """ + An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + """ + transfer_group: NotRequired[str] + """ + A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + """ + + class CreateParamsDestination(TypedDict): + account: str + """ + ID of an existing, connected Stripe account. + """ + amount: NotRequired[int] + """ + The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. + """ + + class CreateParamsRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsShipping(TypedDict): + address: "Charge.CreateParamsShippingAddress" + """ + Shipping address. + """ + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + + class CreateParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class ListParams(RequestOptions): + created: NotRequired["Charge.ListParamsCreated|int"] + """ + Only return charges that were created during the given date interval. + """ + customer: NotRequired[str] + """ + Only return charges for the customer specified by this customer ID. + """ + 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. + """ + payment_intent: NotRequired[str] + """ + Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + """ + 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. + """ + transfer_group: NotRequired[str] + """ + Only return charges for this transfer group, limited to 100. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class ListRefundsParams(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. + """ + + class ModifyParams(RequestOptions): + customer: NotRequired[str] + """ + The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fraud_details: NotRequired["Charge.ModifyParamsFraudDetails"] + """ + A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_details: NotRequired["Charge.ModifyParamsPaymentDetails"] + """ + Provides industry-specific information about the charge. + """ + receipt_email: NotRequired[str] + """ + This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. + """ + shipping: NotRequired["Charge.ModifyParamsShipping"] + """ + Shipping information for the charge. Helps prevent fraud on charges for physical goods. + """ + transfer_group: NotRequired[str] + """ + A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + """ + + class ModifyParamsFraudDetails(TypedDict): + user_report: Union[Literal[""], Literal["fraudulent", "safe"]] + """ + Either `safe` or `fraudulent`. + """ + + class ModifyParamsPaymentDetails(TypedDict): + car_rental: NotRequired["Charge.ModifyParamsPaymentDetailsCarRental"] + """ + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["Charge.ModifyParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired["Charge.ModifyParamsPaymentDetailsLodging"] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "Charge.ModifyParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent + """ + + class ModifyParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List["Charge.ModifyParamsPaymentDetailsCarRentalDriver"] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalPickupAddress" + ] + """ + Car pick-up address. + """ + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: NotRequired[str] + """ + Name of the pickup location. + """ + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. + """ + + class ModifyParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class ModifyParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class ModifyParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class ModifyParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] + """ + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ + + class ModifyParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ + + class ModifyParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ModifyParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. """ - Minimum value to filter by (exclusive) + state: NotRequired[str] """ - gte: NotRequired[int] + State, county, province, or region. """ - Minimum value to filter by (inclusive) + + class ModifyParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - lt: NotRequired[int] + Indicates if the tickets are digitally checked when entering the venue. """ - Maximum value to filter by (exclusive) + address: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetailsAddress" + ] """ - lte: NotRequired[int] + The event location's address. """ - Maximum value to filter by (inclusive) + affiliate: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetailsAffiliate" + ] + """ + Affiliate details for this purchase. + """ + company: NotRequired[str] + """ + The name of the company + """ + delivery: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. """ - class ListRefundsParams(RequestOptions): - ending_before: NotRequired[str] + class ModifyParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: 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. + City, district, suburb, town, or village. """ - expand: NotRequired[List[str]] + country: NotRequired[str] """ - Specifies which fields in the response should be expanded. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - limit: NotRequired[int] + line1: NotRequired[str] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Address line 1 (e.g., street, PO Box, or company name). """ - starting_after: NotRequired[str] + line2: 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. + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ModifyParams(RequestOptions): - customer: NotRequired[str] + class ModifyParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. + The name of the affiliate that originated the purchase. """ - description: NotRequired[str] + + class ModifyParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + The delivery method for the payment """ - expand: NotRequired[List[str]] + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] """ - Specifies which fields in the response should be expanded. + Details of the recipient. """ - fraud_details: NotRequired["Charge.ModifyParamsFraudDetails"] + + class ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. + The email of the recipient the ticket is delivered to. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + name: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + The name of the recipient the ticket is delivered to. """ - receipt_email: NotRequired[str] + phone: NotRequired[str] """ - This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. + The phone number of the recipient the ticket is delivered to. """ - shipping: NotRequired["Charge.ModifyParamsShipping"] + + class ModifyParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "Charge.ModifyParamsPaymentDetailsFlightAffiliate" + ] """ - Shipping information for the charge. Helps prevent fraud on charges for physical goods. + Affiliate details for this purchase. """ - transfer_group: NotRequired[str] + agency_number: NotRequired[str] """ - A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "Charge.ModifyParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["Charge.ModifyParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List["Charge.ModifyParamsPaymentDetailsFlightSegment"] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - class ModifyParamsFraudDetails(TypedDict): - user_report: Union[Literal[""], Literal["fraudulent", "safe"]] + class ModifyParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str """ - Either `safe` or `fraudulent`. + The name of the affiliate that originated the purchase. + """ + + class ModifyParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class ModifyParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class ModifyParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ + + class ModifyParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ + + class ModifyParamsPaymentDetailsLodging(TypedDict): + address: NotRequired["Charge.ModifyParamsPaymentDetailsLodgingAddress"] + """ + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "Charge.ModifyParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "Charge.ModifyParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["Charge.ModifyParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ + + class ModifyParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ModifyParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class ModifyParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "Charge.ModifyParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class ModifyParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class ModifyParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class ModifyParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "Charge.ModifyParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "Charge.ModifyParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class ModifyParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class ModifyParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ class ModifyParamsShipping(TypedDict): diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 442c90539..0f69c27c4 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -28,6 +28,12 @@ class CaptureParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + payment_details: NotRequired[ + "ChargeService.CaptureParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. @@ -51,125 +57,247 @@ class CaptureParams(TypedDict): A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ - class CaptureParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRental" + ] """ - The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["ChargeService.CaptureParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsLodging" + ] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent """ - class CreateParams(TypedDict): - amount: NotRequired[int] + class CaptureParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalAffiliate" + ] """ - Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + Affiliate details for this purchase. """ - application_fee: NotRequired[int] - application_fee_amount: NotRequired[int] + booking_number: str """ - A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). + The booking number associated with the car rental. """ - capture: NotRequired[bool] + car_class_code: NotRequired[str] """ - Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + Class code of the car. """ - currency: NotRequired[str] + car_make: NotRequired[str] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Make of the car. """ - customer: NotRequired[str] + car_model: NotRequired[str] """ - The ID of an existing customer that will be charged in this request. + Model of the car. """ - description: NotRequired[str] + company: NotRequired[str] """ - An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + The name of the rental car company. """ - destination: NotRequired["ChargeService.CreateParamsDestination"] - expand: NotRequired[List[str]] + customer_service_phone_number: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The customer service phone number of the car rental company. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + days_rented: int """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + Number of days the car is being rented. """ - on_behalf_of: NotRequired[str] + delivery: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalDelivery" + ] """ - The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). + Delivery details for this purchase. """ - radar_options: NotRequired["ChargeService.CreateParamsRadarOptions"] + distance: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalDistance" + ] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + The details of the distance traveled during the rental period. """ - receipt_email: NotRequired[str] + drivers: NotRequired[ + List["ChargeService.CaptureParamsPaymentDetailsCarRentalDriver"] + ] """ - The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + The details of the passengers in the travel reservation """ - shipping: NotRequired["ChargeService.CreateParamsShipping"] + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] """ - Shipping information for the charge. Helps prevent fraud on charges for physical goods. + List of additional charges being billed. """ - source: NotRequired[str] + no_show: NotRequired[bool] """ - A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + Indicates if the customer did not keep nor cancel their booking. """ - statement_descriptor: NotRequired[str] + pickup_address: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalPickupAddress" + ] """ - For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - - For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + Car pick-up address. """ - statement_descriptor_suffix: NotRequired[str] + pickup_at: int """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + Car pick-up time. Measured in seconds since the Unix epoch. """ - transfer_data: NotRequired["ChargeService.CreateParamsTransferData"] + pickup_location_name: NotRequired[str] """ - An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + Name of the pickup location. """ - transfer_group: NotRequired[str] + rate_amount: NotRequired[int] """ - A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. """ - class CreateParamsDestination(TypedDict): - account: str + class CaptureParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - ID of an existing, connected Stripe account. + The name of the affiliate that originated the purchase. """ - amount: NotRequired[int] + + class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. """ - class CreateParamsRadarOptions(TypedDict): - session: NotRequired[str] + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class CreateParamsShipping(TypedDict): - address: "ChargeService.CreateParamsShippingAddress" + class CaptureParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - Shipping address. + Distance traveled. """ - carrier: NotRequired[str] + unit: NotRequired[Literal["kilometers", "miles"]] """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ + + class CaptureParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. """ name: str """ - Recipient name. + Full name of the person or entity on the car reservation. """ - phone: NotRequired[str] + + class CaptureParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - Recipient phone (including extension). + City, district, suburb, town, or village. """ - tracking_number: NotRequired[str] + country: NotRequired[str] """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class CreateParamsShippingAddress(TypedDict): + class CaptureParamsPaymentDetailsCarRentalReturnAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -195,130 +323,1408 @@ class CreateParamsShippingAddress(TypedDict): State, county, province, or region. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + Indicates if the tickets are digitally checked when entering the venue. """ - destination: str + address: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsEventDetailsAddress" + ] """ - ID of an existing, connected Stripe account. + The event location's address. + """ + affiliate: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsEventDetailsAffiliate" + ] + """ + Affiliate details for this purchase. + """ + company: NotRequired[str] + """ + The name of the company + """ + delivery: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. """ - class ListParams(TypedDict): - created: NotRequired["ChargeService.ListParamsCreated|int"] + class CaptureParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - Only return charges that were created during the given date interval. + City, district, suburb, town, or village. """ - customer: NotRequired[str] + country: NotRequired[str] """ - Only return charges for the customer specified by this customer ID. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - ending_before: NotRequired[str] + line1: 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. + Address line 1 (e.g., street, PO Box, or company name). """ - expand: NotRequired[List[str]] + line2: NotRequired[str] """ - Specifies which fields in the response should be expanded. + Address line 2 (e.g., apartment, suite, unit, or building). """ - limit: NotRequired[int] + postal_code: NotRequired[str] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + ZIP or postal code. """ - payment_intent: NotRequired[str] + state: NotRequired[str] """ - Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + State, county, province, or region. """ - starting_after: NotRequired[str] + + class CaptureParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: 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. + The name of the affiliate that originated the purchase. """ - transfer_group: NotRequired[str] + + class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Only return charges for this transfer group, limited to 100. + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] + """ + Details of the recipient. """ - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Minimum value to filter by (exclusive) + The email of the recipient the ticket is delivered to. """ - gte: NotRequired[int] + name: NotRequired[str] """ - Minimum value to filter by (inclusive) + The name of the recipient the ticket is delivered to. """ - lt: NotRequired[int] + phone: NotRequired[str] """ - Maximum value to filter by (exclusive) + The phone number of the recipient the ticket is delivered to. """ - lte: NotRequired[int] + + class CaptureParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsFlightAffiliate" + ] """ - Maximum value to filter by (inclusive) + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["ChargeService.CaptureParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List[ + "ChargeService.CaptureParamsPaymentDetailsFlightSegment" + ] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - class RetrieveParams(TypedDict): - expand: NotRequired[List[str]] + class CaptureParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str """ - Specifies which fields in the response should be expanded. + The name of the affiliate that originated the purchase. """ - class SearchParams(TypedDict): - expand: NotRequired[List[str]] + class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Specifies which fields in the response should be expanded. + The delivery method for the payment """ - limit: NotRequired[int] + recipient: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsFlightDeliveryRecipient" + ] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Details of the recipient. """ - page: NotRequired[str] + + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + The email of the recipient the ticket is delivered to. """ - query: str + name: NotRequired[str] """ - The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class UpdateParams(TypedDict): - customer: NotRequired[str] + class CaptureParamsPaymentDetailsFlightPassenger(TypedDict): + name: str """ - The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. + Full name of the person or entity on the flight reservation. """ - description: NotRequired[str] + + class CaptureParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + The flight segment amount. """ - expand: NotRequired[List[str]] + arrival_airport: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The International Air Transport Association (IATA) airport code for the arrival airport. """ - fraud_details: NotRequired["ChargeService.UpdateParamsFraudDetails"] + arrives_at: NotRequired[int] """ - A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. + The arrival time for the flight segment. Measured in seconds since the Unix epoch. """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + carrier: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. """ - receipt_email: NotRequired[str] + departs_at: int """ - This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. + The departure time for the flight segment. Measured in seconds since the Unix epoch. """ - shipping: NotRequired["ChargeService.UpdateParamsShipping"] + departure_airport: NotRequired[str] """ - Shipping information for the charge. Helps prevent fraud on charges for physical goods. + The International Air Transport Association (IATA) airport code for the departure airport. """ - transfer_group: NotRequired[str] + flight_number: NotRequired[str] """ - A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. """ - class UpdateParamsFraudDetails(TypedDict): - user_report: Union[Literal[""], Literal["fraudulent", "safe"]] + class CaptureParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsLodgingAddress" + ] """ - Either `safe` or `fraudulent`. + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["ChargeService.CaptureParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ + + class CaptureParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CaptureParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CaptureParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class CaptureParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "ChargeService.CaptureParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class CaptureParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CaptureParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + class CaptureParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + """ + + class CreateParams(TypedDict): + amount: NotRequired[int] + """ + Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee: NotRequired[int] + application_fee_amount: NotRequired[int] + """ + A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). + """ + capture: NotRequired[bool] + """ + Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The ID of an existing customer that will be charged in this request. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + """ + destination: NotRequired["ChargeService.CreateParamsDestination"] + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). + """ + radar_options: NotRequired["ChargeService.CreateParamsRadarOptions"] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + receipt_email: NotRequired[str] + """ + The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + """ + shipping: NotRequired["ChargeService.CreateParamsShipping"] + """ + Shipping information for the charge. Helps prevent fraud on charges for physical goods. + """ + source: NotRequired[str] + """ + A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + """ + statement_descriptor: NotRequired[str] + """ + For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + """ + transfer_data: NotRequired["ChargeService.CreateParamsTransferData"] + """ + An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + """ + transfer_group: NotRequired[str] + """ + A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + """ + + class CreateParamsDestination(TypedDict): + account: str + """ + ID of an existing, connected Stripe account. + """ + amount: NotRequired[int] + """ + The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. + """ + + class CreateParamsRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsShipping(TypedDict): + address: "ChargeService.CreateParamsShippingAddress" + """ + Shipping address. + """ + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + + class CreateParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class ListParams(TypedDict): + created: NotRequired["ChargeService.ListParamsCreated|int"] + """ + Only return charges that were created during the given date interval. + """ + customer: NotRequired[str] + """ + Only return charges for the customer specified by this customer ID. + """ + 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. + """ + payment_intent: NotRequired[str] + """ + Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + """ + 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. + """ + transfer_group: NotRequired[str] + """ + Only return charges for this transfer group, limited to 100. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SearchParams(TypedDict): + 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. + """ + page: NotRequired[str] + """ + A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + """ + query: str + """ + The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). + """ + + class UpdateParams(TypedDict): + customer: NotRequired[str] + """ + The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. + """ + description: NotRequired[str] + """ + An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fraud_details: NotRequired["ChargeService.UpdateParamsFraudDetails"] + """ + A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_details: NotRequired[ + "ChargeService.UpdateParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ + receipt_email: NotRequired[str] + """ + This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. + """ + shipping: NotRequired["ChargeService.UpdateParamsShipping"] + """ + Shipping information for the charge. Helps prevent fraud on charges for physical goods. + """ + transfer_group: NotRequired[str] + """ + A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + """ + + class UpdateParamsFraudDetails(TypedDict): + user_report: Union[Literal[""], Literal["fraudulent", "safe"]] + """ + Either `safe` or `fraudulent`. + """ + + class UpdateParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRental" + ] + """ + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["ChargeService.UpdateParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired["ChargeService.UpdateParamsPaymentDetailsLodging"] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent + """ + + class UpdateParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List["ChargeService.UpdateParamsPaymentDetailsCarRentalDriver"] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalPickupAddress" + ] + """ + Car pick-up address. + """ + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: NotRequired[str] + """ + Name of the pickup location. + """ + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. + """ + + class UpdateParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class UpdateParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class UpdateParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class UpdateParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] + """ + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ + + class UpdateParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ + + class UpdateParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] + """ + Indicates if the tickets are digitally checked when entering the venue. + """ + address: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsEventDetailsAddress" + ] + """ + The event location's address. + """ + affiliate: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsEventDetailsAffiliate" + ] + """ + Affiliate details for this purchase. + """ + company: NotRequired[str] + """ + The name of the company + """ + delivery: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. + """ + + class UpdateParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class UpdateParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class UpdateParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class UpdateParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsFlightAffiliate" + ] + """ + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["ChargeService.UpdateParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List["ChargeService.UpdateParamsPaymentDetailsFlightSegment"] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. + """ + + class UpdateParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class UpdateParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class UpdateParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class UpdateParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ + + class UpdateParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ + + class UpdateParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsLodgingAddress" + ] + """ + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["ChargeService.UpdateParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ + + class UpdateParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class UpdateParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class UpdateParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class UpdateParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class UpdateParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "ChargeService.UpdateParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class UpdateParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class UpdateParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ class UpdateParamsShipping(TypedDict): diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 1ebd0757e..6ff46537b 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -101,6 +101,10 @@ class Plan(StripeObject): class PaymentMethodPreview(StripeObject): class AcssDebit(StripeObject): + account_number: Optional[str] + """ + Account number of the bank account. + """ bank_name: Optional[str] """ Name of the bank associated with the bank account. @@ -933,9 +937,18 @@ class Fpx(StripeObject): class Giropay(StripeObject): pass + class Gopay(StripeObject): + pass + class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + bank_code: Optional[str] + bank_name: Optional[str] + display_name: Optional[str] + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1136,6 +1149,9 @@ class Link(StripeObject): [Deprecated] This is a legacy parameter that no longer has any function. """ + class MbWay(StripeObject): + pass + class Mobilepay(StripeObject): pass @@ -1230,6 +1246,10 @@ class Paypal(StripeObject): """ Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1239,6 +1259,25 @@ class Paypal(StripeObject): """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ class Pix(StripeObject): pass @@ -1246,6 +1285,27 @@ class Pix(StripeObject): class Promptpay(StripeObject): pass + class Qris(StripeObject): + pass + + class Rechnung(StripeObject): + class Dob(StripeObject): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + dob: Optional[Dob] + _inner_class_types = {"dob": Dob} + class RevolutPay(StripeObject): pass @@ -1292,12 +1352,25 @@ class GeneratedFrom(StripeObject): """ _inner_class_types = {"generated_from": GeneratedFrom} + class Shopeepay(StripeObject): + pass + class Sofort(StripeObject): country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ + class StripeBalance(StripeObject): + account: Optional[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: Literal["bank_account", "card", "fpx"] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class Swish(StripeObject): pass @@ -1357,6 +1430,10 @@ class Blocked(StripeObject): """ Account holder type: individual or company. """ + account_number: Optional[str] + """ + Account number of the bank account. + """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. @@ -1424,11 +1501,14 @@ class Zip(StripeObject): """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. """ + customer_account: Optional[str] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -1436,6 +1516,7 @@ class Zip(StripeObject): konbini: Optional[Konbini] kr_card: Optional[KrCard] link: Optional[Link] + mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] @@ -1446,13 +1527,18 @@ class Zip(StripeObject): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] promptpay: Optional[Promptpay] + qris: Optional[Qris] + rechnung: Optional[Rechnung] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] + stripe_balance: Optional[StripeBalance] swish: Optional[Swish] twint: Optional[Twint] type: Literal[ @@ -1475,7 +1561,9 @@ class Zip(StripeObject): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "interac_present", "kakao_pay", @@ -1483,6 +1571,7 @@ class Zip(StripeObject): "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -1493,13 +1582,18 @@ class Zip(StripeObject): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -1533,7 +1627,9 @@ class Zip(StripeObject): "eps": Eps, "fpx": Fpx, "giropay": Giropay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -1541,6 +1637,7 @@ class Zip(StripeObject): "konbini": Konbini, "kr_card": KrCard, "link": Link, + "mb_way": MbWay, "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, @@ -1551,13 +1648,18 @@ class Zip(StripeObject): "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "promptpay": Promptpay, + "qris": Qris, + "rechnung": Rechnung, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, + "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, @@ -1750,12 +1852,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataIdeal" ] @@ -1798,6 +1912,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -1860,6 +1980,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -1870,12 +1996,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataRevolutPay" ] @@ -1900,12 +2038,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSwish" ] @@ -1936,13 +2086,16 @@ class CreateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -1953,13 +2106,18 @@ class CreateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -2179,9 +2337,18 @@ class CreateParamsPaymentMethodDataFpx(TypedDict): class CreateParamsPaymentMethodDataGiropay(TypedDict): pass + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2244,6 +2411,9 @@ class CreateParamsPaymentMethodDataKrCard(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -2329,18 +2499,55 @@ class CreateParamsPaymentMethodDataPaynow(TypedDict): class CreateParamsPaymentMethodDataPaypal(TypedDict): pass + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: "ConfirmationToken.CreateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -2356,12 +2563,25 @@ class CreateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsPaymentMethodDataSwish(TypedDict): pass diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 9b9a1c518..1a037620c 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -8,7 +8,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Dict, List, Optional, cast, overload +from typing import Any, ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack @@ -38,6 +38,20 @@ class CurrencyOptions(StripeObject): Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. """ + class Script(StripeObject): + configuration: Dict[str, Any] + """ + The configuration values of the script. The keys and values are specific to the script implementation. + """ + display_name: str + """ + The name of the script used to calculate the discount. + """ + id: str + """ + The script implementation ID for this coupon. + """ + class CreateParams(RequestOptions): amount_off: NotRequired[int] """ @@ -93,6 +107,10 @@ class CreateParams(RequestOptions): """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ + script: NotRequired["Coupon.CreateParamsScript"] + """ + Configuration of the [script](https://docs.stripe.com/billing/subscriptions/script-coupons) used to calculate the discount. + """ class CreateParamsAppliesTo(TypedDict): products: NotRequired[List[str]] @@ -106,6 +124,16 @@ class CreateParamsCurrencyOptions(TypedDict): A positive integer representing the amount to subtract from an invoice total. """ + class CreateParamsScript(TypedDict): + configuration: Dict[str, Any] + """ + The configuration values of the script. The keys and values are specific to the script implementation. + """ + id: str + """ + The script implementation ID for this coupon. + """ + class DeleteParams(RequestOptions): pass @@ -238,10 +266,18 @@ class RetrieveParams(RequestOptions): """ Date after which the coupon can no longer be redeemed. """ + script: Optional[Script] + """ + Configuration of the [script](https://docs.stripe.com/billing/subscriptions/script-coupons) used to calculate the discount. + """ times_redeemed: int """ Number of times this coupon has been applied to a customer. """ + type: Optional[Literal["amount_off", "percent_off", "script"]] + """ + One of `amount_off`, `percent_off`, or `script`. Describes the type of coupon logic used to calculate the discount. + """ valid: bool """ Taking account of the above properties, whether this coupon can still be applied to a customer. @@ -478,4 +514,5 @@ async def retrieve_async( _inner_class_types = { "applies_to": AppliesTo, "currency_options": CurrencyOptions, + "script": Script, } diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index 665088b22..93edc9918 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -5,7 +5,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id -from typing import Dict, List, cast +from typing import Any, Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict @@ -65,6 +65,10 @@ class CreateParams(TypedDict): """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ + script: NotRequired["CouponService.CreateParamsScript"] + """ + Configuration of the [script](https://docs.stripe.com/billing/subscriptions/script-coupons) used to calculate the discount. + """ class CreateParamsAppliesTo(TypedDict): products: NotRequired[List[str]] @@ -78,6 +82,16 @@ class CreateParamsCurrencyOptions(TypedDict): A positive integer representing the amount to subtract from an invoice total. """ + class CreateParamsScript(TypedDict): + configuration: Dict[str, Any] + """ + The configuration values of the script. The keys and values are specific to the script implementation. + """ + id: str + """ + The script implementation ID for this coupon. + """ + class DeleteParams(TypedDict): pass diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 53963985f..d36176630 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -356,6 +356,10 @@ class ListParams(RequestOptions): """ Only return credit notes for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return credit notes for the account specified by this account ID. + """ 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. @@ -723,6 +727,10 @@ class VoidCreditNoteParams(RequestOptions): """ ID of the customer. """ + customer_account: Optional[str] + """ + ID of the account. + """ customer_balance_transaction: Optional[ ExpandableField["CustomerBalanceTransaction"] ] diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 2fe476012..b8f4d4cb6 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -52,6 +52,16 @@ class PretaxCreditAmount(StripeObject): Type of the pretax credit amount referenced. """ + class TaxCalculationReference(StripeObject): + calculation_id: Optional[str] + """ + The calculation identifier for tax calculation response. + """ + calculation_item_id: Optional[str] + """ + The calculation identifier for tax calculation response line item. + """ + class Tax(StripeObject): class TaxRateDetails(StripeObject): tax_rate: str @@ -139,6 +149,10 @@ class TaxRateDetails(StripeObject): """ The number of units of product being credited. """ + tax_calculation_reference: Optional[TaxCalculationReference] + """ + The tax calculation identifiers of the line item. + """ tax_rates: List["TaxRate"] """ The tax rates which apply to the line item. @@ -162,5 +176,6 @@ class TaxRateDetails(StripeObject): _inner_class_types = { "discount_amounts": DiscountAmount, "pretax_credit_amounts": PretaxCreditAmount, + "tax_calculation_reference": TaxCalculationReference, "taxes": Tax, } diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 5f3a56223..4c5023103 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -165,6 +165,10 @@ class ListParams(TypedDict): """ Only return credit notes for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return credit notes for the account specified by this account ID. + """ 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. diff --git a/stripe/_customer.py b/stripe/_customer.py index 1b422fdd6..003eda4b2 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -926,13 +926,16 @@ class ListPaymentMethodsParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -943,13 +946,18 @@ class ListPaymentMethodsParams(RequestOptions): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -1427,6 +1435,7 @@ class SearchParams(RequestOptions): """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. """ + customer_account: Optional[str] default_source: Optional[ ExpandableField[Union["Account", "BankAccount", "Card", "Source"]] ] diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index 9ace24801..b502e98fa 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -50,6 +50,7 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): """ The ID of the customer the transaction belongs to. """ + customer_account: Optional[str] description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index 64db2470e..573464ecf 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -154,6 +154,7 @@ class UnappliedFromPayment(StripeObject): """ The customer whose available cash balance changed as a result of this transaction. """ + customer_account: Optional[str] ending_balance: int """ The total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index ce2321821..eacef6685 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -53,13 +53,16 @@ class ListParams(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -70,13 +73,18 @@ class ListParams(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index a47dfd486..e95a0887d 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -114,10 +114,14 @@ class CreateParams(RequestOptions): """ Configuration for each component. Exactly 1 component must be enabled. """ - customer: str + customer: NotRequired[str] """ The ID of an existing customer for which to create the Customer Session. """ + customer_account: NotRequired[str] + """ + The ID of an existing Account for which to create the Customer Session. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -223,6 +227,10 @@ class CreateParamsComponentsPricingTable(TypedDict): """ The Customer the Customer Session was created for. """ + customer_account: Optional[str] + """ + The Account that the Customer Session was created for. + """ expires_at: int """ The timestamp at which this Customer Session will expire. diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 820ab18a4..2b4c96f38 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -13,10 +13,14 @@ class CreateParams(TypedDict): """ Configuration for each component. Exactly 1 component must be enabled. """ - customer: str + customer: NotRequired[str] """ The ID of an existing customer for which to create the Customer Session. """ + customer_account: NotRequired[str] + """ + The ID of an existing Account for which to create the Customer Session. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/_discount.py b/stripe/_discount.py index f8475423e..b5e21c77b 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -34,6 +34,10 @@ class Discount(StripeObject): """ The ID of the customer associated with this discount. """ + customer_account: Optional[str] + """ + The ID of the account associated with this discount. + """ end: Optional[int] """ If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. diff --git a/stripe/_error.py b/stripe/_error.py index 14bc2f9a9..beabc50b0 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -192,4 +192,66 @@ class TemporarySessionExpiredError(StripeError): pass +class FinancialAccountNotOpenError(StripeError): + pass + + +class BlockedByStripeError(StripeError): + pass + + +class AlreadyCanceledError(StripeError): + pass + + +class NotCancelableError(StripeError): + pass + + +class InsufficientFundsError(StripeError): + pass + + +class QuotaExceededError(StripeError): + pass + + +class RecipientNotNotifiableError(StripeError): + pass + + +class FeatureNotEnabledError(StripeError): + pass + + +class InvalidPayoutMethodError(StripeError): + pass + + +class ControlledByDashboardError(StripeError): + pass + + +class InvalidPaymentMethodError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + invalid_param=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.invalid_param = invalid_param + + # classDefinitions: The end of the section generated from our OpenAPI spec diff --git a/stripe/_event.py b/stripe/_event.py index 18fa1e2e3..950f926f0 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -54,6 +54,51 @@ class Data(StripeObject): Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). If an array attribute has any updated elements, this object contains the entire array. In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. """ + class Reason(StripeObject): + class AutomationAction(StripeObject): + class StripeSendWebhookCustomEvent(StripeObject): + custom_data: Optional[Dict[str, str]] + """ + Set of key-value pairs attached to the action when creating an Automation. + """ + + stripe_send_webhook_custom_event: Optional[ + StripeSendWebhookCustomEvent + ] + trigger: str + """ + The trigger name of the automation that triggered this action. + Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names. + """ + type: Literal["stripe_send_webhook_custom_event"] + """ + The type of the `automation_action`. + """ + _inner_class_types = { + "stripe_send_webhook_custom_event": StripeSendWebhookCustomEvent, + } + + class Request(StripeObject): + id: Optional[str] + """ + ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + """ + idempotency_key: Optional[str] + """ + The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. + """ + + automation_action: Optional[AutomationAction] + request: Optional[Request] + type: Literal["automation_action", "request"] + """ + The type of the reason for the event. + """ + _inner_class_types = { + "automation_action": AutomationAction, + "request": Request, + } + class Request(StripeObject): id: Optional[str] """ @@ -155,6 +200,10 @@ class RetrieveParams(RequestOptions): """ Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. """ + reason: Optional[Reason] + """ + Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action. + """ request: Optional[Request] """ Information on the API request that triggers the event. @@ -166,15 +215,27 @@ class RetrieveParams(RequestOptions): "account.external_account.deleted", "account.external_account.updated", "account.updated", + "account_notice.created", + "account_notice.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "balance_settings.updated", "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", + "capital.financing_offer.accepted", + "capital.financing_offer.canceled", + "capital.financing_offer.created", + "capital.financing_offer.expired", + "capital.financing_offer.fully_repaid", + "capital.financing_offer.paid_out", + "capital.financing_offer.rejected", + "capital.financing_offer.replacement_created", + "capital.financing_transaction.created", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", @@ -215,11 +276,15 @@ class RetrieveParams(RequestOptions): "customer.source.deleted", "customer.source.expiring", "customer.source.updated", + "customer.subscription.collection_paused", + "customer.subscription.collection_resumed", "customer.subscription.created", + "customer.subscription.custom_event", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", + "customer.subscription.price_migration_failed", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", @@ -235,8 +300,11 @@ class RetrieveParams(RequestOptions): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_inferred_balances", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.session.updated", + "fx_quote.expired", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", @@ -251,7 +319,9 @@ class RetrieveParams(RequestOptions): "invoice.overdue", "invoice.overpaid", "invoice.paid", + "invoice.payment.overpaid", "invoice.payment_action_required", + "invoice.payment_attempt_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", @@ -275,10 +345,15 @@ class RetrieveParams(RequestOptions): "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_dispute_settlement_detail.created", + "issuing_dispute_settlement_detail.updated", + "issuing_fraud_liability_debit.created", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", + "issuing_settlement.created", + "issuing_settlement.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -314,15 +389,26 @@ class RetrieveParams(RequestOptions): "price.created", "price.deleted", "price.updated", + "privacy.redaction_job.canceled", + "privacy.redaction_job.created", + "privacy.redaction_job.ready", + "privacy.redaction_job.succeeded", + "privacy.redaction_job.validation_error", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", + "quote.accept_failed", "quote.accepted", + "quote.accepting", "quote.canceled", "quote.created", + "quote.draft", "quote.finalized", + "quote.reestimate_failed", + "quote.reestimated", + "quote.stale", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", @@ -351,13 +437,16 @@ class RetrieveParams(RequestOptions): "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", + "subscription_schedule.price_migration_failed", "subscription_schedule.released", "subscription_schedule.updated", + "tax.form.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -473,4 +562,4 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"data": Data, "request": Request} + _inner_class_types = {"data": Data, "reason": Reason, "request": Request} diff --git a/stripe/_external_account_service.py b/stripe/_external_account_service.py new file mode 100644 index 000000000..a15d70803 --- /dev/null +++ b/stripe/_external_account_service.py @@ -0,0 +1,411 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._bank_account import BankAccount +from stripe._card import Card +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Dict, List, Union, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class ExternalAccountService(StripeService): + class CreateParams(TypedDict): + default_for_currency: NotRequired[bool] + """ + When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + external_account: Union[ + str, + "ExternalAccountService.CreateParamsCard", + "ExternalAccountService.CreateParamsBankAccount", + "ExternalAccountService.CreateParamsCardToken", + ] + """ + Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's external account details (with the options shown below). + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + + class CreateParamsBankAccount(TypedDict): + object: Literal["bank_account"] + account_holder_name: NotRequired[str] + """ + The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + """ + account_holder_type: NotRequired[Literal["company", "individual"]] + """ + The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. + """ + account_number: str + """ + The account number for the bank account, in string form. Must be a checking account. + """ + country: str + """ + The country in which the bank account is located. + """ + currency: NotRequired[str] + """ + The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) + """ + routing_number: NotRequired[str] + """ + The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required. + """ + + class CreateParamsCard(TypedDict): + object: Literal["card"] + address_city: NotRequired[str] + address_country: NotRequired[str] + address_line1: NotRequired[str] + address_line2: NotRequired[str] + address_state: NotRequired[str] + address_zip: NotRequired[str] + currency: NotRequired[str] + cvc: NotRequired[str] + exp_month: int + exp_year: int + name: NotRequired[str] + number: str + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + + class CreateParamsCardToken(TypedDict): + object: Literal["card"] + currency: NotRequired[str] + token: str + + class DeleteParams(TypedDict): + pass + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + object: NotRequired[Literal["bank_account", "card"]] + """ + Filter external accounts according to a particular object type. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + account_holder_name: NotRequired[str] + """ + The name of the person or business that owns the bank account. + """ + account_holder_type: NotRequired[ + "Literal['']|Literal['company', 'individual']" + ] + """ + The type of entity that holds the account. This can be either `individual` or `company`. + """ + account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] + """ + The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + """ + address_city: NotRequired[str] + """ + City/District/Suburb/Town/Village. + """ + address_country: NotRequired[str] + """ + Billing address country, if provided when creating card. + """ + address_line1: NotRequired[str] + """ + Address line 1 (Street address/PO Box/Company name). + """ + address_line2: NotRequired[str] + """ + Address line 2 (Apartment/Suite/Unit/Building). + """ + address_state: NotRequired[str] + """ + State/County/Province/Region. + """ + address_zip: NotRequired[str] + """ + ZIP or postal code. + """ + default_for_currency: NotRequired[bool] + """ + When set to true, this becomes the default external account for its currency. + """ + documents: NotRequired["ExternalAccountService.UpdateParamsDocuments"] + """ + Documents that may be submitted to satisfy various informational requests. + """ + exp_month: NotRequired[str] + """ + Two digit number representing the card's expiration month. + """ + exp_year: NotRequired[str] + """ + Four digit number representing the card's expiration year. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: NotRequired[str] + """ + Cardholder name. + """ + + class UpdateParamsDocuments(TypedDict): + bank_account_ownership_verification: NotRequired[ + "ExternalAccountService.UpdateParamsDocumentsBankAccountOwnershipVerification" + ] + """ + One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a check. + """ + + class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + + def delete( + self, + id: str, + params: "ExternalAccountService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Delete a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + self._request( + "delete", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def delete_async( + self, + id: str, + params: "ExternalAccountService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Delete a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "delete", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "ExternalAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Retrieve a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + self._request( + "get", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "ExternalAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Retrieve a specified external account for a given account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "get", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "ExternalAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. + + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection). + + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. + """ + return cast( + Union[BankAccount, Card], + self._request( + "post", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "ExternalAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Updates the metadata, account holder name, account holder type of a bank account belonging to + a connected account and optionally sets it as the default for its currency. Other bank account + details are not editable by design. + + You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection). + + You can re-enable a disabled bank account by performing an update call without providing any + arguments or changes. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "post", + "/v1/external_accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "ExternalAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Union[BankAccount, Card]]: + """ + List external accounts for an account. + """ + return cast( + ListObject[Union[BankAccount, Card]], + self._request( + "get", + "/v1/external_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "ExternalAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Union[BankAccount, Card]]: + """ + List external accounts for an account. + """ + return cast( + ListObject[Union[BankAccount, Card]], + await self._request_async( + "get", + "/v1/external_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "ExternalAccountService.CreateParams", + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Create an external account for a given connected account. + """ + return cast( + Union[BankAccount, Card], + self._request( + "post", + "/v1/external_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ExternalAccountService.CreateParams", + options: RequestOptions = {}, + ) -> Union[BankAccount, Card]: + """ + Create an external account for a given connected account. + """ + return cast( + Union[BankAccount, Card], + await self._request_async( + "post", + "/v1/external_accounts", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_financial_connections_service.py b/stripe/_financial_connections_service.py index 8a9905393..57d91bd85 100644 --- a/stripe/_financial_connections_service.py +++ b/stripe/_financial_connections_service.py @@ -2,6 +2,9 @@ # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.financial_connections._account_service import AccountService +from stripe.financial_connections._institution_service import ( + InstitutionService, +) from stripe.financial_connections._session_service import SessionService from stripe.financial_connections._transaction_service import ( TransactionService, @@ -12,5 +15,6 @@ class FinancialConnectionsService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.accounts = AccountService(self._requestor) + self.institutions = InstitutionService(self._requestor) self.sessions = SessionService(self._requestor) self.transactions = TransactionService(self._requestor) diff --git a/stripe/_fx_quote.py b/stripe/_fx_quote.py new file mode 100644 index 000000000..3f475b17c --- /dev/null +++ b/stripe/_fx_quote.py @@ -0,0 +1,307 @@ +# -*- 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._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class FxQuote( + CreateableAPIResource["FxQuote"], ListableAPIResource["FxQuote"] +): + """ + The FX Quotes API provides three key functions: + - View current exchange rates: The object shows Stripe's current exchange rate for any given currency pair. + - Extended quotes: The API provides rate quotes valid for a 1-hour period or a 24-hour period, eliminating uncertainty from FX fluctuations. + - View FX fees: The API provides information on the FX fees Stripe will charge on your FX transaction, allowing you to anticipate specific settlement amounts before payment costs. + """ + + OBJECT_NAME: ClassVar[Literal["fx_quote"]] = "fx_quote" + + class Rates(StripeObject): + class RateDetails(StripeObject): + base_rate: float + """ + The rate for the currency pair. + """ + duration_premium: float + """ + The fee for locking the conversion rates. + """ + fx_fee_rate: float + """ + The FX fee for the currency pair. + """ + reference_rate: Optional[float] + """ + A reference rate for the currency pair provided by the reference rate provider. + """ + reference_rate_provider: Optional[Literal["ecb"]] + """ + The reference rate provider. + """ + + exchange_rate: float + """ + The rate that includes the FX fee rate. + """ + rate_details: RateDetails + _inner_class_types = {"rate_details": RateDetails} + + class Usage(StripeObject): + class Payment(StripeObject): + destination: Optional[str] + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the PaymentIntent's transfer_data[destination] field. + """ + on_behalf_of: Optional[str] + """ + The Stripe account ID that these funds are intended for. + + This field must match the account ID that would be used in the PaymentIntent's on_behalf_of field. + """ + + class Transfer(StripeObject): + destination: str + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the Transfer's destination field. + """ + + payment: Optional[Payment] + """ + The details required to use an FX Quote for a payment + """ + transfer: Optional[Transfer] + """ + The details required to use an FX Quote for a transfer + """ + type: Literal["payment", "transfer"] + """ + The transaction type for which the FX Quote will be used. + + Can be 'payment' or 'transfer'. + """ + _inner_class_types = {"payment": Payment, "transfer": Transfer} + + class CreateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + from_currencies: List[str] + """ + A list of three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be [supported currencies](https://stripe.com/docs/currencies). + """ + lock_duration: Literal["day", "five_minutes", "hour", "none"] + """ + The duration that you wish the quote to be locked for. The quote will be usable for the duration specified. The default is `none`. The maximum is 1 day. + """ + to_currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + usage: NotRequired["FxQuote.CreateParamsUsage"] + """ + The usage specific information for the quote. + """ + + class CreateParamsUsage(TypedDict): + payment: NotRequired["FxQuote.CreateParamsUsagePayment"] + """ + The payment transaction details that are intended for the FX Quote. + """ + transfer: NotRequired["FxQuote.CreateParamsUsageTransfer"] + """ + The transfer transaction details that are intended for the FX Quote. + """ + type: Literal["payment", "transfer"] + """ + Which transaction the FX Quote will be used for + + Can be “payment” | “transfer” + """ + + class CreateParamsUsagePayment(TypedDict): + destination: NotRequired[str] + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the PaymentIntent's transfer_data[destination] field. + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID that these funds are intended for. + + This field should match the account ID that would be used in the PaymentIntent's on_behalf_of field. + """ + + class CreateParamsUsageTransfer(TypedDict): + destination: str + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the Transfer's destination field. + """ + + class ListParams(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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the quote was created, measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + lock_duration: Literal["day", "five_minutes", "hour", "none"] + """ + The duration the exchange rate quote remains valid from creation time. Allowed values are none, hour, and day. Note that for the test mode API available in alpha, you can request an extended quote, but it won't be usable for any transactions. + """ + lock_expires_at: Optional[int] + """ + Time at which the quote will expire, measured in seconds since the Unix epoch. + + If lock_duration is set to ‘none' this field will be set to null. + """ + lock_status: Literal["active", "expired", "none"] + """ + Lock status of the quote. Transitions from active to expired once past the lock_expires_at timestamp. + + Can return value none, active, or expired. + """ + object: Literal["fx_quote"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + rates: Dict[str, Rates] + """ + Information about the rates. + """ + to_currency: str + """ + The currency to convert into, typically this is the currency that you want to settle to your Stripe balance. Three-letter ISO currency code, in lowercase. Must be a supported currency. + """ + usage: Usage + + @classmethod + def create(cls, **params: Unpack["FxQuote.CreateParams"]) -> "FxQuote": + """ + Creates an FX Quote object + """ + return cast( + "FxQuote", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["FxQuote.CreateParams"] + ) -> "FxQuote": + """ + Creates an FX Quote object + """ + return cast( + "FxQuote", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["FxQuote.ListParams"] + ) -> ListObject["FxQuote"]: + """ + Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first. + """ + 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["FxQuote.ListParams"] + ) -> ListObject["FxQuote"]: + """ + Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first. + """ + 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["FxQuote.RetrieveParams"] + ) -> "FxQuote": + """ + Retrieve an FX Quote object + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FxQuote.RetrieveParams"] + ) -> "FxQuote": + """ + Retrieve an FX Quote object + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"rates": Rates, "usage": Usage} diff --git a/stripe/_fx_quote_service.py b/stripe/_fx_quote_service.py new file mode 100644 index 000000000..df9948f72 --- /dev/null +++ b/stripe/_fx_quote_service.py @@ -0,0 +1,211 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._fx_quote import FxQuote +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class FxQuoteService(StripeService): + class CreateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + from_currencies: List[str] + """ + A list of three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be [supported currencies](https://stripe.com/docs/currencies). + """ + lock_duration: Literal["day", "five_minutes", "hour", "none"] + """ + The duration that you wish the quote to be locked for. The quote will be usable for the duration specified. The default is `none`. The maximum is 1 day. + """ + to_currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + usage: NotRequired["FxQuoteService.CreateParamsUsage"] + """ + The usage specific information for the quote. + """ + + class CreateParamsUsage(TypedDict): + payment: NotRequired["FxQuoteService.CreateParamsUsagePayment"] + """ + The payment transaction details that are intended for the FX Quote. + """ + transfer: NotRequired["FxQuoteService.CreateParamsUsageTransfer"] + """ + The transfer transaction details that are intended for the FX Quote. + """ + type: Literal["payment", "transfer"] + """ + Which transaction the FX Quote will be used for + + Can be “payment” | “transfer” + """ + + class CreateParamsUsagePayment(TypedDict): + destination: NotRequired[str] + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the PaymentIntent's transfer_data[destination] field. + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID that these funds are intended for. + + This field should match the account ID that would be used in the PaymentIntent's on_behalf_of field. + """ + + class CreateParamsUsageTransfer(TypedDict): + destination: str + """ + The Stripe account ID that the funds will be transferred to. + + This field should match the account ID that would be used in the Transfer's destination field. + """ + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "FxQuoteService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FxQuote]: + """ + Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first. + """ + return cast( + ListObject[FxQuote], + self._request( + "get", + "/v1/fx_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FxQuoteService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FxQuote]: + """ + Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first. + """ + return cast( + ListObject[FxQuote], + await self._request_async( + "get", + "/v1/fx_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "FxQuoteService.CreateParams", + options: RequestOptions = {}, + ) -> FxQuote: + """ + Creates an FX Quote object + """ + return cast( + FxQuote, + self._request( + "post", + "/v1/fx_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "FxQuoteService.CreateParams", + options: RequestOptions = {}, + ) -> FxQuote: + """ + Creates an FX Quote object + """ + return cast( + FxQuote, + await self._request_async( + "post", + "/v1/fx_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "FxQuoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FxQuote: + """ + Retrieve an FX Quote object + """ + return cast( + FxQuote, + self._request( + "get", + "/v1/fx_quotes/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "FxQuoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FxQuote: + """ + Retrieve an FX Quote object + """ + return cast( + FxQuote, + await self._request_async( + "get", + "/v1/fx_quotes/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_invoice.py b/stripe/_invoice.py index c4a607841..43d7c4c90 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -40,6 +40,7 @@ from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem from stripe._invoice_payment import InvoicePayment + from stripe._margin import Margin from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._setup_intent import SetupIntent @@ -99,6 +100,40 @@ class Invoice( OBJECT_NAME: ClassVar[Literal["invoice"]] = "invoice" + class AmountsDue(StripeObject): + amount: int + """ + Incremental amount due for this payment in cents (or local equivalent). + """ + amount_paid: int + """ + The amount in cents (or local equivalent) that was paid for this payment. + """ + amount_remaining: int + """ + The difference between the payment's amount and amount_paid, in cents (or local equivalent). + """ + days_until_due: Optional[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: Optional[int] + """ + Date on which a payment plan's payment is due. + """ + paid_at: Optional[int] + """ + Timestamp when the payment was paid. + """ + status: Literal["open", "paid", "past_due"] + """ + The status of the payment, one of `open`, `paid`, or `past_due` + """ + class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] @@ -432,6 +467,7 @@ class LastFinalizationError(StripeObject): "email_invalid", "expired_card", "financial_connections_account_inactive", + "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", @@ -528,6 +564,7 @@ class LastFinalizationError(StripeObject): "return_intent_already_processed", "routing_number_invalid", "secret_key_required", + "sensitive_data_access_expired", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", @@ -547,6 +584,7 @@ class LastFinalizationError(StripeObject): "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", + "terminal_reader_collected_data_invalid", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", @@ -560,6 +598,8 @@ class LastFinalizationError(StripeObject): "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", + "v2_account_disconnection_unsupported", + "v2_account_missing_configuration", ] ] """ @@ -664,11 +704,27 @@ class QuoteDetails(StripeObject): """ class SubscriptionDetails(StripeObject): + class PauseCollection(StripeObject): + behavior: Optional[ + Literal["keep_as_draft", "mark_uncollectible", "void"] + ] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + resumes_at: Optional[int] + """ + The time after which the subscription will resume collecting payments. + """ + metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. *Note: This attribute is populated only for invoices created on or after June 29, 2023.* """ + pause_collection: Optional[PauseCollection] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ subscription: ExpandableField["Subscription"] """ The subscription that generated this invoice @@ -677,6 +733,7 @@ class SubscriptionDetails(StripeObject): """ Only set for upcoming invoices that preview prorations. The time used to calculate prorations. """ + _inner_class_types = {"pause_collection": PauseCollection} quote_details: Optional[QuoteDetails] """ @@ -757,6 +814,9 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class IdBankTransfer(StripeObject): + pass + class Konbini(StripeObject): pass @@ -772,6 +832,10 @@ class Filters(StripeObject): """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ filters: Optional[Filters] permissions: Optional[ @@ -788,7 +852,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -822,6 +893,10 @@ class Filters(StripeObject): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: Optional[IdBankTransfer] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: Optional[Konbini] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. @@ -839,6 +914,7 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, @@ -866,11 +942,13 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", + "id_bank_transfer", "ideal", "jp_credit_transfer", "kakao_pay", @@ -890,6 +968,7 @@ class Filters(StripeObject): "sepa_credit_transfer", "sepa_debit", "sofort", + "stripe_balance", "swish", "us_bank_account", "wechat_pay", @@ -1082,6 +1161,16 @@ class TotalDiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class TotalMarginAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the reduction in line item amount. + """ + margin: ExpandableField["Margin"] + """ + The margin that was applied to get this margin amount. + """ + class TotalPretaxCreditAmount(StripeObject): amount: int """ @@ -1097,7 +1186,11 @@ class TotalPretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + margin: Optional[ExpandableField["Margin"]] + """ + The margin that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount", "margin"] """ Type of the pretax credit amount referenced. """ @@ -1186,6 +1279,10 @@ class AddLinesParamsLine(TypedDict): """ ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -1226,11 +1323,43 @@ class AddLinesParamsLineDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.AddLinesParamsLineDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class AddLinesParamsLineDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.AddLinesParamsLineDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AddLinesParamsLineDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class AddLinesParamsLinePeriod(TypedDict): end: int """ @@ -1397,6 +1526,10 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): """ class AttachPaymentParams(RequestOptions): + amount_requested: NotRequired[int] + """ + The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -1405,12 +1538,54 @@ class AttachPaymentParams(RequestOptions): """ The ID of the PaymentIntent to attach to the invoice. """ + payment_record: NotRequired[str] + """ + The ID of the PaymentRecord to attach to the invoice. + """ + payment_record_data: NotRequired[ + "Invoice.AttachPaymentParamsPaymentRecordData" + ] + """ + The PaymentRecord data for attaching an out of band payment to the invoice. + """ + + class AttachPaymentParamsPaymentRecordData(TypedDict): + amount: int + """ + The amount that was paid out of band. + """ + currency: str + """ + The currency that was paid out of band. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + money_movement_type: str + """ + The type of money movement for this out of band payment record. + """ + paid_at: NotRequired[int] + """ + The timestamp when this out of band payment was paid. + """ + payment_reference: NotRequired[str] + """ + The reference for this out of band payment record. + """ class CreateParams(RequestOptions): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ + amounts_due: NotRequired[ + "Literal['']|List[Invoice.CreateParamsAmountsDue]" + ] + """ + List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`. + """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @@ -1447,10 +1622,18 @@ class CreateParams(RequestOptions): """ The ID of the customer who will be billed. """ + customer_account: NotRequired[str] + """ + The ID of the account who will be billed. + """ days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ + default_margins: NotRequired[List[str]] + """ + The ids of the margins to apply to the invoice. Can be overridden by line item `margins`. + """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @@ -1544,6 +1727,24 @@ class CreateParams(RequestOptions): If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. """ + class CreateParamsAmountsDue(TypedDict): + amount: int + """ + The amount in cents (or local equivalent). + """ + days_until_due: NotRequired[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: str + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: NotRequired[int] + """ + Date on which a payment plan's payment is due. + """ + class CreateParamsAutomaticTax(TypedDict): enabled: bool """ @@ -1583,11 +1784,41 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired["Invoice.CreateParamsDiscountDiscountEnd"] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] """ @@ -1620,7 +1851,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1651,6 +1882,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1782,6 +2019,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -1824,7 +2066,14 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1839,6 +2088,10 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ @@ -2050,6 +2303,10 @@ class CreatePreviewParams(RequestOptions): """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ + customer_account: NotRequired[str] + """ + The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set. + """ customer_details: NotRequired[ "Invoice.CreatePreviewParamsCustomerDetails" ] @@ -2359,11 +2616,43 @@ class CreatePreviewParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.CreatePreviewParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ @@ -2445,11 +2734,43 @@ class CreatePreviewParamsInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.CreatePreviewParamsInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsInvoiceItemPeriod(TypedDict): end: int """ @@ -2495,6 +2816,22 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + amendments: NotRequired[ + List["Invoice.CreatePreviewParamsScheduleDetailsAmendment"] + ] + """ + Changes to apply to the phases of the subscription schedule, in the order provided. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. @@ -2505,6 +2842,12 @@ class CreatePreviewParamsScheduleDetails(TypedDict): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ + prebilling: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPrebilling]" + ] + """ + Provide any time periods to bill in advance. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -2512,90 +2855,631 @@ class CreatePreviewParamsScheduleDetails(TypedDict): In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ - class CreatePreviewParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List[ - "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" - ] + class CreatePreviewParamsScheduleDetailsAmendment(TypedDict): + amendment_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEnd" ] """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment. """ - application_fee_percent: NotRequired[float] + amendment_start: ( + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStart" + ) """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + Details to identify the earliest timestamp where the proposed change should take effect. """ - automatic_tax: NotRequired[ - "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + billing_cycle_anchor: NotRequired[ + Literal["amendment_start", "automatic"] ] """ - Automatic tax settings for this phase. + For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment. """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + discount_actions: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentDiscountAction" + ] + ] """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + Changes to the coupons being redeemed or discounts being applied during the amendment time span. """ - billing_thresholds: NotRequired[ - "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + item_actions: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemAction" + ] ] """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + Changes to the subscription items during the amendment time span. """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + metadata_actions: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentMetadataAction" + ] ] """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + Instructions for how to modify phase metadata """ - currency: NotRequired[str] + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`. """ - default_payment_method: NotRequired[str] + set_pause_collection: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollection" + ] """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. """ - default_tax_rates: NotRequired["Literal['']|List[str]"] + set_schedule_end: NotRequired[ + Literal["amendment_end", "amendment_start"] + ] """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + Ends the subscription schedule early as dictated by either the accompanying amendment's start or end. """ - description: NotRequired["Literal['']|str"] + trial_settings: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentTrialSettings" + ] """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + Settings related to subscription trials. """ - discounts: NotRequired[ - "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEnd(TypedDict): + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDiscountEnd" ] """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + Use the `end` time of a given discount. """ - end_date: NotRequired["int|Literal['now']"] + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDuration" + ] """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + Time span for the amendment starting from the `amendment_start`. """ - invoice_settings: NotRequired[ - "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" - ] + timestamp: NotRequired[int] """ - All invoices will be billed using the specified settings. + A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`. """ - items: List["Invoice.CreatePreviewParamsScheduleDetailsPhaseItem"] + type: Literal[ + "discount_end", + "duration", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + Select one of three ways to pass the `amendment_end`. """ - iterations: NotRequired[int] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDiscountEnd( + TypedDict, + ): + discount: str """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + The ID of a specific discount. """ - metadata: NotRequired[Dict[str, str]] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - on_behalf_of: NotRequired[str] + interval_count: int """ - The account on behalf of which to charge, for each of the associated subscription's invoices. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - proration_behavior: NotRequired[ + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStart(TypedDict): + amendment_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartAmendmentEnd" + ] + """ + Details of another amendment in the same array, immediately after which this amendment should begin. + """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the amendment to start. + """ + type: Literal[ + "amendment_end", + "discount_end", + "now", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] + """ + Select one of three ways to pass the `amendment_start`. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartAmendmentEnd( + TypedDict, + ): + index: int + """ + The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartDiscountEnd( + TypedDict, + ): + discount: str + """ + The ID of a specific discount. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountAction(TypedDict): + add: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAdd" + ] + """ + Details of the discount to add. + """ + remove: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionRemove" + ] + """ + Details of the discount to remove. + """ + set: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionSet" + ] + """ + Details of the discount to replace the existing discounts with. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of discount action. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAdd( + TypedDict, + ): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAddDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAddDiscountEnd( + TypedDict, + ): + type: Literal["amendment_end"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionRemove( + TypedDict, + ): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionSet( + TypedDict, + ): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemAction(TypedDict): + add: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionAdd" + ] + """ + Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item. + """ + remove: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionRemove" + ] + """ + Details of the subscription item to remove. + """ + set: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionSet" + ] + """ + Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of item action. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAdd(TypedDict): + discounts: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscount" + ] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddTrial" + ] + """ + Options that configure the trial on the subscription item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddTrial( + TypedDict, + ): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionRemove( + TypedDict, + ): + price: str + """ + ID of a price to remove. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSet(TypedDict): + discounts: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscount" + ] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetTrial" + ] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetTrial( + TypedDict, + ): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentMetadataAction(TypedDict): + add: NotRequired[Dict[str, str]] + """ + Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata. + """ + remove: NotRequired[List[str]] + """ + Keys to remove from schedule phase metadata. + """ + set: NotRequired["Literal['']|Dict[str, str]"] + """ + Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten. + """ + type: Literal["add", "remove", "set"] + """ + Select one of three ways to update phase-level `metadata` on subscription schedules. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollection( + TypedDict, + ): + set: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollectionSet" + ] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollectionSet( + TypedDict, + ): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentTrialSettings(TypedDict): + end_behavior: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior( + TypedDict, + ): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + """ + description: NotRequired["Literal['']|str"] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: NotRequired[ + "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ + end_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + """ + invoice_settings: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + items: List["Invoice.CreatePreviewParamsScheduleDetailsPhaseItem"] + """ + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + """ + iterations: NotRequired[int] + """ + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The account on behalf of which to charge, for each of the associated subscription's invoices. + """ + pause_collection: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ + proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ @@ -2615,10 +3499,20 @@ class CreatePreviewParamsScheduleDetailsPhase(TypedDict): """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + trial_settings: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ @@ -2659,11 +3553,47 @@ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( TypedDict, ): @@ -2733,11 +3663,47 @@ class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEnd( + TypedDict + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -2805,6 +3771,12 @@ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemTrial" + ] + """ + Options that configure the trial on the subscription item. + """ class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, @@ -2823,11 +3795,47 @@ class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): currency: str """ @@ -2868,6 +3876,22 @@ class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreatePreviewParamsScheduleDetailsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -2878,12 +3902,88 @@ class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class CreatePreviewParamsScheduleDetailsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseTrialSettingsEndBehavior( + TypedDict, + ): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreatePreviewParamsScheduleDetailsPrebilling(TypedDict): + bill_until: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPrebillingBillUntil" + ] + """ + The end of the prebilled time period. + """ + iterations: NotRequired[int] + """ + This is used to determine the number of billing cycles to prebill. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntil(TypedDict): + amendment_end: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd" + ] + """ + End the prebilled period when a specified amendment ends. + """ + duration: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration" + ] + """ + Time span for prebilling, starting from `bill_from`. + """ + timestamp: NotRequired[int] + """ + End the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_end", "duration", "schedule_end", "timestamp"] + """ + Select one of several ways to pass the `bill_until` value. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd( + TypedDict, + ): + index: int + """ + The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ - cancel_at: NotRequired["Literal['']|int"] + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + cancel_at: NotRequired[ + "Literal['']|int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -2905,6 +4005,12 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ A list of up to 20 subscription items, each with an attached price. """ + prebilling: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsPrebilling" + ] + """ + The pre-billing to apply to the subscription as a preview. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -2997,11 +4103,47 @@ class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): currency: str """ @@ -3042,6 +4184,12 @@ class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreatePreviewParamsSubscriptionDetailsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + class DeleteParams(RequestOptions): pass @@ -3088,6 +4236,10 @@ class ListParams(RequestOptions): """ Only return invoices for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return invoices for the account specified by this account ID. + """ due_date: NotRequired["Invoice.ListParamsDueDate|int"] ending_before: NotRequired[str] """ @@ -3163,6 +4315,12 @@ class ModifyParams(RequestOptions): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ + amounts_due: NotRequired[ + "Literal['']|List[Invoice.ModifyParamsAmountsDue]" + ] + """ + List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`. + """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @@ -3195,6 +4353,10 @@ class ModifyParams(RequestOptions): """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ + default_margins: NotRequired["Literal['']|List[str]"] + """ + The ids of the margins to apply to the invoice. Can be overridden by line item `margins`. + """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @@ -3280,6 +4442,24 @@ class ModifyParams(RequestOptions): If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. """ + class ModifyParamsAmountsDue(TypedDict): + amount: int + """ + The amount in cents (or local equivalent). + """ + days_until_due: NotRequired[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: str + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: NotRequired[int] + """ + Date on which a payment plan's payment is due. + """ + class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ @@ -3319,11 +4499,41 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired["Invoice.ModifyParamsDiscountDiscountEnd"] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.ModifyParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsIssuer(TypedDict): account: NotRequired[str] """ @@ -3346,7 +4556,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -3377,6 +4587,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -3508,6 +4724,11 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -3550,7 +4771,14 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -3565,6 +4793,10 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class ModifyParamsRendering(TypedDict): amount_tax_display: NotRequired[ @@ -3886,6 +5118,10 @@ class UpdateLinesParamsLine(TypedDict): """ ID of an existing line item on the invoice. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. @@ -3926,11 +5162,43 @@ class UpdateLinesParamsLineDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Invoice.UpdateLinesParamsLineDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateLinesParamsLineDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Invoice.UpdateLinesParamsLineDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateLinesParamsLineDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateLinesParamsLinePeriod(TypedDict): end: int """ @@ -4134,6 +5402,10 @@ class VoidInvoiceParams(RequestOptions): """ This is the sum of all the shipping amounts. """ + amounts_due: Optional[List[AmountsDue]] + """ + List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the invoice. @@ -4203,6 +5475,10 @@ class VoidInvoiceParams(RequestOptions): """ The ID of the customer who will be billed. """ + customer_account: Optional[str] + """ + The ID of the account who will be billed. + """ customer_address: Optional[CustomerAddress] """ The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. @@ -4231,6 +5507,10 @@ class VoidInvoiceParams(RequestOptions): """ The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. """ + default_margins: Optional[List[ExpandableField["Margin"]]] + """ + The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @@ -4403,6 +5683,10 @@ class VoidInvoiceParams(RequestOptions): """ The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. """ + total_margin_amounts: Optional[List[TotalMarginAmount]] + """ + The aggregate amounts calculated per margin across all line items. + """ total_pretax_credit_amounts: Optional[List[TotalPretaxCreditAmount]] """ Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. @@ -5865,6 +7149,7 @@ async def list_lines_async( ) _inner_class_types = { + "amounts_due": AmountsDue, "automatic_tax": AutomaticTax, "confirmation_secret": ConfirmationSecret, "custom_fields": CustomField, @@ -5882,6 +7167,7 @@ async def list_lines_async( "status_transitions": StatusTransitions, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, + "total_margin_amounts": TotalMarginAmount, "total_pretax_credit_amounts": TotalPretaxCreditAmount, "total_taxes": TotalTax, } diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 302bedb3b..d545efc2e 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -22,6 +22,7 @@ from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice import Invoice + from stripe._margin import Margin from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock @@ -110,10 +111,14 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - customer: str + customer: NotRequired[str] """ The ID of the customer who will be billed when this invoice item is billed. """ + customer_account: NotRequired[str] + """ + The ID of the account who will be billed when this invoice item is billed. + """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. @@ -136,6 +141,10 @@ class CreateParams(RequestOptions): """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ + margins: NotRequired[List[str]] + """ + The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -188,11 +197,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceItem.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceItem.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPeriod(TypedDict): end: int """ @@ -245,6 +286,10 @@ class ListParams(RequestOptions): """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ + customer_account: NotRequired[str] + """ + The identifier of the account whose invoice items to return. If none is provided, all invoice items will be returned. + """ 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. @@ -311,6 +356,10 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -359,11 +408,43 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceItem.ModifyParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceItem.ModifyParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPeriod(TypedDict): end: int """ @@ -422,6 +503,10 @@ class RetrieveParams(RequestOptions): """ The ID of the customer who will be billed when this invoice item is billed. """ + customer_account: Optional[str] + """ + The ID of the account who will be billed when this invoice item is billed. + """ date: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -450,6 +535,10 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + margins: Optional[List[ExpandableField["Margin"]]] + """ + The margins which apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index cfe596084..0a420c95d 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -19,10 +19,14 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - customer: str + customer: NotRequired[str] """ The ID of the customer who will be billed when this invoice item is billed. """ + customer_account: NotRequired[str] + """ + The ID of the account who will be billed when this invoice item is billed. + """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. @@ -45,6 +49,10 @@ class CreateParams(TypedDict): """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ + margins: NotRequired[List[str]] + """ + The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -97,11 +105,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceItemService.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceItemService.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPeriod(TypedDict): end: int """ @@ -154,6 +194,10 @@ class ListParams(TypedDict): """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ + customer_account: NotRequired[str] + """ + The identifier of the account whose invoice items to return. If none is provided, all invoice items will be returned. + """ 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. @@ -226,6 +270,10 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -274,11 +322,43 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceItemService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceItemService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPeriod(TypedDict): end: int """ @@ -491,7 +571,7 @@ async def list_async( def create( self, - params: "InvoiceItemService.CreateParams", + params: "InvoiceItemService.CreateParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ @@ -510,7 +590,7 @@ def create( async def create_async( self, - params: "InvoiceItemService.CreateParams", + params: "InvoiceItemService.CreateParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index f6c68fa22..5bb3018b6 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from stripe._discount import Discount + from stripe._margin import Margin from stripe._subscription import Subscription from stripe.billing._credit_balance_transaction import ( CreditBalanceTransaction, @@ -41,6 +42,16 @@ class DiscountAmount(StripeObject): The discount that was applied to get this discount amount. """ + class MarginAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the reduction in line item amount. + """ + margin: ExpandableField["Margin"] + """ + The margin that was applied to get this margin amount. + """ + class Parent(StripeObject): class InvoiceItemDetails(StripeObject): class ProrationDetails(StripeObject): @@ -160,7 +171,11 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + margin: Optional[ExpandableField["Margin"]] + """ + The margin that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount", "margin"] """ Type of the pretax credit amount referenced. """ @@ -187,6 +202,16 @@ class PriceDetails(StripeObject): """ _inner_class_types = {"price_details": PriceDetails} + class TaxCalculationReference(StripeObject): + calculation_id: Optional[str] + """ + The calculation identifier for tax calculation response. + """ + calculation_item_id: Optional[str] + """ + The calculation identifier for tax calculation response line item. + """ + class Tax(StripeObject): class TaxRateDetails(StripeObject): tax_rate: str @@ -257,6 +282,10 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. @@ -297,11 +326,43 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceLineItem.ModifyParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceLineItem.ModifyParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPeriod(TypedDict): end: int """ @@ -503,6 +564,14 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + margin_amounts: Optional[List[MarginAmount]] + """ + The amount of margin calculated per margin for this line item. + """ + margins: Optional[List[ExpandableField["Margin"]]] + """ + The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin. + """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. @@ -529,6 +598,10 @@ class ModifyParamsTaxAmountTaxRateData(TypedDict): The quantity of the subscription, if the line item is a subscription or a proration. """ subscription: Optional[ExpandableField["Subscription"]] + tax_calculation_reference: Optional[TaxCalculationReference] + """ + The tax calculation identifiers of the line item. + """ taxes: Optional[List[Tax]] """ The tax information of the line item. @@ -576,9 +649,11 @@ async def modify_async( _inner_class_types = { "discount_amounts": DiscountAmount, + "margin_amounts": MarginAmount, "parent": Parent, "period": Period, "pretax_credit_amounts": PretaxCreditAmount, "pricing": Pricing, + "tax_calculation_reference": TaxCalculationReference, "taxes": Tax, } diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index 5d7b75a36..ca3f38ce2 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -51,6 +51,10 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. @@ -91,11 +95,43 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceLineItemService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceLineItemService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPeriod(TypedDict): end: int """ diff --git a/stripe/_invoice_payment.py b/stripe/_invoice_payment.py index 5a9b72be1..c6c52ebb6 100644 --- a/stripe/_invoice_payment.py +++ b/stripe/_invoice_payment.py @@ -1,26 +1,18 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField -from stripe._list_object import ListObject -from stripe._listable_api_resource import ListableAPIResource -from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional -from typing_extensions import ( - Literal, - NotRequired, - TypedDict, - Unpack, - TYPE_CHECKING, -) +from typing import ClassVar, Optional +from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._charge import Charge from stripe._invoice import Invoice from stripe._payment_intent import PaymentIntent + from stripe._payment_record import PaymentRecord -class InvoicePayment(ListableAPIResource["InvoicePayment"]): +class InvoicePayment(StripeObject): """ Invoice Payments represent payments made against invoices. Invoice Payments can be accessed in two ways: @@ -43,6 +35,10 @@ class Payment(StripeObject): """ ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019. """ + payment_record: Optional[ExpandableField["PaymentRecord"]] + """ + ID of the PaymentRecord associated with this payment when `type` is `payment_record`. + """ type: Literal["charge", "payment_intent"] """ Type of payment object associated with this invoice payment. @@ -58,52 +54,6 @@ class StatusTransitions(StripeObject): The time that the payment succeeded. """ - class ListParams(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. - """ - invoice: NotRequired[str] - """ - The identifier of the invoice whose payments to return. - """ - 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. - """ - payment: NotRequired["InvoicePayment.ListParamsPayment"] - """ - The payment details of the invoice payments to return. - """ - 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. - """ - status: NotRequired[Literal["canceled", "open", "paid"]] - """ - The status of the invoice payments to return. - """ - - class ListParamsPayment(TypedDict): - payment_intent: NotRequired[str] - """ - Only return invoice payments associated by this payment intent ID. - """ - type: Literal["payment_intent"] - """ - Only return invoice payments associated by this payment type. - """ - - class RetrieveParams(RequestOptions): - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - amount_paid: Optional[int] """ Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent's `amount_received` is not sufficient to pay all of the invoices that it is attached to. @@ -146,69 +96,6 @@ class RetrieveParams(RequestOptions): The status of the payment, one of `open`, `paid`, or `canceled`. """ status_transitions: StatusTransitions - - @classmethod - def list( - cls, **params: Unpack["InvoicePayment.ListParams"] - ) -> ListObject["InvoicePayment"]: - """ - When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. - """ - 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["InvoicePayment.ListParams"] - ) -> ListObject["InvoicePayment"]: - """ - When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. - """ - 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["InvoicePayment.RetrieveParams"] - ) -> "InvoicePayment": - """ - Retrieves the invoice payment with the given ID. - """ - instance = cls(id, **params) - instance.refresh() - return instance - - @classmethod - async def retrieve_async( - cls, id: str, **params: Unpack["InvoicePayment.RetrieveParams"] - ) -> "InvoicePayment": - """ - Retrieves the invoice payment with the given ID. - """ - instance = cls(id, **params) - await instance.refresh_async() - return instance - _inner_class_types = { "payment": Payment, "status_transitions": StatusTransitions, diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 17e2fa1cd..99e3947f2 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -53,6 +53,10 @@ class AddLinesParamsLine(TypedDict): """ ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -93,11 +97,43 @@ class AddLinesParamsLineDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.AddLinesParamsLineDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class AddLinesParamsLineDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.AddLinesParamsLineDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AddLinesParamsLineDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class AddLinesParamsLinePeriod(TypedDict): end: int """ @@ -264,6 +300,10 @@ class AddLinesParamsLineTaxAmountTaxRateData(TypedDict): """ class AttachPaymentParams(TypedDict): + amount_requested: NotRequired[int] + """ + The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -272,12 +312,54 @@ class AttachPaymentParams(TypedDict): """ The ID of the PaymentIntent to attach to the invoice. """ + payment_record: NotRequired[str] + """ + The ID of the PaymentRecord to attach to the invoice. + """ + payment_record_data: NotRequired[ + "InvoiceService.AttachPaymentParamsPaymentRecordData" + ] + """ + The PaymentRecord data for attaching an out of band payment to the invoice. + """ + + class AttachPaymentParamsPaymentRecordData(TypedDict): + amount: int + """ + The amount that was paid out of band. + """ + currency: str + """ + The currency that was paid out of band. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + money_movement_type: str + """ + The type of money movement for this out of band payment record. + """ + paid_at: NotRequired[int] + """ + The timestamp when this out of band payment was paid. + """ + payment_reference: NotRequired[str] + """ + The reference for this out of band payment record. + """ class CreateParams(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ + amounts_due: NotRequired[ + "Literal['']|List[InvoiceService.CreateParamsAmountsDue]" + ] + """ + List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`. + """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @@ -314,10 +396,18 @@ class CreateParams(TypedDict): """ The ID of the customer who will be billed. """ + customer_account: NotRequired[str] + """ + The ID of the account who will be billed. + """ days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ + default_margins: NotRequired[List[str]] + """ + The ids of the margins to apply to the invoice. Can be overridden by line item `margins`. + """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @@ -415,6 +505,24 @@ class CreateParams(TypedDict): If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. """ + class CreateParamsAmountsDue(TypedDict): + amount: int + """ + The amount in cents (or local equivalent). + """ + days_until_due: NotRequired[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: str + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: NotRequired[int] + """ + Date on which a payment plan's payment is due. + """ + class CreateParamsAutomaticTax(TypedDict): enabled: bool """ @@ -456,11 +564,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] """ @@ -493,7 +633,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -524,6 +664,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -655,6 +801,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -697,7 +848,14 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -712,6 +870,10 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ @@ -925,6 +1087,10 @@ class CreatePreviewParams(TypedDict): """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ + customer_account: NotRequired[str] + """ + The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set. + """ customer_details: NotRequired[ "InvoiceService.CreatePreviewParamsCustomerDetails" ] @@ -1238,11 +1404,43 @@ class CreatePreviewParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ @@ -1326,11 +1524,43 @@ class CreatePreviewParamsInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsInvoiceItemPeriod(TypedDict): end: int """ @@ -1376,6 +1606,22 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + amendments: NotRequired[ + List["InvoiceService.CreatePreviewParamsScheduleDetailsAmendment"] + ] + """ + Changes to apply to the phases of the subscription schedule, in the order provided. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. @@ -1386,6 +1632,12 @@ class CreatePreviewParamsScheduleDetails(TypedDict): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ + prebilling: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPrebilling]" + ] + """ + Provide any time periods to bill in advance. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1393,161 +1645,746 @@ class CreatePreviewParamsScheduleDetails(TypedDict): In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ - class CreatePreviewParamsScheduleDetailsPhase(TypedDict): - add_invoice_items: NotRequired[ - List[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" - ] + class CreatePreviewParamsScheduleDetailsAmendment(TypedDict): + amendment_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEnd" ] """ - A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment. """ - application_fee_percent: NotRequired[float] + amendment_start: "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStart" """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + Details to identify the earliest timestamp where the proposed change should take effect. """ - automatic_tax: NotRequired[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + billing_cycle_anchor: NotRequired[ + Literal["amendment_start", "automatic"] ] """ - Automatic tax settings for this phase. + For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment. """ - billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + discount_actions: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentDiscountAction" + ] + ] """ - Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + Changes to the coupons being redeemed or discounts being applied during the amendment time span. """ - billing_thresholds: NotRequired[ - "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + item_actions: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemAction" + ] ] """ - Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + Changes to the subscription items during the amendment time span. """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + metadata_actions: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentMetadataAction" + ] ] """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + Instructions for how to modify phase metadata """ - currency: NotRequired[str] + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`. """ - default_payment_method: NotRequired[str] + set_pause_collection: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollection" + ] """ - ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. """ - default_tax_rates: NotRequired["Literal['']|List[str]"] + set_schedule_end: NotRequired[ + Literal["amendment_end", "amendment_start"] + ] """ - A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + Ends the subscription schedule early as dictated by either the accompanying amendment's start or end. """ - description: NotRequired["Literal['']|str"] + trial_settings: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentTrialSettings" + ] """ - Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + Settings related to subscription trials. """ - discounts: NotRequired[ - "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEnd(TypedDict): + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDiscountEnd" ] """ - The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + Use the `end` time of a given discount. """ - end_date: NotRequired["int|Literal['now']"] + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDuration" + ] """ - The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + Time span for the amendment starting from the `amendment_start`. """ - invoice_settings: NotRequired[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" - ] + timestamp: NotRequired[int] """ - All invoices will be billed using the specified settings. + A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`. """ - items: List[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItem" + type: Literal[ + "discount_end", + "duration", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", ] """ - List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + Select one of three ways to pass the `amendment_end`. """ - iterations: NotRequired[int] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDiscountEnd( + TypedDict, + ): + discount: str """ - Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + The ID of a specific discount. """ - metadata: NotRequired[Dict[str, str]] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - on_behalf_of: NotRequired[str] + interval_count: int """ - The account on behalf of which to charge, for each of the associated subscription's invoices. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStart(TypedDict): + amendment_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartAmendmentEnd" ] """ - Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. + Details of another amendment in the same array, immediately after which this amendment should begin. """ - start_date: NotRequired["int|Literal['now']"] + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartDiscountEnd" + ] """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + Use the `end` time of a given discount. """ - transfer_data: NotRequired[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTransferData" - ] + timestamp: NotRequired[int] """ - The data with which to automatically create a Transfer for each of the associated subscription's invoices. + A precise Unix timestamp for the amendment to start. """ - trial: NotRequired[bool] + type: Literal[ + "amendment_end", + "discount_end", + "now", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] """ - If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + Select one of three ways to pass the `amendment_start`. """ - trial_end: NotRequired["int|Literal['now']"] + + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartAmendmentEnd( + TypedDict, + ): + index: int """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array. """ - class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): - discounts: NotRequired[ - List[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" - ] - ] + class CreatePreviewParamsScheduleDetailsAmendmentAmendmentStartDiscountEnd( + TypedDict, + ): + discount: str """ - The coupons to redeem into discounts for the item. + The ID of a specific discount. """ - price: NotRequired[str] + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountAction(TypedDict): + add: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAdd" + ] """ - The ID of the price object. One of `price` or `price_data` is required. + Details of the discount to add. """ - price_data: NotRequired[ - "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + remove: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionRemove" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + Details of the discount to remove. """ - quantity: NotRequired[int] + set: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionSet" + ] """ - Quantity for this item. Defaults to 1. + Details of the discount to replace the existing discounts with. """ - tax_rates: NotRequired["Literal['']|List[str]"] + type: Literal["add", "remove", "set"] """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + Determines the type of discount action. """ - class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAdd( TypedDict, ): coupon: NotRequired[str] """ - ID of the coupon to create a new discount for. + The coupon code to redeem. """ discount: NotRequired[str] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + An ID of an existing discount for a coupon that was already redeemed. """ - promotion_code: NotRequired[str] + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAddDiscountEnd" + ] """ - ID of the promotion code to create a new discount for. + Details to determine how long the discount should be applied for. """ - - class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionAddDiscountEnd( + TypedDict, + ): + type: Literal["amendment_end"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionRemove( + TypedDict, + ): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentDiscountActionSet( + TypedDict, + ): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemAction(TypedDict): + add: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionAdd" + ] + """ + Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item. + """ + remove: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionRemove" + ] + """ + Details of the subscription item to remove. + """ + set: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionSet" + ] + """ + Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of item action. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAdd(TypedDict): + discounts: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscount" + ] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddTrial" + ] + """ + Options that configure the trial on the subscription item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionAddTrial( + TypedDict, + ): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionRemove( + TypedDict, + ): + price: str + """ + ID of a price to remove. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSet(TypedDict): + discounts: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscount" + ] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetTrial" + ] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentItemActionSetTrial( + TypedDict, + ): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentMetadataAction(TypedDict): + add: NotRequired[Dict[str, str]] + """ + Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata. + """ + remove: NotRequired[List[str]] + """ + Keys to remove from schedule phase metadata. + """ + set: NotRequired["Literal['']|Dict[str, str]"] + """ + Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten. + """ + type: Literal["add", "remove", "set"] + """ + Select one of three ways to update phase-level `metadata` on subscription schedules. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollection( + TypedDict, + ): + set: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollectionSet" + ] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentSetPauseCollectionSet( + TypedDict, + ): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentTrialSettings(TypedDict): + end_behavior: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior( + TypedDict, + ): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): + add_invoice_items: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" + ] + ] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + """ + application_fee_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + """ + automatic_tax: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" + ] + """ + Automatic tax settings for this phase. + """ + billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] + """ + Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: NotRequired[ + "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" + ] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + default_payment_method: NotRequired[str] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + """ + description: NotRequired["Literal['']|str"] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: NotRequired[ + "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscount]" + ] + """ + The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + """ + end_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + """ + invoice_settings: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + items: List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItem" + ] + """ + List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + """ + iterations: NotRequired[int] + """ + Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + """ + on_behalf_of: NotRequired[str] + """ + The account on behalf of which to charge, for each of the associated subscription's invoices. + """ + pause_collection: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. + """ + start_date: NotRequired["int|Literal['now']"] + """ + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + """ + transfer_data: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the associated subscription's invoices. + """ + trial: NotRequired[bool] + """ + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ + trial_end: NotRequired["int|Literal['now']"] + """ + Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + """ + trial_settings: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): + discounts: NotRequired[ + List[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" + ] + ] + """ + The coupons to redeem into discounts for the item. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" + ] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Quantity for this item. Defaults to 1. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( + TypedDict, + ): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( TypedDict, ): currency: str @@ -1616,11 +2453,47 @@ class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEnd( + TypedDict + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1688,6 +2561,12 @@ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemTrial" + ] + """ + Options that configure the trial on the subscription item. + """ class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, @@ -1706,11 +2585,47 @@ class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): currency: str """ @@ -1751,6 +2666,22 @@ class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreatePreviewParamsScheduleDetailsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreatePreviewParamsScheduleDetailsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -1761,12 +2692,88 @@ class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class CreatePreviewParamsScheduleDetailsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreatePreviewParamsScheduleDetailsPhaseTrialSettingsEndBehavior( + TypedDict, + ): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreatePreviewParamsScheduleDetailsPrebilling(TypedDict): + bill_until: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPrebillingBillUntil" + ] + """ + The end of the prebilled time period. + """ + iterations: NotRequired[int] + """ + This is used to determine the number of billing cycles to prebill. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntil(TypedDict): + amendment_end: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd" + ] + """ + End the prebilled period when a specified amendment ends. + """ + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration" + ] + """ + Time span for prebilling, starting from `bill_from`. + """ + timestamp: NotRequired[int] + """ + End the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_end", "duration", "schedule_end", "timestamp"] + """ + Select one of several ways to pass the `bill_until` value. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd( + TypedDict, + ): + index: int + """ + The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class CreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ - cancel_at: NotRequired["Literal['']|int"] + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + cancel_at: NotRequired[ + "Literal['']|int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -1788,6 +2795,12 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ A list of up to 20 subscription items, each with an attached price. """ + prebilling: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsPrebilling" + ] + """ + The pre-billing to apply to the subscription as a preview. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1880,11 +2893,47 @@ class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd( + TypedDict, + ): + duration: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): currency: str """ @@ -1925,6 +2974,12 @@ class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreatePreviewParamsSubscriptionDetailsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + class DeleteParams(TypedDict): pass @@ -1953,6 +3008,10 @@ class ListParams(TypedDict): """ Only return invoices for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return invoices for the account specified by this account ID. + """ due_date: NotRequired["InvoiceService.ListParamsDueDate|int"] ending_before: NotRequired[str] """ @@ -2146,6 +3205,10 @@ class UpdateLinesParamsLine(TypedDict): """ ID of an existing line item on the invoice. """ + margins: NotRequired["Literal['']|List[str]"] + """ + The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. @@ -2188,11 +3251,43 @@ class UpdateLinesParamsLineDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.UpdateLinesParamsLineDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateLinesParamsLineDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.UpdateLinesParamsLineDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateLinesParamsLineDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateLinesParamsLinePeriod(TypedDict): end: int """ @@ -2365,6 +3460,12 @@ class UpdateParams(TypedDict): """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ + amounts_due: NotRequired[ + "Literal['']|List[InvoiceService.UpdateParamsAmountsDue]" + ] + """ + List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`. + """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). @@ -2397,6 +3498,10 @@ class UpdateParams(TypedDict): """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ + default_margins: NotRequired["Literal['']|List[str]"] + """ + The ids of the margins to apply to the invoice. Can be overridden by line item `margins`. + """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. @@ -2484,6 +3589,24 @@ class UpdateParams(TypedDict): If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. """ + class UpdateParamsAmountsDue(TypedDict): + amount: int + """ + The amount in cents (or local equivalent). + """ + days_until_due: NotRequired[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: str + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: NotRequired[int] + """ + Date on which a payment plan's payment is due. + """ + class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ @@ -2525,11 +3648,43 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "InvoiceService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "InvoiceService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsIssuer(TypedDict): account: NotRequired[str] """ @@ -2552,7 +3707,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2583,6 +3738,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -2714,6 +3875,11 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -2756,7 +3922,14 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -2771,6 +3944,10 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class UpdateParamsRendering(TypedDict): amount_tax_display: NotRequired[ diff --git a/stripe/_issuing_service.py b/stripe/_issuing_service.py index bdb9f6321..d3614569e 100644 --- a/stripe/_issuing_service.py +++ b/stripe/_issuing_service.py @@ -4,7 +4,16 @@ from stripe.issuing._authorization_service import AuthorizationService from stripe.issuing._card_service import CardService from stripe.issuing._cardholder_service import CardholderService +from stripe.issuing._credit_underwriting_record_service import ( + CreditUnderwritingRecordService, +) from stripe.issuing._dispute_service import DisputeService +from stripe.issuing._dispute_settlement_detail_service import ( + DisputeSettlementDetailService, +) +from stripe.issuing._fraud_liability_debit_service import ( + FraudLiabilityDebitService, +) from stripe.issuing._personalization_design_service import ( PersonalizationDesignService, ) @@ -19,7 +28,16 @@ def __init__(self, requestor): self.authorizations = AuthorizationService(self._requestor) self.cards = CardService(self._requestor) self.cardholders = CardholderService(self._requestor) + self.credit_underwriting_records = CreditUnderwritingRecordService( + self._requestor, + ) self.disputes = DisputeService(self._requestor) + self.dispute_settlement_details = DisputeSettlementDetailService( + self._requestor, + ) + self.fraud_liability_debits = FraudLiabilityDebitService( + self._requestor, + ) self.personalization_designs = PersonalizationDesignService( self._requestor, ) diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 1df60f0aa..582a837c4 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._discount import Discount as DiscountResource from stripe._price import Price + from stripe._product import Product from stripe._tax_rate import TaxRate @@ -17,6 +19,11 @@ class LineItem(StripeObject): OBJECT_NAME: ClassVar[Literal["item"]] = "item" + class AdjustableQuantity(StripeObject): + enabled: bool + maximum: Optional[int] + minimum: Optional[int] + class Discount(StripeObject): amount: int """ @@ -30,6 +37,21 @@ class Discount(StripeObject): Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) """ + class Display(StripeObject): + description: Optional[str] + images: List[str] + name: str + + class TaxCalculationReference(StripeObject): + calculation_id: Optional[str] + """ + The calculation identifier for tax calculation response. + """ + calculation_item_id: Optional[str] + """ + The calculation identifier for tax calculation response line item. + """ + class Tax(StripeObject): amount: int """ @@ -68,6 +90,7 @@ class Tax(StripeObject): The amount on which tax is calculated, in cents (or local equivalent). """ + adjustable_quantity: Optional[AdjustableQuantity] amount_discount: int """ Total discount amount applied. If no discounts were applied, defaults to 0. @@ -96,10 +119,15 @@ class Tax(StripeObject): """ The discounts applied to the line item. """ + display: Optional[Display] id: str """ Unique identifier for the object. """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ object: Literal["item"] """ String representing the object's type. Objects of the same type share the same value. @@ -108,12 +136,28 @@ class Tax(StripeObject): """ The price used to generate the line item. """ + product: Optional[ExpandableField["Product"]] + """ + The ID of the product for this line item. + + This will always be the same as `price.product`. + """ quantity: Optional[int] """ The quantity of products being purchased. """ + tax_calculation_reference: Optional[TaxCalculationReference] + """ + The tax calculation identifiers of the line item. + """ taxes: Optional[List[Tax]] """ The taxes applied to the line item. """ - _inner_class_types = {"discounts": Discount, "taxes": Tax} + _inner_class_types = { + "adjustable_quantity": AdjustableQuantity, + "discounts": Discount, + "display": Display, + "tax_calculation_reference": TaxCalculationReference, + "taxes": Tax, + } diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 0260a4fd0..161483efd 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -129,10 +129,72 @@ class Paypal(StripeObject): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + """ payer_id: Optional[str] """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class Payto(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Literal["fixed", "maximum"] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: Optional[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class RevolutPay(StripeObject): pass @@ -165,6 +227,7 @@ class UsBankAccount(StripeObject): naver_pay: Optional[NaverPay] nz_bank_account: Optional[NzBankAccount] paypal: Optional[Paypal] + payto: Optional[Payto] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] type: str @@ -185,6 +248,7 @@ class UsBankAccount(StripeObject): "naver_pay": NaverPay, "nz_bank_account": NzBankAccount, "paypal": Paypal, + "payto": Payto, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, diff --git a/stripe/_margin.py b/stripe/_margin.py new file mode 100644 index 000000000..d3563029b --- /dev/null +++ b/stripe/_margin.py @@ -0,0 +1,258 @@ +# -*- 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._request_options import RequestOptions +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id +from typing import ClassVar, Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, Unpack + + +class Margin( + CreateableAPIResource["Margin"], + ListableAPIResource["Margin"], + UpdateableAPIResource["Margin"], +): + """ + A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who + resell products and services and earn a discount (margin) for doing so. + """ + + OBJECT_NAME: ClassVar[Literal["margin"]] = "margin" + + class CreateParams(RequestOptions): + active: NotRequired[bool] + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items or not. Defaults to `true`. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: NotRequired[str] + """ + Name of the margin, which is displayed to customers, such as on invoices. + """ + percent_off: float + """ + Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + """ + + class ListParams(RequestOptions): + active: NotRequired[bool] + """ + Only return margins that are active or inactive. For example, pass `true` to only list active margins. + """ + 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. + """ + + class ModifyParams(RequestOptions): + active: NotRequired[bool] + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items or not. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: NotRequired[str] + """ + Name of the margin, which is displayed to customers, such as on invoices. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + active: bool + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + name: Optional[str] + """ + Name of the margin that's displayed on, for example, invoices. + """ + object: Literal["margin"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + percent_off: float + """ + Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + """ + updated: int + """ + Time at which the object was last updated. Measured in seconds since the Unix epoch. + """ + + @classmethod + def create(cls, **params: Unpack["Margin.CreateParams"]) -> "Margin": + """ + Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. + """ + return cast( + "Margin", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["Margin.CreateParams"] + ) -> "Margin": + """ + Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. + """ + return cast( + "Margin", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["Margin.ListParams"] + ) -> ListObject["Margin"]: + """ + Retrieve a list of your margins. + """ + 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["Margin.ListParams"] + ) -> ListObject["Margin"]: + """ + Retrieve a list of your margins. + """ + 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 modify( + cls, id: str, **params: Unpack["Margin.ModifyParams"] + ) -> "Margin": + """ + Update the specified margin object. Certain fields of the margin object are not editable. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Margin", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Margin.ModifyParams"] + ) -> "Margin": + """ + Update the specified margin object. Certain fields of the margin object are not editable. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Margin", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Margin.RetrieveParams"] + ) -> "Margin": + """ + Retrieve a margin object with the given ID. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Margin.RetrieveParams"] + ) -> "Margin": + """ + Retrieve a margin object with the given ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/billing/margins" diff --git a/stripe/_margin_service.py b/stripe/_margin_service.py new file mode 100644 index 000000000..fc82fe7fe --- /dev/null +++ b/stripe/_margin_service.py @@ -0,0 +1,243 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._margin import Margin +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Dict, List, cast +from typing_extensions import NotRequired, TypedDict + + +class MarginService(StripeService): + class CreateParams(TypedDict): + active: NotRequired[bool] + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items or not. Defaults to `true`. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: NotRequired[str] + """ + Name of the margin, which is displayed to customers, such as on invoices. + """ + percent_off: float + """ + Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + """ + + class ListParams(TypedDict): + active: NotRequired[bool] + """ + Only return margins that are active or inactive. For example, pass `true` to only list active margins. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + active: NotRequired[bool] + """ + Whether the margin can be applied to invoices, invoice items, or invoice line items or not. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: NotRequired[str] + """ + Name of the margin, which is displayed to customers, such as on invoices. + """ + + def list( + self, + params: "MarginService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Margin]: + """ + Retrieve a list of your margins. + """ + return cast( + ListObject[Margin], + self._request( + "get", + "/v1/billing/margins", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "MarginService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Margin]: + """ + Retrieve a list of your margins. + """ + return cast( + ListObject[Margin], + await self._request_async( + "get", + "/v1/billing/margins", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "MarginService.CreateParams", + options: RequestOptions = {}, + ) -> Margin: + """ + Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. + """ + return cast( + Margin, + self._request( + "post", + "/v1/billing/margins", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "MarginService.CreateParams", + options: RequestOptions = {}, + ) -> Margin: + """ + Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. + """ + return cast( + Margin, + await self._request_async( + "post", + "/v1/billing/margins", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + margin: str, + params: "MarginService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Margin: + """ + Retrieve a margin object with the given ID. + """ + return cast( + Margin, + self._request( + "get", + "/v1/billing/margins/{margin}".format( + margin=sanitize_id(margin), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + margin: str, + params: "MarginService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Margin: + """ + Retrieve a margin object with the given ID. + """ + return cast( + Margin, + await self._request_async( + "get", + "/v1/billing/margins/{margin}".format( + margin=sanitize_id(margin), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + margin: str, + params: "MarginService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Margin: + """ + Update the specified margin object. Certain fields of the margin object are not editable. + """ + return cast( + Margin, + self._request( + "post", + "/v1/billing/margins/{margin}".format( + margin=sanitize_id(margin), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + margin: str, + params: "MarginService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Margin: + """ + Update the specified margin object. Certain fields of the margin object are not editable. + """ + return cast( + Margin, + await self._request_async( + "post", + "/v1/billing/margins/{margin}".format( + margin=sanitize_id(margin), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 0fdfe4da1..ca547c198 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -9,6 +9,7 @@ # Object classes: The beginning of the section generated from our OpenAPI spec stripe.Account.OBJECT_NAME: stripe.Account, stripe.AccountLink.OBJECT_NAME: stripe.AccountLink, + stripe.AccountNotice.OBJECT_NAME: stripe.AccountNotice, stripe.AccountSession.OBJECT_NAME: stripe.AccountSession, stripe.ApplePayDomain.OBJECT_NAME: stripe.ApplePayDomain, stripe.Application.OBJECT_NAME: stripe.Application, @@ -16,6 +17,7 @@ stripe.ApplicationFeeRefund.OBJECT_NAME: stripe.ApplicationFeeRefund, stripe.apps.Secret.OBJECT_NAME: stripe.apps.Secret, stripe.Balance.OBJECT_NAME: stripe.Balance, + stripe.BalanceSettings.OBJECT_NAME: stripe.BalanceSettings, stripe.BalanceTransaction.OBJECT_NAME: stripe.BalanceTransaction, stripe.BankAccount.OBJECT_NAME: stripe.BankAccount, stripe.billing_portal.Configuration.OBJECT_NAME: stripe.billing_portal.Configuration, @@ -30,6 +32,9 @@ stripe.billing.MeterEventAdjustment.OBJECT_NAME: stripe.billing.MeterEventAdjustment, stripe.billing.MeterEventSummary.OBJECT_NAME: stripe.billing.MeterEventSummary, stripe.Capability.OBJECT_NAME: stripe.Capability, + stripe.capital.FinancingOffer.OBJECT_NAME: stripe.capital.FinancingOffer, + stripe.capital.FinancingSummary.OBJECT_NAME: stripe.capital.FinancingSummary, + stripe.capital.FinancingTransaction.OBJECT_NAME: stripe.capital.FinancingTransaction, stripe.Card.OBJECT_NAME: stripe.Card, stripe.CashBalance.OBJECT_NAME: stripe.CashBalance, stripe.Charge.OBJECT_NAME: stripe.Charge, @@ -58,12 +63,15 @@ stripe.File.OBJECT_NAME: stripe.File, stripe.FileLink.OBJECT_NAME: stripe.FileLink, stripe.financial_connections.Account.OBJECT_NAME: stripe.financial_connections.Account, + stripe.financial_connections.AccountInferredBalance.OBJECT_NAME: stripe.financial_connections.AccountInferredBalance, stripe.financial_connections.AccountOwner.OBJECT_NAME: stripe.financial_connections.AccountOwner, stripe.financial_connections.AccountOwnership.OBJECT_NAME: stripe.financial_connections.AccountOwnership, + stripe.financial_connections.Institution.OBJECT_NAME: stripe.financial_connections.Institution, stripe.financial_connections.Session.OBJECT_NAME: stripe.financial_connections.Session, stripe.financial_connections.Transaction.OBJECT_NAME: stripe.financial_connections.Transaction, stripe.forwarding.Request.OBJECT_NAME: stripe.forwarding.Request, stripe.FundingInstructions.OBJECT_NAME: stripe.FundingInstructions, + stripe.FxQuote.OBJECT_NAME: stripe.FxQuote, stripe.identity.VerificationReport.OBJECT_NAME: stripe.identity.VerificationReport, stripe.identity.VerificationSession.OBJECT_NAME: stripe.identity.VerificationSession, stripe.Invoice.OBJECT_NAME: stripe.Invoice, @@ -74,27 +82,41 @@ stripe.issuing.Authorization.OBJECT_NAME: stripe.issuing.Authorization, stripe.issuing.Card.OBJECT_NAME: stripe.issuing.Card, stripe.issuing.Cardholder.OBJECT_NAME: stripe.issuing.Cardholder, + stripe.issuing.CreditUnderwritingRecord.OBJECT_NAME: stripe.issuing.CreditUnderwritingRecord, stripe.issuing.Dispute.OBJECT_NAME: stripe.issuing.Dispute, + stripe.issuing.DisputeSettlementDetail.OBJECT_NAME: stripe.issuing.DisputeSettlementDetail, + stripe.issuing.FraudLiabilityDebit.OBJECT_NAME: stripe.issuing.FraudLiabilityDebit, stripe.issuing.PersonalizationDesign.OBJECT_NAME: stripe.issuing.PersonalizationDesign, stripe.issuing.PhysicalBundle.OBJECT_NAME: stripe.issuing.PhysicalBundle, + stripe.issuing.Settlement.OBJECT_NAME: stripe.issuing.Settlement, stripe.issuing.Token.OBJECT_NAME: stripe.issuing.Token, stripe.issuing.Transaction.OBJECT_NAME: stripe.issuing.Transaction, stripe.LineItem.OBJECT_NAME: stripe.LineItem, stripe.LoginLink.OBJECT_NAME: stripe.LoginLink, stripe.Mandate.OBJECT_NAME: stripe.Mandate, + stripe.Margin.OBJECT_NAME: stripe.Margin, + stripe.Order.OBJECT_NAME: stripe.Order, + stripe.PaymentAttemptRecord.OBJECT_NAME: stripe.PaymentAttemptRecord, stripe.PaymentIntent.OBJECT_NAME: stripe.PaymentIntent, + stripe.PaymentIntentAmountDetailsLineItem.OBJECT_NAME: stripe.PaymentIntentAmountDetailsLineItem, stripe.PaymentLink.OBJECT_NAME: stripe.PaymentLink, stripe.PaymentMethod.OBJECT_NAME: stripe.PaymentMethod, stripe.PaymentMethodConfiguration.OBJECT_NAME: stripe.PaymentMethodConfiguration, stripe.PaymentMethodDomain.OBJECT_NAME: stripe.PaymentMethodDomain, + stripe.PaymentRecord.OBJECT_NAME: stripe.PaymentRecord, stripe.Payout.OBJECT_NAME: stripe.Payout, stripe.Person.OBJECT_NAME: stripe.Person, stripe.Plan.OBJECT_NAME: stripe.Plan, stripe.Price.OBJECT_NAME: stripe.Price, + stripe.privacy.RedactionJob.OBJECT_NAME: stripe.privacy.RedactionJob, + stripe.privacy.RedactionJobValidationError.OBJECT_NAME: stripe.privacy.RedactionJobValidationError, stripe.Product.OBJECT_NAME: stripe.Product, stripe.ProductFeature.OBJECT_NAME: stripe.ProductFeature, stripe.PromotionCode.OBJECT_NAME: stripe.PromotionCode, stripe.Quote.OBJECT_NAME: stripe.Quote, + stripe.QuoteLine.OBJECT_NAME: stripe.QuoteLine, + stripe.QuotePreviewInvoice.OBJECT_NAME: stripe.QuotePreviewInvoice, + stripe.QuotePreviewSubscriptionSchedule.OBJECT_NAME: stripe.QuotePreviewSubscriptionSchedule, stripe.radar.EarlyFraudWarning.OBJECT_NAME: stripe.radar.EarlyFraudWarning, stripe.radar.ValueList.OBJECT_NAME: stripe.radar.ValueList, stripe.radar.ValueListItem.OBJECT_NAME: stripe.radar.ValueListItem, @@ -114,8 +136,10 @@ stripe.Subscription.OBJECT_NAME: stripe.Subscription, stripe.SubscriptionItem.OBJECT_NAME: stripe.SubscriptionItem, stripe.SubscriptionSchedule.OBJECT_NAME: stripe.SubscriptionSchedule, + stripe.tax.Association.OBJECT_NAME: stripe.tax.Association, stripe.tax.Calculation.OBJECT_NAME: stripe.tax.Calculation, stripe.tax.CalculationLineItem.OBJECT_NAME: stripe.tax.CalculationLineItem, + stripe.tax.Form.OBJECT_NAME: stripe.tax.Form, stripe.tax.Registration.OBJECT_NAME: stripe.tax.Registration, stripe.tax.Settings.OBJECT_NAME: stripe.tax.Settings, stripe.tax.Transaction.OBJECT_NAME: stripe.tax.Transaction, @@ -128,6 +152,7 @@ stripe.terminal.ConnectionToken.OBJECT_NAME: stripe.terminal.ConnectionToken, stripe.terminal.Location.OBJECT_NAME: stripe.terminal.Location, stripe.terminal.Reader.OBJECT_NAME: stripe.terminal.Reader, + stripe.terminal.ReaderCollectedData.OBJECT_NAME: stripe.terminal.ReaderCollectedData, stripe.test_helpers.TestClock.OBJECT_NAME: stripe.test_helpers.TestClock, stripe.Token.OBJECT_NAME: stripe.Token, stripe.Topup.OBJECT_NAME: stripe.Topup, @@ -152,7 +177,29 @@ stripe.v2.billing.MeterEvent.OBJECT_NAME: stripe.v2.billing.MeterEvent, stripe.v2.billing.MeterEventAdjustment.OBJECT_NAME: stripe.v2.billing.MeterEventAdjustment, stripe.v2.billing.MeterEventSession.OBJECT_NAME: stripe.v2.billing.MeterEventSession, + stripe.v2.core.Account.OBJECT_NAME: stripe.v2.core.Account, + stripe.v2.core.AccountLink.OBJECT_NAME: stripe.v2.core.AccountLink, + stripe.v2.core.Person.OBJECT_NAME: stripe.v2.core.Person, + stripe.v2.core.vault.GbBankAccount.OBJECT_NAME: stripe.v2.core.vault.GbBankAccount, + stripe.v2.core.vault.UsBankAccount.OBJECT_NAME: stripe.v2.core.vault.UsBankAccount, stripe.v2.Event.OBJECT_NAME: stripe.v2.Event, stripe.v2.EventDestination.OBJECT_NAME: stripe.v2.EventDestination, + stripe.v2.FinancialAddressCreditSimulation.OBJECT_NAME: stripe.v2.FinancialAddressCreditSimulation, + stripe.v2.FinancialAddressGeneratedMicrodeposits.OBJECT_NAME: stripe.v2.FinancialAddressGeneratedMicrodeposits, + stripe.v2.money_management.Adjustment.OBJECT_NAME: stripe.v2.money_management.Adjustment, + stripe.v2.money_management.FinancialAccount.OBJECT_NAME: stripe.v2.money_management.FinancialAccount, + stripe.v2.money_management.FinancialAddress.OBJECT_NAME: stripe.v2.money_management.FinancialAddress, + stripe.v2.money_management.InboundTransfer.OBJECT_NAME: stripe.v2.money_management.InboundTransfer, + stripe.v2.money_management.OutboundPayment.OBJECT_NAME: stripe.v2.money_management.OutboundPayment, + stripe.v2.money_management.OutboundPaymentQuote.OBJECT_NAME: stripe.v2.money_management.OutboundPaymentQuote, + stripe.v2.money_management.OutboundSetupIntent.OBJECT_NAME: stripe.v2.money_management.OutboundSetupIntent, + stripe.v2.money_management.OutboundTransfer.OBJECT_NAME: stripe.v2.money_management.OutboundTransfer, + stripe.v2.money_management.PayoutMethod.OBJECT_NAME: stripe.v2.money_management.PayoutMethod, + stripe.v2.money_management.PayoutMethodsBankAccountSpec.OBJECT_NAME: stripe.v2.money_management.PayoutMethodsBankAccountSpec, + stripe.v2.money_management.ReceivedCredit.OBJECT_NAME: stripe.v2.money_management.ReceivedCredit, + stripe.v2.money_management.ReceivedDebit.OBJECT_NAME: stripe.v2.money_management.ReceivedDebit, + stripe.v2.money_management.Transaction.OBJECT_NAME: stripe.v2.money_management.Transaction, + stripe.v2.money_management.TransactionEntry.OBJECT_NAME: stripe.v2.money_management.TransactionEntry, + stripe.v2.payments.OffSessionPayment.OBJECT_NAME: stripe.v2.payments.OffSessionPayment, # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_order.py b/stripe/_order.py new file mode 100644 index 000000000..513e6427e --- /dev/null +++ b/stripe/_order.py @@ -0,0 +1,4279 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._application import Application + from stripe._customer import Customer + from stripe._discount import Discount as DiscountResource + from stripe._line_item import LineItem as LineItemResource + from stripe._payment_intent import PaymentIntent + from stripe._shipping_rate import ShippingRate + from stripe._tax_rate import TaxRate + + +class Order( + CreateableAPIResource["Order"], + ListableAPIResource["Order"], + UpdateableAPIResource["Order"], +): + """ + An Order describes a purchase being made by a customer, including the + products & quantities being purchased, the order status, the payment information, + and the billing/shipping details. + + Related guide: [Orders overview](https://stripe.com/docs/orders) + """ + + OBJECT_NAME: ClassVar[Literal["order"]] = "order" + + class AutomaticTax(StripeObject): + enabled: bool + """ + Whether Stripe automatically computes tax on this Order. + """ + status: Optional[ + Literal["complete", "failed", "requires_location_inputs"] + ] + """ + The status of the most recent automated tax calculation for this Order. + """ + + class BillingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + """ + Billing address for the order. + """ + email: Optional[str] + """ + Email address for the order. + """ + name: Optional[str] + """ + Full name for the order. + """ + phone: Optional[str] + """ + Billing phone number for the order (including extension). + """ + _inner_class_types = {"address": Address} + + class Payment(StripeObject): + class Settings(StripeObject): + class AutomaticPaymentMethods(StripeObject): + enabled: bool + """ + Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + + class PaymentMethodOptions(StripeObject): + class AcssDebit(StripeObject): + class MandateOptions(StripeObject): + custom_mandate_url: Optional[str] + """ + A URL for custom mandate text + """ + interval_description: Optional[str] + """ + Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: Optional[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: Optional[ + Literal["business", "personal"] + ] + """ + Transaction type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: Optional[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + _inner_class_types = {"mandate_options": MandateOptions} + + class AfterpayClearpay(StripeObject): + capture_method: Optional[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + reference: Optional[str] + """ + Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class Alipay(StripeObject): + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Bancontact(StripeObject): + preferred_language: Literal["de", "en", "fr", "nl"] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Card(StripeObject): + capture_method: Literal[ + "automatic", "automatic_async", "manual" + ] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class CustomerBalance(StripeObject): + class BankTransfer(StripeObject): + class EuBankTransfer(StripeObject): + country: Literal[ + "BE", "DE", "ES", "FR", "IE", "NL" + ] + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + eu_bank_transfer: Optional[EuBankTransfer] + requested_address_types: Optional[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Optional[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + ] + """ + The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + _inner_class_types = { + "eu_bank_transfer": EuBankTransfer, + } + + bank_transfer: Optional[BankTransfer] + funding_type: Optional[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + _inner_class_types = {"bank_transfer": BankTransfer} + + class Ideal(StripeObject): + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Klarna(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + preferred_locale: Optional[str] + """ + Preferred locale of the Klarna checkout page that the customer is redirected to. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Link(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + persistent_token: Optional[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Oxxo(StripeObject): + expires_after_days: int + """ + The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class P24(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Paypal(StripeObject): + class LineItem(StripeObject): + class Tax(StripeObject): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + category: Optional[ + Literal[ + "digital_goods", "donation", "physical_goods" + ] + ] + """ + Type of the line item. + """ + description: Optional[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Cannot be a negative number. + """ + sku: Optional[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: Optional[str] + """ + The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + """ + tax: Optional[Tax] + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + _inner_class_types = {"tax": Tax} + + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: Optional[List[LineItem]] + """ + The line items purchased by the customer. + """ + preferred_locale: Optional[str] + """ + Preferred locale of the PayPal checkout page that the customer is redirected to. + """ + reference: Optional[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: Optional[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + subsellers: Optional[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + _inner_class_types = {"line_items": LineItem} + + class SepaDebit(StripeObject): + class MandateOptions(StripeObject): + reference_prefix: Optional[str] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + target_date: Optional[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + _inner_class_types = {"mandate_options": MandateOptions} + + class Sofort(StripeObject): + preferred_language: Optional[ + Literal["de", "en", "es", "fr", "it", "nl", "pl"] + ] + """ + Preferred language of the SOFORT authorization page that the customer is redirected to. + """ + setup_future_usage: Optional[ + Literal["none", "off_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class WechatPay(StripeObject): + app_id: Optional[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: Optional[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + acss_debit: Optional[AcssDebit] + afterpay_clearpay: Optional[AfterpayClearpay] + alipay: Optional[Alipay] + bancontact: Optional[Bancontact] + card: Optional[Card] + customer_balance: Optional[CustomerBalance] + ideal: Optional[Ideal] + klarna: Optional[Klarna] + link: Optional[Link] + oxxo: Optional[Oxxo] + p24: Optional[P24] + paypal: Optional[Paypal] + sepa_debit: Optional[SepaDebit] + sofort: Optional[Sofort] + wechat_pay: Optional[WechatPay] + _inner_class_types = { + "acss_debit": AcssDebit, + "afterpay_clearpay": AfterpayClearpay, + "alipay": Alipay, + "bancontact": Bancontact, + "card": Card, + "customer_balance": CustomerBalance, + "ideal": Ideal, + "klarna": Klarna, + "link": Link, + "oxxo": Oxxo, + "p24": P24, + "paypal": Paypal, + "sepa_debit": SepaDebit, + "sofort": Sofort, + "wechat_pay": WechatPay, + } + + class TransferData(StripeObject): + amount: Optional[int] + """ + The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + destination: ExpandableField["Account"] + """ + ID of the Connected account receiving the transfer. + """ + + application_fee_amount: Optional[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + """ + automatic_payment_methods: Optional[AutomaticPaymentMethods] + """ + Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. + """ + payment_method_options: Optional[PaymentMethodOptions] + """ + PaymentMethod-specific configuration to provide to the order's PaymentIntent. + """ + payment_method_types: Optional[ + List[ + Literal[ + "acss_debit", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "card", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "link", + "oxxo", + "p24", + "paypal", + "sepa_debit", + "sofort", + "wechat_pay", + ] + ] + ] + """ + The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + return_url: Optional[str] + """ + The URL to redirect the customer to after they authenticate their payment. + """ + statement_descriptor: Optional[str] + """ + For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + """ + statement_descriptor_suffix: Optional[str] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + """ + transfer_data: Optional[TransferData] + """ + Provides configuration for completing a transfer for the order after it is paid. + """ + _inner_class_types = { + "automatic_payment_methods": AutomaticPaymentMethods, + "payment_method_options": PaymentMethodOptions, + "transfer_data": TransferData, + } + + payment_intent: Optional[ExpandableField["PaymentIntent"]] + """ + ID of the payment intent associated with this order. Null when the order is `open`. + """ + settings: Optional[Settings] + """ + Settings describing how the order should configure generated PaymentIntents. + """ + status: Optional[ + Literal[ + "canceled", + "complete", + "not_required", + "processing", + "requires_action", + "requires_capture", + "requires_confirmation", + "requires_payment_method", + ] + ] + """ + The status of the underlying payment associated with this order, if any. Null when the order is `open`. + """ + _inner_class_types = {"settings": Settings} + + class ShippingCost(StripeObject): + class Tax(StripeObject): + amount: int + """ + Amount of tax applied for this rate. + """ + rate: "TaxRate" + """ + Tax rates can be applied to [invoices](https://docs.stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://docs.stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://docs.stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. + + Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) + """ + taxability_reason: Optional[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + """ + taxable_amount: Optional[int] + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + amount_subtotal: int + """ + Total shipping cost before any discounts or taxes are applied. + """ + amount_tax: int + """ + Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + """ + amount_total: int + """ + Total shipping cost after discounts and taxes are applied. + """ + shipping_rate: Optional[ExpandableField["ShippingRate"]] + """ + The ID of the ShippingRate for this order. + """ + taxes: Optional[List[Tax]] + """ + The taxes applied to the shipping rate. + """ + _inner_class_types = {"taxes": Tax} + + class ShippingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + """ + Recipient shipping address. Required if the order includes products that are shippable. + """ + name: Optional[str] + """ + Recipient name. + """ + phone: Optional[str] + """ + Recipient phone (including extension). + """ + _inner_class_types = {"address": Address} + + class TaxDetails(StripeObject): + class TaxId(StripeObject): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "unknown", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + """ + value: Optional[str] + """ + The value of the tax ID. + """ + + tax_exempt: Literal["exempt", "none", "reverse"] + """ + Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: List[TaxId] + """ + The purchaser's tax IDs to be used in calculation of tax for this Order. + """ + _inner_class_types = {"tax_ids": TaxId} + + class TotalDetails(StripeObject): + class Breakdown(StripeObject): + class Discount(StripeObject): + amount: int + """ + The amount discounted. + """ + discount: "DiscountResource" + """ + A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + It contains information about when the discount began, when it will end, and what it is applied to. + + Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + """ + + class Tax(StripeObject): + amount: int + """ + Amount of tax applied for this rate. + """ + rate: "TaxRate" + """ + Tax rates can be applied to [invoices](https://docs.stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://docs.stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://docs.stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. + + Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) + """ + taxability_reason: Optional[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + """ + taxable_amount: Optional[int] + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + discounts: List[Discount] + """ + The aggregated discounts. + """ + taxes: List[Tax] + """ + The aggregated tax amounts by rate. + """ + _inner_class_types = {"discounts": Discount, "taxes": Tax} + + amount_discount: int + """ + This is the sum of all the discounts. + """ + amount_shipping: Optional[int] + """ + This is the sum of all the shipping amounts. + """ + amount_tax: int + """ + This is the sum of all the tax amounts. + """ + breakdown: Optional[Breakdown] + _inner_class_types = {"breakdown": Breakdown} + + class CancelParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(RequestOptions): + automatic_tax: NotRequired["Order.CreateParamsAutomaticTax"] + """ + Settings for automatic tax calculation for this order. + """ + billing_details: NotRequired[ + "Literal['']|Order.CreateParamsBillingDetails" + ] + """ + Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The customer associated with this order. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + discounts: NotRequired["Literal['']|List[Order.CreateParamsDiscount]"] + """ + The coupons, promotion codes, and/or discounts to apply to the order. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + ip_address: NotRequired[str] + """ + The IP address of the purchaser for this order. + """ + line_items: List["Order.CreateParamsLineItem"] + """ + A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment: NotRequired["Order.CreateParamsPayment"] + """ + Payment information associated with the order, including payment settings. + """ + shipping_cost: NotRequired[ + "Literal['']|Order.CreateParamsShippingCost" + ] + """ + Settings for the customer cost of shipping for this order. + """ + shipping_details: NotRequired[ + "Literal['']|Order.CreateParamsShippingDetails" + ] + """ + Shipping details for the order. + """ + tax_details: NotRequired["Order.CreateParamsTaxDetails"] + """ + Additional tax details about the purchaser to be used for this order. + """ + + class CreateParamsAutomaticTax(TypedDict): + enabled: bool + """ + Enable automatic tax calculation which will automatically compute tax rates on this order. + """ + + class CreateParamsBillingDetails(TypedDict): + address: NotRequired["Order.CreateParamsBillingDetailsAddress"] + """ + The billing address provided by the customer. + """ + email: NotRequired[str] + """ + The billing email provided by the customer. + """ + name: NotRequired[str] + """ + The billing name provided by the customer. + """ + phone: NotRequired[str] + """ + The billing phone number provided by the customer. + """ + + class CreateParamsBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreateParamsLineItem(TypedDict): + description: NotRequired[str] + """ + The description for the line item. Will default to the name of the associated product. + """ + discounts: NotRequired[ + "Literal['']|List[Order.CreateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + price: NotRequired[str] + """ + The ID of a [Price](https://docs.stripe.com/api/prices) to add to the Order. + + The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + """ + price_data: NotRequired["Order.CreateParamsLineItemPriceData"] + """ + Data used to generate a new Price object inline. + + The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create a Product upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + + Each time you pass `price_data` we create a Price for the Product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + """ + product: NotRequired[str] + """ + The ID of a [Product](https://docs.stripe.com/api/products) to add to the Order. + + The Product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + """ + product_data: NotRequired["Order.CreateParamsLineItemProductData"] + """ + Defines a [Product](https://docs.stripe.com/api/products) inline and adds it to the Order. + + `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + + `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates applied to this line item. + """ + + class CreateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class CreateParamsLineItemPriceData(TypedDict): + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + ID of the [Product](https://docs.stripe.com/api/products) this [Price](https://docs.stripe.com/api/prices) belongs to. + + Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specified. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreateParamsLineItemProductData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + id: str + """ + A unique identifier for this product. + + `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + """ + images: NotRequired["Literal['']|List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + package_dimensions: NotRequired[ + "Literal['']|Order.CreateParamsLineItemProductDataPackageDimensions" + ] + """ + The dimensions of this product for shipping purposes. + """ + shippable: NotRequired[bool] + """ + Whether this product is shipped (i.e., physical goods). + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + url: NotRequired["Literal['']|str"] + """ + A URL of a publicly-accessible webpage for this product. + """ + + class CreateParamsLineItemProductDataPackageDimensions(TypedDict): + height: float + """ + Height, in inches. Maximum precision is 2 decimal places. + """ + length: float + """ + Length, in inches. Maximum precision is 2 decimal places. + """ + weight: float + """ + Weight, in ounces. Maximum precision is 2 decimal places. + """ + width: float + """ + Width, in inches. Maximum precision is 2 decimal places. + """ + + class CreateParamsPayment(TypedDict): + settings: "Order.CreateParamsPaymentSettings" + """ + Settings describing how the order should configure generated PaymentIntents. + """ + + class CreateParamsPaymentSettings(TypedDict): + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + """ + payment_method_options: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptions" + ] + """ + PaymentMethod-specific configuration to provide to the order's PaymentIntent. + """ + payment_method_types: NotRequired[ + List[ + Literal[ + "acss_debit", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "card", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "link", + "oxxo", + "p24", + "paypal", + "sepa_debit", + "sofort", + "wechat_pay", + ] + ] + ] + """ + The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + return_url: NotRequired[str] + """ + The URL to redirect the customer to after they authenticate their payment. + """ + statement_descriptor: NotRequired[str] + """ + For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + """ + transfer_data: NotRequired[ + "Order.CreateParamsPaymentSettingsTransferData" + ] + """ + Provides configuration for completing a transfer for the order after it is paid. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" + ] + """ + If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + """ + afterpay_clearpay: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + """ + alipay: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsAlipay" + ] + """ + If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + """ + bancontact: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" + ] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + """ + card: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsCard" + ] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + """ + customer_balance: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" + ] + """ + If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + """ + ideal: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsIdeal" + ] + """ + If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + """ + klarna: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarna" + ] + """ + If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + """ + link: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsLink" + ] + """ + If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + """ + oxxo: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsOxxo" + ] + """ + If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + """ + p24: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsP24" + ] + """ + If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + """ + paypal: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsPaypal" + ] + """ + If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + """ + sepa_debit: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + """ + sofort: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsSofort" + ] + """ + If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + """ + wechat_pay: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsWechatPay" + ] + """ + If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + TypedDict, + ): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay( + TypedDict, + ): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference this payment corresponds to. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + TypedDict, + ): + bank_transfer: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem( + TypedDict, + ): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax( + TypedDict, + ): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions( + TypedDict, + ): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + destination: str + """ + ID of the Connected account receiving the transfer. + """ + + class CreateParamsShippingCost(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the shipping rate to use for this order. + """ + shipping_rate_data: NotRequired[ + "Order.CreateParamsShippingCostShippingRateData" + ] + """ + Parameters to create a new ad-hoc shipping rate for this order. + """ + + class CreateParamsShippingCostShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "Order.CreateParamsShippingCostShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "Order.CreateParamsShippingCostShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): + maximum: NotRequired[ + "Order.CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "Order.CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + currency_options: NotRequired[ + Dict[ + str, + "Order.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + + class CreateParamsShippingDetails(TypedDict): + address: "Order.CreateParamsShippingDetailsAddress" + """ + The shipping address for the order. + """ + name: str + """ + The name of the recipient of the order. + """ + phone: NotRequired["Literal['']|str"] + """ + The phone number (including extension) for the recipient of the order. + """ + + class CreateParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class CreateParamsTaxDetails(TypedDict): + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[List["Order.CreateParamsTaxDetailsTaxId"]] + """ + The purchaser's tax IDs to be used for this order. + """ + + class CreateParamsTaxDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + """ + value: str + """ + Value of the tax ID. + """ + + class ListLineItemsParams(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. + """ + + class ListParams(RequestOptions): + customer: NotRequired[str] + """ + Only return orders for the given customer. + """ + 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. + """ + + class ModifyParams(RequestOptions): + automatic_tax: NotRequired["Order.ModifyParamsAutomaticTax"] + """ + Settings for automatic tax calculation for this order. + """ + billing_details: NotRequired[ + "Literal['']|Order.ModifyParamsBillingDetails" + ] + """ + Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The customer associated with this order. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + discounts: NotRequired["Literal['']|List[Order.ModifyParamsDiscount]"] + """ + The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + ip_address: NotRequired[str] + """ + The IP address of the purchaser for this order. + """ + line_items: NotRequired[List["Order.ModifyParamsLineItem"]] + """ + A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment: NotRequired["Order.ModifyParamsPayment"] + """ + Payment information associated with the order, including payment settings. + """ + shipping_cost: NotRequired[ + "Literal['']|Order.ModifyParamsShippingCost" + ] + """ + Settings for the customer cost of shipping for this order. + """ + shipping_details: NotRequired[ + "Literal['']|Order.ModifyParamsShippingDetails" + ] + """ + Shipping details for the order. + """ + tax_details: NotRequired["Order.ModifyParamsTaxDetails"] + """ + Additional tax details about the purchaser to be used for this order. + """ + + class ModifyParamsAutomaticTax(TypedDict): + enabled: bool + """ + Enable automatic tax calculation which will automatically compute tax rates on this order. + """ + + class ModifyParamsBillingDetails(TypedDict): + address: NotRequired["Order.ModifyParamsBillingDetailsAddress"] + """ + The billing address provided by the customer. + """ + email: NotRequired[str] + """ + The billing email provided by the customer. + """ + name: NotRequired[str] + """ + The billing name provided by the customer. + """ + phone: NotRequired[str] + """ + The billing phone number provided by the customer. + """ + + class ModifyParamsBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsLineItem(TypedDict): + description: NotRequired[str] + """ + The description for the line item. Will default to the name of the associated product. + """ + discounts: NotRequired[ + "Literal['']|List[Order.ModifyParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + id: NotRequired[str] + """ + The ID of an existing line item on the order. + """ + price: NotRequired[str] + """ + The ID of a [Price](https://docs.stripe.com/api/prices) to add to the Order. + + The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + """ + price_data: NotRequired["Order.ModifyParamsLineItemPriceData"] + """ + Data used to generate a new Price object inline. + + The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create a Product upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + + Each time you pass `price_data` we create a Price for the Product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + """ + product: NotRequired[str] + """ + The ID of a [Product](https://docs.stripe.com/api/products) to add to the Order. + + The Product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + """ + product_data: NotRequired["Order.ModifyParamsLineItemProductData"] + """ + Defines a [Product](https://docs.stripe.com/api/products) inline and adds it to the Order. + + `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + + `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates applied to this line item. + """ + + class ModifyParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class ModifyParamsLineItemPriceData(TypedDict): + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + ID of the [Product](https://docs.stripe.com/api/products) this [Price](https://docs.stripe.com/api/prices) belongs to. + + Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specified. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ModifyParamsLineItemProductData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + id: str + """ + A unique identifier for this product. + + `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + """ + images: NotRequired["Literal['']|List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + package_dimensions: NotRequired[ + "Literal['']|Order.ModifyParamsLineItemProductDataPackageDimensions" + ] + """ + The dimensions of this product for shipping purposes. + """ + shippable: NotRequired[bool] + """ + Whether this product is shipped (i.e., physical goods). + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + url: NotRequired["Literal['']|str"] + """ + A URL of a publicly-accessible webpage for this product. + """ + + class ModifyParamsLineItemProductDataPackageDimensions(TypedDict): + height: float + """ + Height, in inches. Maximum precision is 2 decimal places. + """ + length: float + """ + Length, in inches. Maximum precision is 2 decimal places. + """ + weight: float + """ + Weight, in ounces. Maximum precision is 2 decimal places. + """ + width: float + """ + Width, in inches. Maximum precision is 2 decimal places. + """ + + class ModifyParamsPayment(TypedDict): + settings: "Order.ModifyParamsPaymentSettings" + """ + Settings describing how the order should configure generated PaymentIntents. + """ + + class ModifyParamsPaymentSettings(TypedDict): + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + """ + payment_method_options: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptions" + ] + """ + PaymentMethod-specific configuration to provide to the order's PaymentIntent. + """ + payment_method_types: NotRequired[ + List[ + Literal[ + "acss_debit", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "card", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "link", + "oxxo", + "p24", + "paypal", + "sepa_debit", + "sofort", + "wechat_pay", + ] + ] + ] + """ + The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + return_url: NotRequired["Literal['']|str"] + """ + The URL to redirect the customer to after they authenticate their payment. + """ + statement_descriptor: NotRequired[str] + """ + For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + """ + transfer_data: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsTransferData" + ] + """ + Provides configuration for completing a transfer for the order after it is paid. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit" + ] + """ + If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + """ + afterpay_clearpay: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + """ + alipay: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsAlipay" + ] + """ + If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + """ + bancontact: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact" + ] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + """ + card: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsCard" + ] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + """ + customer_balance: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" + ] + """ + If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + """ + ideal: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsIdeal" + ] + """ + If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + """ + klarna: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna" + ] + """ + If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + """ + link: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsLink" + ] + """ + If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + """ + oxxo: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsOxxo" + ] + """ + If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + """ + p24: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsP24" + ] + """ + If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + """ + paypal: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsPaypal" + ] + """ + If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + """ + sepa_debit: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + """ + sofort: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsSofort" + ] + """ + If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + """ + wechat_pay: NotRequired[ + "Literal['']|Order.ModifyParamsPaymentSettingsPaymentMethodOptionsWechatPay" + ] + """ + If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + TypedDict, + ): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay( + TypedDict, + ): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference this payment corresponds to. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + TypedDict, + ): + bank_transfer: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem( + TypedDict, + ): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax( + TypedDict, + ): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions( + TypedDict, + ): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentSettingsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + destination: str + """ + ID of the Connected account receiving the transfer. + """ + + class ModifyParamsShippingCost(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the shipping rate to use for this order. + """ + shipping_rate_data: NotRequired[ + "Order.ModifyParamsShippingCostShippingRateData" + ] + """ + Parameters to create a new ad-hoc shipping rate for this order. + """ + + class ModifyParamsShippingCostShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "Order.ModifyParamsShippingCostShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "Order.ModifyParamsShippingCostShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): + maximum: NotRequired[ + "Order.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "Order.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class ModifyParamsShippingCostShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + currency_options: NotRequired[ + Dict[ + str, + "Order.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + + class ModifyParamsShippingDetails(TypedDict): + address: "Order.ModifyParamsShippingDetailsAddress" + """ + The shipping address for the order. + """ + name: str + """ + The name of the recipient of the order. + """ + phone: NotRequired["Literal['']|str"] + """ + The phone number (including extension) for the recipient of the order. + """ + + class ModifyParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class ModifyParamsTaxDetails(TypedDict): + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[List["Order.ModifyParamsTaxDetailsTaxId"]] + """ + The purchaser's tax IDs to be used for this order. + """ + + class ModifyParamsTaxDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + """ + value: str + """ + Value of the tax ID. + """ + + class ReopenParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SubmitParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expected_total: int + """ + `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. + """ + + amount_subtotal: int + """ + Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + """ + amount_total: int + """ + Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + """ + application: Optional[ExpandableField["Application"]] + """ + ID of the Connect application that created the Order, if any. + """ + automatic_tax: Optional[AutomaticTax] + billing_details: Optional[BillingDetails] + """ + Customer billing details associated with the order. + """ + client_secret: Optional[str] + """ + The client secret of this Order. Used for client-side retrieval using a publishable key. + + The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + + Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: Optional[ExpandableField["Customer"]] + """ + The customer which this orders belongs to. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + discounts: Optional[List[ExpandableField["DiscountResource"]]] + """ + The discounts applied to the order. Use `expand[]=discounts` to expand each discount. + """ + id: str + """ + Unique identifier for the object. + """ + ip_address: Optional[str] + """ + A recent IP address of the purchaser used for tax reporting and tax location inference. + """ + line_items: Optional[ListObject["LineItemResource"]] + """ + A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["order"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment: Payment + shipping_cost: Optional[ShippingCost] + """ + The details of the customer cost of shipping, including the customer chosen ShippingRate. + """ + shipping_details: Optional[ShippingDetails] + """ + Customer shipping information associated with the order. + """ + status: Literal["canceled", "complete", "open", "processing", "submitted"] + """ + The overall status of the order. + """ + tax_details: Optional[TaxDetails] + total_details: TotalDetails + + @classmethod + def _cls_cancel( + cls, id: str, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + "Order", + cls._static_request( + "post", + "/v1/orders/{id}/cancel".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def cancel(id: str, **params: Unpack["Order.CancelParams"]) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + ... + + @overload + def cancel(self, **params: Unpack["Order.CancelParams"]) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + ... + + @class_method_variant("_cls_cancel") + def cancel( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + "Order", + self._request( + "post", + "/v1/orders/{id}/cancel".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_cancel_async( + cls, id: str, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + "/v1/orders/{id}/cancel".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + id: str, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.CancelParams"] + ) -> "Order": + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + "Order", + await self._request_async( + "post", + "/v1/orders/{id}/cancel".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create(cls, **params: Unpack["Order.CreateParams"]) -> "Order": + """ + Creates a new open order object. + """ + return cast( + "Order", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["Order.CreateParams"] + ) -> "Order": + """ + Creates a new open order object. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list(cls, **params: Unpack["Order.ListParams"]) -> ListObject["Order"]: + """ + Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + """ + 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["Order.ListParams"] + ) -> ListObject["Order"]: + """ + Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + """ + 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 _cls_list_line_items( + cls, id: str, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItemResource"], + cls._static_request( + "get", + "/v1/orders/{id}/line_items".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def list_line_items( + id: str, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @overload + def list_line_items( + self, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @class_method_variant("_cls_list_line_items") + def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItemResource"], + self._request( + "get", + "/v1/orders/{id}/line_items".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_list_line_items_async( + cls, id: str, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItemResource"], + await cls._static_request_async( + "get", + "/v1/orders/{id}/line_items".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def list_line_items_async( + id: str, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @overload + async def list_line_items_async( + self, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + ... + + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.ListLineItemsParams"] + ) -> ListObject["LineItemResource"]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItemResource"], + await self._request_async( + "get", + "/v1/orders/{id}/line_items".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def modify( + cls, id: str, **params: Unpack["Order.ModifyParams"] + ) -> "Order": + """ + Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Order", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["Order.ModifyParams"] + ) -> "Order": + """ + Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Order", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def _cls_reopen( + cls, id: str, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + return cast( + "Order", + cls._static_request( + "post", + "/v1/orders/{id}/reopen".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def reopen(id: str, **params: Unpack["Order.ReopenParams"]) -> "Order": + """ + Reopens a submitted order. + """ + ... + + @overload + def reopen(self, **params: Unpack["Order.ReopenParams"]) -> "Order": + """ + Reopens a submitted order. + """ + ... + + @class_method_variant("_cls_reopen") + def reopen( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + return cast( + "Order", + self._request( + "post", + "/v1/orders/{id}/reopen".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_reopen_async( + cls, id: str, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + "/v1/orders/{id}/reopen".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def reopen_async( + id: str, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + ... + + @overload + async def reopen_async( + self, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + ... + + @class_method_variant("_cls_reopen_async") + async def reopen_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.ReopenParams"] + ) -> "Order": + """ + Reopens a submitted order. + """ + return cast( + "Order", + await self._request_async( + "post", + "/v1/orders/{id}/reopen".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Order.RetrieveParams"] + ) -> "Order": + """ + Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Order.RetrieveParams"] + ) -> "Order": + """ + Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_submit( + cls, id: str, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + "Order", + cls._static_request( + "post", + "/v1/orders/{id}/submit".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def submit(id: str, **params: Unpack["Order.SubmitParams"]) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + ... + + @overload + def submit(self, **params: Unpack["Order.SubmitParams"]) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + ... + + @class_method_variant("_cls_submit") + def submit( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + "Order", + self._request( + "post", + "/v1/orders/{id}/submit".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_submit_async( + cls, id: str, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + "Order", + await cls._static_request_async( + "post", + "/v1/orders/{id}/submit".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def submit_async( + id: str, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + ... + + @overload + async def submit_async( + self, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + ... + + @class_method_variant("_cls_submit_async") + async def submit_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Order.SubmitParams"] + ) -> "Order": + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + "Order", + await self._request_async( + "post", + "/v1/orders/{id}/submit".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + _inner_class_types = { + "automatic_tax": AutomaticTax, + "billing_details": BillingDetails, + "payment": Payment, + "shipping_cost": ShippingCost, + "shipping_details": ShippingDetails, + "tax_details": TaxDetails, + "total_details": TotalDetails, + } diff --git a/stripe/_order_line_item_service.py b/stripe/_order_line_item_service.py new file mode 100644 index 000000000..6501fe2aa --- /dev/null +++ b/stripe/_order_line_item_service.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._line_item import LineItem +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class OrderLineItemService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + id: str, + params: "OrderLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[LineItem], + self._request( + "get", + "/v1/orders/{id}/line_items".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + id: str, + params: "OrderLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[LineItem]: + """ + When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject[LineItem], + await self._request_async( + "get", + "/v1/orders/{id}/line_items".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_order_service.py b/stripe/_order_service.py new file mode 100644 index 000000000..702b64934 --- /dev/null +++ b/stripe/_order_service.py @@ -0,0 +1,2952 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._order import Order +from stripe._order_line_item_service import OrderLineItemService +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OrderService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.line_items = OrderLineItemService(self._requestor) + + class CancelParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(TypedDict): + automatic_tax: NotRequired["OrderService.CreateParamsAutomaticTax"] + """ + Settings for automatic tax calculation for this order. + """ + billing_details: NotRequired[ + "Literal['']|OrderService.CreateParamsBillingDetails" + ] + """ + Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The customer associated with this order. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + discounts: NotRequired[ + "Literal['']|List[OrderService.CreateParamsDiscount]" + ] + """ + The coupons, promotion codes, and/or discounts to apply to the order. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + ip_address: NotRequired[str] + """ + The IP address of the purchaser for this order. + """ + line_items: List["OrderService.CreateParamsLineItem"] + """ + A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment: NotRequired["OrderService.CreateParamsPayment"] + """ + Payment information associated with the order, including payment settings. + """ + shipping_cost: NotRequired[ + "Literal['']|OrderService.CreateParamsShippingCost" + ] + """ + Settings for the customer cost of shipping for this order. + """ + shipping_details: NotRequired[ + "Literal['']|OrderService.CreateParamsShippingDetails" + ] + """ + Shipping details for the order. + """ + tax_details: NotRequired["OrderService.CreateParamsTaxDetails"] + """ + Additional tax details about the purchaser to be used for this order. + """ + + class CreateParamsAutomaticTax(TypedDict): + enabled: bool + """ + Enable automatic tax calculation which will automatically compute tax rates on this order. + """ + + class CreateParamsBillingDetails(TypedDict): + address: NotRequired["OrderService.CreateParamsBillingDetailsAddress"] + """ + The billing address provided by the customer. + """ + email: NotRequired[str] + """ + The billing email provided by the customer. + """ + name: NotRequired[str] + """ + The billing name provided by the customer. + """ + phone: NotRequired[str] + """ + The billing phone number provided by the customer. + """ + + class CreateParamsBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class CreateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreateParamsLineItem(TypedDict): + description: NotRequired[str] + """ + The description for the line item. Will default to the name of the associated product. + """ + discounts: NotRequired[ + "Literal['']|List[OrderService.CreateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + price: NotRequired[str] + """ + The ID of a [Price](https://docs.stripe.com/api/prices) to add to the Order. + + The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + """ + price_data: NotRequired["OrderService.CreateParamsLineItemPriceData"] + """ + Data used to generate a new Price object inline. + + The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create a Product upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + + Each time you pass `price_data` we create a Price for the Product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + """ + product: NotRequired[str] + """ + The ID of a [Product](https://docs.stripe.com/api/products) to add to the Order. + + The Product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + """ + product_data: NotRequired[ + "OrderService.CreateParamsLineItemProductData" + ] + """ + Defines a [Product](https://docs.stripe.com/api/products) inline and adds it to the Order. + + `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + + `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates applied to this line item. + """ + + class CreateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class CreateParamsLineItemPriceData(TypedDict): + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + ID of the [Product](https://docs.stripe.com/api/products) this [Price](https://docs.stripe.com/api/prices) belongs to. + + Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specified. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreateParamsLineItemProductData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + id: str + """ + A unique identifier for this product. + + `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + """ + images: NotRequired["Literal['']|List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + package_dimensions: NotRequired[ + "Literal['']|OrderService.CreateParamsLineItemProductDataPackageDimensions" + ] + """ + The dimensions of this product for shipping purposes. + """ + shippable: NotRequired[bool] + """ + Whether this product is shipped (i.e., physical goods). + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + url: NotRequired["Literal['']|str"] + """ + A URL of a publicly-accessible webpage for this product. + """ + + class CreateParamsLineItemProductDataPackageDimensions(TypedDict): + height: float + """ + Height, in inches. Maximum precision is 2 decimal places. + """ + length: float + """ + Length, in inches. Maximum precision is 2 decimal places. + """ + weight: float + """ + Weight, in ounces. Maximum precision is 2 decimal places. + """ + width: float + """ + Width, in inches. Maximum precision is 2 decimal places. + """ + + class CreateParamsPayment(TypedDict): + settings: "OrderService.CreateParamsPaymentSettings" + """ + Settings describing how the order should configure generated PaymentIntents. + """ + + class CreateParamsPaymentSettings(TypedDict): + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + """ + payment_method_options: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptions" + ] + """ + PaymentMethod-specific configuration to provide to the order's PaymentIntent. + """ + payment_method_types: NotRequired[ + List[ + Literal[ + "acss_debit", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "card", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "link", + "oxxo", + "p24", + "paypal", + "sepa_debit", + "sofort", + "wechat_pay", + ] + ] + ] + """ + The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + return_url: NotRequired[str] + """ + The URL to redirect the customer to after they authenticate their payment. + """ + statement_descriptor: NotRequired[str] + """ + For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + """ + transfer_data: NotRequired[ + "OrderService.CreateParamsPaymentSettingsTransferData" + ] + """ + Provides configuration for completing a transfer for the order after it is paid. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" + ] + """ + If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + """ + afterpay_clearpay: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + """ + alipay: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsAlipay" + ] + """ + If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + """ + bancontact: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" + ] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + """ + card: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsCard" + ] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + """ + customer_balance: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" + ] + """ + If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + """ + ideal: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsIdeal" + ] + """ + If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + """ + klarna: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsKlarna" + ] + """ + If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + """ + link: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsLink" + ] + """ + If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + """ + oxxo: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsOxxo" + ] + """ + If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + """ + p24: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsP24" + ] + """ + If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + """ + paypal: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsPaypal" + ] + """ + If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + """ + sepa_debit: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + """ + sofort: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsSofort" + ] + """ + If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + """ + wechat_pay: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsWechatPay" + ] + """ + If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + TypedDict, + ): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay( + TypedDict, + ): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference this payment corresponds to. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + TypedDict, + ): + bank_transfer: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem( + TypedDict, + ): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax( + TypedDict, + ): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions( + TypedDict, + ): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentSettingsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + destination: str + """ + ID of the Connected account receiving the transfer. + """ + + class CreateParamsShippingCost(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the shipping rate to use for this order. + """ + shipping_rate_data: NotRequired[ + "OrderService.CreateParamsShippingCostShippingRateData" + ] + """ + Parameters to create a new ad-hoc shipping rate for this order. + """ + + class CreateParamsShippingCostShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "OrderService.CreateParamsShippingCostShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "OrderService.CreateParamsShippingCostShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): + maximum: NotRequired[ + "OrderService.CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "OrderService.CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + currency_options: NotRequired[ + Dict[ + str, + "OrderService.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + + class CreateParamsShippingDetails(TypedDict): + address: "OrderService.CreateParamsShippingDetailsAddress" + """ + The shipping address for the order. + """ + name: str + """ + The name of the recipient of the order. + """ + phone: NotRequired["Literal['']|str"] + """ + The phone number (including extension) for the recipient of the order. + """ + + class CreateParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class CreateParamsTaxDetails(TypedDict): + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[List["OrderService.CreateParamsTaxDetailsTaxId"]] + """ + The purchaser's tax IDs to be used for this order. + """ + + class CreateParamsTaxDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + """ + value: str + """ + Value of the tax ID. + """ + + class ListParams(TypedDict): + customer: NotRequired[str] + """ + Only return orders for the given customer. + """ + 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. + """ + + class ReopenParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SubmitParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expected_total: int + """ + `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. + """ + + class UpdateParams(TypedDict): + automatic_tax: NotRequired["OrderService.UpdateParamsAutomaticTax"] + """ + Settings for automatic tax calculation for this order. + """ + billing_details: NotRequired[ + "Literal['']|OrderService.UpdateParamsBillingDetails" + ] + """ + Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + The customer associated with this order. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + discounts: NotRequired[ + "Literal['']|List[OrderService.UpdateParamsDiscount]" + ] + """ + The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + ip_address: NotRequired[str] + """ + The IP address of the purchaser for this order. + """ + line_items: NotRequired[List["OrderService.UpdateParamsLineItem"]] + """ + A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment: NotRequired["OrderService.UpdateParamsPayment"] + """ + Payment information associated with the order, including payment settings. + """ + shipping_cost: NotRequired[ + "Literal['']|OrderService.UpdateParamsShippingCost" + ] + """ + Settings for the customer cost of shipping for this order. + """ + shipping_details: NotRequired[ + "Literal['']|OrderService.UpdateParamsShippingDetails" + ] + """ + Shipping details for the order. + """ + tax_details: NotRequired["OrderService.UpdateParamsTaxDetails"] + """ + Additional tax details about the purchaser to be used for this order. + """ + + class UpdateParamsAutomaticTax(TypedDict): + enabled: bool + """ + Enable automatic tax calculation which will automatically compute tax rates on this order. + """ + + class UpdateParamsBillingDetails(TypedDict): + address: NotRequired["OrderService.UpdateParamsBillingDetailsAddress"] + """ + The billing address provided by the customer. + """ + email: NotRequired[str] + """ + The billing email provided by the customer. + """ + name: NotRequired[str] + """ + The billing name provided by the customer. + """ + phone: NotRequired[str] + """ + The billing phone number provided by the customer. + """ + + class UpdateParamsBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class UpdateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateParamsLineItem(TypedDict): + description: NotRequired[str] + """ + The description for the line item. Will default to the name of the associated product. + """ + discounts: NotRequired[ + "Literal['']|List[OrderService.UpdateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + id: NotRequired[str] + """ + The ID of an existing line item on the order. + """ + price: NotRequired[str] + """ + The ID of a [Price](https://docs.stripe.com/api/prices) to add to the Order. + + The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + """ + price_data: NotRequired["OrderService.UpdateParamsLineItemPriceData"] + """ + Data used to generate a new Price object inline. + + The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create a Product upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + + Each time you pass `price_data` we create a Price for the Product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + """ + product: NotRequired[str] + """ + The ID of a [Product](https://docs.stripe.com/api/products) to add to the Order. + + The Product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + """ + product_data: NotRequired[ + "OrderService.UpdateParamsLineItemProductData" + ] + """ + Defines a [Product](https://docs.stripe.com/api/products) inline and adds it to the Order. + + `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + + `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates applied to this line item. + """ + + class UpdateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + + class UpdateParamsLineItemPriceData(TypedDict): + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + ID of the [Product](https://docs.stripe.com/api/products) this [Price](https://docs.stripe.com/api/prices) belongs to. + + Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specified. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateParamsLineItemProductData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + id: str + """ + A unique identifier for this product. + + `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + """ + images: NotRequired["Literal['']|List[str]"] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + package_dimensions: NotRequired[ + "Literal['']|OrderService.UpdateParamsLineItemProductDataPackageDimensions" + ] + """ + The dimensions of this product for shipping purposes. + """ + shippable: NotRequired[bool] + """ + Whether this product is shipped (i.e., physical goods). + """ + tax_code: NotRequired["Literal['']|str"] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + url: NotRequired["Literal['']|str"] + """ + A URL of a publicly-accessible webpage for this product. + """ + + class UpdateParamsLineItemProductDataPackageDimensions(TypedDict): + height: float + """ + Height, in inches. Maximum precision is 2 decimal places. + """ + length: float + """ + Length, in inches. Maximum precision is 2 decimal places. + """ + weight: float + """ + Weight, in ounces. Maximum precision is 2 decimal places. + """ + width: float + """ + Width, in inches. Maximum precision is 2 decimal places. + """ + + class UpdateParamsPayment(TypedDict): + settings: "OrderService.UpdateParamsPaymentSettings" + """ + Settings describing how the order should configure generated PaymentIntents. + """ + + class UpdateParamsPaymentSettings(TypedDict): + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + """ + payment_method_options: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptions" + ] + """ + PaymentMethod-specific configuration to provide to the order's PaymentIntent. + """ + payment_method_types: NotRequired[ + List[ + Literal[ + "acss_debit", + "afterpay_clearpay", + "alipay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "card", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "link", + "oxxo", + "p24", + "paypal", + "sepa_debit", + "sofort", + "wechat_pay", + ] + ] + ] + """ + The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + return_url: NotRequired["Literal['']|str"] + """ + The URL to redirect the customer to after they authenticate their payment. + """ + statement_descriptor: NotRequired[str] + """ + For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + """ + transfer_data: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsTransferData" + ] + """ + Provides configuration for completing a transfer for the order after it is paid. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" + ] + """ + If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + """ + afterpay_clearpay: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + """ + alipay: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsAlipay" + ] + """ + If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + """ + bancontact: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact" + ] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + """ + card: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsCard" + ] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + """ + customer_balance: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" + ] + """ + If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + """ + ideal: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsIdeal" + ] + """ + If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + """ + klarna: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsKlarna" + ] + """ + If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + """ + link: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsLink" + ] + """ + If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + """ + oxxo: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsOxxo" + ] + """ + If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + """ + p24: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsP24" + ] + """ + If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + """ + paypal: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsPaypal" + ] + """ + If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + """ + sepa_debit: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" + ] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + """ + sofort: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsSofort" + ] + """ + If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + """ + wechat_pay: NotRequired[ + "Literal['']|OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsWechatPay" + ] + """ + If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( + TypedDict, + ): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsAfterpayClearpay( + TypedDict, + ): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference this payment corresponds to. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with the payment method. + + Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + + When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + + If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( + TypedDict, + ): + bank_transfer: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItem( + TypedDict, + ): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsPaypalLineItemTax( + TypedDict, + ): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions( + TypedDict, + ): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentSettingsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + destination: str + """ + ID of the Connected account receiving the transfer. + """ + + class UpdateParamsShippingCost(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the shipping rate to use for this order. + """ + shipping_rate_data: NotRequired[ + "OrderService.UpdateParamsShippingCostShippingRateData" + ] + """ + Parameters to create a new ad-hoc shipping rate for this order. + """ + + class UpdateParamsShippingCostShippingRateData(TypedDict): + delivery_estimate: NotRequired[ + "OrderService.UpdateParamsShippingCostShippingRateDataDeliveryEstimate" + ] + """ + The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + display_name: str + """ + The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + """ + fixed_amount: NotRequired[ + "OrderService.UpdateParamsShippingCostShippingRateDataFixedAmount" + ] + """ + Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + """ + type: NotRequired[Literal["fixed_amount"]] + """ + The type of calculation to use on the shipping rate. + """ + + class UpdateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): + maximum: NotRequired[ + "OrderService.UpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" + ] + """ + The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + """ + minimum: NotRequired[ + "OrderService.UpdateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" + ] + """ + The lower bound of the estimated range. If empty, represents no lower bound. + """ + + class UpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class UpdateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( + TypedDict, + ): + unit: Literal["business_day", "day", "hour", "month", "week"] + """ + A unit of time. + """ + value: int + """ + Must be greater than 0. + """ + + class UpdateParamsShippingCostShippingRateDataFixedAmount(TypedDict): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + currency_options: NotRequired[ + Dict[ + str, + "OrderService.UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", + ] + ] + """ + Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + """ + + class UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( + TypedDict, + ): + amount: int + """ + A non-negative integer in cents representing how much to charge. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + """ + + class UpdateParamsShippingDetails(TypedDict): + address: "OrderService.UpdateParamsShippingDetailsAddress" + """ + The shipping address for the order. + """ + name: str + """ + The name of the recipient of the order. + """ + phone: NotRequired["Literal['']|str"] + """ + The phone number (including extension) for the recipient of the order. + """ + + class UpdateParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + """ + + class UpdateParamsTaxDetails(TypedDict): + tax_exempt: NotRequired[ + "Literal['']|Literal['exempt', 'none', 'reverse']" + ] + """ + The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + """ + tax_ids: NotRequired[List["OrderService.UpdateParamsTaxDetailsTaxId"]] + """ + The purchaser's tax IDs to be used for this order. + """ + + class UpdateParamsTaxDetailsTaxId(TypedDict): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + """ + value: str + """ + Value of the tax ID. + """ + + def list( + self, + params: "OrderService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Order]: + """ + Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + """ + return cast( + ListObject[Order], + self._request( + "get", + "/v1/orders", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "OrderService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Order]: + """ + Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + """ + return cast( + ListObject[Order], + await self._request_async( + "get", + "/v1/orders", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, params: "OrderService.CreateParams", options: RequestOptions = {} + ) -> Order: + """ + Creates a new open order object. + """ + return cast( + Order, + self._request( + "post", + "/v1/orders", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, params: "OrderService.CreateParams", options: RequestOptions = {} + ) -> Order: + """ + Creates a new open order object. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/orders", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OrderService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + """ + return cast( + Order, + self._request( + "get", + "/v1/orders/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OrderService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + """ + return cast( + Order, + await self._request_async( + "get", + "/v1/orders/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "OrderService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Order, + self._request( + "post", + "/v1/orders/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "OrderService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/orders/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + id: str, + params: "OrderService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + Order, + self._request( + "post", + "/v1/orders/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: "OrderService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Cancels the order as well as the payment intent if one is attached. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/orders/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def reopen( + self, + id: str, + params: "OrderService.ReopenParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Reopens a submitted order. + """ + return cast( + Order, + self._request( + "post", + "/v1/orders/{id}/reopen".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def reopen_async( + self, + id: str, + params: "OrderService.ReopenParams" = {}, + options: RequestOptions = {}, + ) -> Order: + """ + Reopens a submitted order. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/orders/{id}/reopen".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def submit( + self, + id: str, + params: "OrderService.SubmitParams", + options: RequestOptions = {}, + ) -> Order: + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + Order, + self._request( + "post", + "/v1/orders/{id}/submit".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_async( + self, + id: str, + params: "OrderService.SubmitParams", + options: RequestOptions = {}, + ) -> Order: + """ + Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. + """ + return cast( + Order, + await self._request_async( + "post", + "/v1/orders/{id}/submit".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py new file mode 100644 index 000000000..9cc81eac7 --- /dev/null +++ b/stripe/_payment_attempt_record.py @@ -0,0 +1,1989 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._mandate import Mandate + from stripe._payment_method import PaymentMethod + + +class PaymentAttemptRecord(ListableAPIResource["PaymentAttemptRecord"]): + """ + A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe. + Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment + method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment Record + can have guaranteed funds. + """ + + OBJECT_NAME: ClassVar[Literal["payment_attempt_record"]] = ( + "payment_attempt_record" + ) + + class AmountCanceled(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountFailed(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountGuaranteed(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountRequested(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class CustomerDetails(StripeObject): + customer: Optional[str] + """ + ID of the Stripe Customer associated with this payment. + """ + email: Optional[str] + """ + The customer's email address. + """ + name: Optional[str] + """ + The customer's name. + """ + phone: Optional[str] + """ + The customer's phone number. + """ + + class PaymentMethodDetails(StripeObject): + class AchCreditTransfer(StripeObject): + account_number: Optional[str] + """ + Account number to transfer funds to. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the routing number. + """ + routing_number: Optional[str] + """ + Routing transit number for the bank account to transfer funds to. + """ + swift_code: Optional[str] + """ + SWIFT code of the bank associated with the routing number. + """ + + class AchDebit(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Type of entity that holds the account. This can be either `individual` or `company`. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + routing_number: Optional[str] + """ + Routing transit number of the bank account. + """ + + class AcssDebit(StripeObject): + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + institution_number: Optional[str] + """ + Institution number of the bank account + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + transit_number: Optional[str] + """ + Transit number of the bank account. + """ + + class Affirm(StripeObject): + location: Optional[str] + """ + ID of the [location](https://stripe.com/docs/api/terminal/locations) that this transaction's reader is assigned to. + """ + reader: Optional[str] + """ + ID of the [reader](https://stripe.com/docs/api/terminal/readers) this transaction was made on. + """ + transaction_id: Optional[str] + """ + The Affirm transaction ID associated with this payment. + """ + + class AfterpayClearpay(StripeObject): + order_id: Optional[str] + """ + The Afterpay order ID associated with this payment intent. + """ + reference: Optional[str] + """ + Order identifier shown to the merchant in Afterpay's online portal. + """ + + class Alipay(StripeObject): + buyer_id: Optional[str] + """ + Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + """ + transaction_id: Optional[str] + """ + Transaction ID of this particular Alipay transaction. + """ + + class Alma(StripeObject): + pass + + class AmazonPay(StripeObject): + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} + + class AuBecsDebit(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + + class BacsDebit(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + sort_code: Optional[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class Bancontact(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + preferred_language: Optional[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + Can be one of `en`, `de`, `fr`, or `nl` + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Bancontact directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class Billie(StripeObject): + pass + + class BillingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Address + """ + A representation of a physical address. + """ + email: Optional[str] + """ + The billing email associated with the method of payment. + """ + name: Optional[str] + """ + The billing name associated with the method of payment. + """ + phone: Optional[str] + """ + The billing phone number associated with the method of payment. + """ + _inner_class_types = {"address": Address} + + class Blik(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by BLIK to every buyer. + """ + + class Boleto(StripeObject): + tax_id: str + """ + The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) + """ + + class Card(StripeObject): + class Checks(StripeObject): + address_line1_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + address_postal_code_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + cvc_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + + class NetworkToken(StripeObject): + used: bool + + class ThreeDSecure(StripeObject): + authentication_flow: Optional[ + Literal["challenge", "frictionless"] + ] + result: Optional[ + Literal[ + "attempt_acknowledged", + "authenticated", + "exempted", + "failed", + "not_supported", + "processing_error", + ] + ] + result_reason: Optional[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ] + ] + version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] + + brand: Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + """ + checks: Optional[Checks] + """ + Check results by Card networks on Card address and CVC at time of payment. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Literal["credit", "debit", "prepaid", "unknown"] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: str + """ + The last four digits of the card. + """ + moto: Optional[bool] + """ + True if this payment was marked as MOTO and out of scope for SCA. + """ + network: Optional[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + ] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_token: Optional[NetworkToken] + """ + If this card has network token credentials, this contains the details of the network token credentials. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + three_d_secure: Optional[ThreeDSecure] + """ + Populated if this transaction used 3D Secure authentication. + """ + _inner_class_types = { + "checks": Checks, + "network_token": NetworkToken, + "three_d_secure": ThreeDSecure, + } + + class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ + + class Receipt(StripeObject): + account_type: Optional[ + Literal["checking", "credit", "prepaid", "unknown"] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + class Wallet(StripeObject): + type: Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + + amount_authorized: Optional[int] + """ + The authorized amount + """ + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + incremental_authorization_supported: bool + """ + Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ + overcapture_supported: bool + """ + Defines whether the authorized amount can be over-captured or not + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + wallet: Optional[Wallet] + _inner_class_types = { + "offline": Offline, + "receipt": Receipt, + "wallet": Wallet, + } + + class Cashapp(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by Cash App to every buyer. + """ + cashtag: Optional[str] + """ + A public identifier for buyers using Cash App. + """ + + class Custom(StripeObject): + display_name: str + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: Optional[str] + """ + The custom payment method type associated with this payment. + """ + + class CustomerBalance(StripeObject): + pass + + class Eps(StripeObject): + bank: Optional[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] + """ + The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by EPS directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + EPS rarely provides this information so the attribute is usually empty. + """ + + class Fpx(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type, if provided. Can be one of `individual` or `company`. + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + """ + transaction_id: Optional[str] + """ + Unique transaction id generated by FPX for every request from the merchant + """ + + class Giropay(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Giropay directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Giropay rarely provides this information so the attribute is usually empty. + """ + + class Gopay(StripeObject): + pass + + class Grabpay(StripeObject): + transaction_id: Optional[str] + """ + Unique transaction id generated by GrabPay + """ + + class IdBankTransfer(StripeObject): + account_number: str + """ + Account number of the bank account to transfer funds to. + """ + bank: Literal["bca", "bni", "bri", "cimb", "permata"] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + + class Ideal(StripeObject): + bank: Optional[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] + """ + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + """ + bic: Optional[ + Literal[ + "ABNANL2A", + "ASNBNL21", + "BITSNL2A", + "BUNQNL2A", + "FVLBNL22", + "HANDNL2A", + "INGBNL2A", + "KNABNL2H", + "MOYONL21", + "NNBANL2G", + "NTSBDEB1", + "RABONL2U", + "RBRBNL21", + "REVOIE23", + "REVOLT21", + "SNSBNL2A", + "TRIONL2U", + ] + ] + """ + The Bank Identifier Code of the customer's bank. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by iDEAL directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class InteracPresent(StripeObject): + class Receipt(StripeObject): + account_type: Optional[ + Literal["checking", "savings", "unknown"] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + brand: Optional[str] + """ + Card brand. Can be `interac`, `mastercard` or `visa`. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + _inner_class_types = {"receipt": Receipt} + + class KakaoPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Klarna(StripeObject): + class PayerDetails(StripeObject): + class Address(StripeObject): + country: Optional[str] + """ + The payer address country + """ + + address: Optional[Address] + """ + The payer's address + """ + _inner_class_types = {"address": Address} + + payer_details: Optional[PayerDetails] + """ + The payer details for this transaction. + """ + payment_method_category: Optional[str] + """ + The Klarna payment method used for this transaction. + Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` + """ + preferred_locale: Optional[str] + """ + Preferred language of the Klarna authorization page that the customer is redirected to. + Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` + """ + _inner_class_types = {"payer_details": PayerDetails} + + class Konbini(StripeObject): + class Store(StripeObject): + chain: Optional[ + Literal["familymart", "lawson", "ministop", "seicomart"] + ] + """ + The name of the convenience store chain where the payment was completed. + """ + + store: Optional[Store] + """ + If the payment succeeded, this contains the details of the convenience store where the payment was completed. + """ + _inner_class_types = {"store": Store} + + class KrCard(StripeObject): + brand: Optional[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ] + ] + """ + The local credit or debit card brand. + """ + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + last4: Optional[str] + """ + The last four digits of the card. This may not be present for American Express cards. + """ + + class Link(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the funding source country beneath the Link payment. + You could use this attribute to get a sense of international fees. + """ + + class MbWay(StripeObject): + pass + + class Mobilepay(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Brand of the card used in the transaction + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card + """ + exp_month: Optional[int] + """ + Two digit number representing the card's expiration month + """ + exp_year: Optional[int] + """ + Two digit number representing the card's expiration year + """ + last4: Optional[str] + """ + The last 4 digits of the card + """ + + card: Optional[Card] + """ + Internal card details + """ + _inner_class_types = {"card": Card} + + class Multibanco(StripeObject): + entity: Optional[str] + """ + Entity number associated with this Multibanco payment. + """ + reference: Optional[str] + """ + Reference number associated with this Multibanco payment. + """ + + class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class NzBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + bank_name: str + """ + The name of the bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + last4: str + """ + Last four digits of the bank account number. + """ + suffix: Optional[str] + """ + The suffix of the bank account number. + """ + + class Oxxo(StripeObject): + number: Optional[str] + """ + OXXO reference number + """ + + class P24(StripeObject): + bank: Optional[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] + """ + The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + """ + reference: Optional[str] + """ + Unique reference for this Przelewy24 payment. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Przelewy24 directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Przelewy24 rarely provides this information so the attribute is usually empty. + """ + + class PayByBank(StripeObject): + pass + + class Payco(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Paynow(StripeObject): + reference: Optional[str] + """ + Reference number associated with this PayNow payment + """ + + class Paypal(StripeObject): + class SellerProtection(StripeObject): + dispute_categories: Optional[ + List[Literal["fraudulent", "product_not_received"]] + ] + """ + An array of conditions that are covered for the transaction, if applicable. + """ + status: Literal[ + "eligible", "not_eligible", "partially_eligible" + ] + """ + Indicates whether the transaction is eligible for PayPal's seller protection. + """ + + class Shipping(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class VerifiedAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + payer_email: Optional[str] + """ + Owner's email. Values are provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + payer_id: Optional[str] + """ + PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + """ + payer_name: Optional[str] + """ + Owner's full name. Values provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + seller_protection: Optional[SellerProtection] + """ + The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + """ + shipping: Optional[Shipping] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ + transaction_id: Optional[str] + """ + A unique ID generated by PayPal for this transaction. + """ + verified_address: Optional[VerifiedAddress] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + _inner_class_types = { + "seller_protection": SellerProtection, + "shipping": Shipping, + "verified_address": VerifiedAddress, + } + + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + + class Pix(StripeObject): + bank_transaction_id: Optional[str] + """ + Unique transaction id generated by BCB + """ + + class Promptpay(StripeObject): + reference: Optional[str] + """ + Bill reference generated by PromptPay + """ + + class Qris(StripeObject): + pass + + class Rechnung(StripeObject): + pass + + class RevolutPay(StripeObject): + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} + + class SamsungPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Satispay(StripeObject): + pass + + class SepaCreditTransfer(StripeObject): + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + iban: Optional[str] + """ + IBAN of the bank account to transfer funds to. + """ + + class SepaDebit(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + branch_code: Optional[str] + """ + Branch code of bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four characters of the IBAN. + """ + mandate: Optional[str] + """ + Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + """ + + class Shopeepay(StripeObject): + pass + + class Sofort(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + preferred_language: Optional[ + Literal["de", "en", "es", "fr", "it", "nl", "pl"] + ] + """ + Preferred language of the SOFORT authorization page that the customer is redirected to. + Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by SOFORT directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class StripeAccount(StripeObject): + pass + + class StripeBalance(StripeObject): + account: Optional[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: Literal["bank_account", "card", "fpx"] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + + class Swish(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + """ + payment_reference: Optional[str] + """ + Payer bank reference number for the payment + """ + verified_phone_last4: Optional[str] + """ + The last four digits of the Swish account phone number + """ + + class Twint(StripeObject): + pass + + class UsBankAccount(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type: individual or company. + """ + account_type: Optional[Literal["checking", "savings"]] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ + payment_reference: Optional[str] + """ + Reference number to locate ACH payments with customer's bank. + """ + routing_number: Optional[str] + """ + Routing number of the bank account. + """ + + class Wechat(StripeObject): + pass + + class WechatPay(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular WeChat Pay account. You can use this attribute to check whether two WeChat accounts are the same. + """ + location: Optional[str] + """ + ID of the [location](https://stripe.com/docs/api/terminal/locations) that this transaction's reader is assigned to. + """ + reader: Optional[str] + """ + ID of the [reader](https://stripe.com/docs/api/terminal/readers) this transaction was made on. + """ + transaction_id: Optional[str] + """ + Transaction ID of this particular WeChat Pay transaction. + """ + + class Zip(StripeObject): + pass + + ach_credit_transfer: Optional[AchCreditTransfer] + ach_debit: Optional[AchDebit] + acss_debit: Optional[AcssDebit] + affirm: Optional[Affirm] + afterpay_clearpay: Optional[AfterpayClearpay] + alipay: Optional[Alipay] + alma: Optional[Alma] + amazon_pay: Optional[AmazonPay] + au_becs_debit: Optional[AuBecsDebit] + bacs_debit: Optional[BacsDebit] + bancontact: Optional[Bancontact] + billie: Optional[Billie] + billing_details: Optional[BillingDetails] + """ + The billing details associated with the method of payment. + """ + blik: Optional[Blik] + boleto: Optional[Boleto] + card: Optional[Card] + """ + Details of the card used for this payment attempt. + """ + card_present: Optional[CardPresent] + cashapp: Optional[Cashapp] + custom: Optional[Custom] + """ + Custom Payment Methods represent Payment Method types not modeled directly in + the Stripe API. This resource consists of details about the custom payment method + used for this payment attempt. + """ + customer_balance: Optional[CustomerBalance] + eps: Optional[Eps] + fpx: Optional[Fpx] + giropay: Optional[Giropay] + gopay: Optional[Gopay] + grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] + ideal: Optional[Ideal] + interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] + klarna: Optional[Klarna] + konbini: Optional[Konbini] + kr_card: Optional[KrCard] + link: Optional[Link] + mb_way: Optional[MbWay] + mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] + oxxo: Optional[Oxxo] + p24: Optional[P24] + pay_by_bank: Optional[PayByBank] + payco: Optional[Payco] + payment_method: Optional[str] + """ + ID of the Stripe PaymentMethod used to make this payment. + """ + paynow: Optional[Paynow] + paypal: Optional[Paypal] + payto: Optional[Payto] + pix: Optional[Pix] + promptpay: Optional[Promptpay] + qris: Optional[Qris] + rechnung: Optional[Rechnung] + revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] + satispay: Optional[Satispay] + sepa_credit_transfer: Optional[SepaCreditTransfer] + sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] + sofort: Optional[Sofort] + stripe_account: Optional[StripeAccount] + stripe_balance: Optional[StripeBalance] + swish: Optional[Swish] + twint: Optional[Twint] + type: str + """ + The type of transaction-specific details of the payment method used in the payment. See [PaymentMethod.type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type) for the full list of possible types. + An additional hash is included on `payment_method_details` with a name matching this value. + It contains information specific to the payment method. + """ + us_bank_account: Optional[UsBankAccount] + wechat: Optional[Wechat] + wechat_pay: Optional[WechatPay] + zip: Optional[Zip] + _inner_class_types = { + "ach_credit_transfer": AchCreditTransfer, + "ach_debit": AchDebit, + "acss_debit": AcssDebit, + "affirm": Affirm, + "afterpay_clearpay": AfterpayClearpay, + "alipay": Alipay, + "alma": Alma, + "amazon_pay": AmazonPay, + "au_becs_debit": AuBecsDebit, + "bacs_debit": BacsDebit, + "bancontact": Bancontact, + "billie": Billie, + "billing_details": BillingDetails, + "blik": Blik, + "boleto": Boleto, + "card": Card, + "card_present": CardPresent, + "cashapp": Cashapp, + "custom": Custom, + "customer_balance": CustomerBalance, + "eps": Eps, + "fpx": Fpx, + "giropay": Giropay, + "gopay": Gopay, + "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, + "ideal": Ideal, + "interac_present": InteracPresent, + "kakao_pay": KakaoPay, + "klarna": Klarna, + "konbini": Konbini, + "kr_card": KrCard, + "link": Link, + "mb_way": MbWay, + "mobilepay": Mobilepay, + "multibanco": Multibanco, + "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, + "oxxo": Oxxo, + "p24": P24, + "pay_by_bank": PayByBank, + "payco": Payco, + "paynow": Paynow, + "paypal": Paypal, + "payto": Payto, + "pix": Pix, + "promptpay": Promptpay, + "qris": Qris, + "rechnung": Rechnung, + "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, + "satispay": Satispay, + "sepa_credit_transfer": SepaCreditTransfer, + "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, + "sofort": Sofort, + "stripe_account": StripeAccount, + "stripe_balance": StripeBalance, + "swish": Swish, + "twint": Twint, + "us_bank_account": UsBankAccount, + "wechat": Wechat, + "wechat_pay": WechatPay, + "zip": Zip, + } + + class ShippingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Address + """ + A representation of a physical address. + """ + name: Optional[str] + """ + The shipping recipient's name. + """ + phone: Optional[str] + """ + The shipping recipient's phone number. + """ + _inner_class_types = {"address": Address} + + class ListParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_record: str + """ + The ID of the Payment Record. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount_canceled: AmountCanceled + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_failed: AmountFailed + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_guaranteed: AmountGuaranteed + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_requested: AmountRequested + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer_details: Optional[CustomerDetails] + """ + Customer information for this payment. + """ + customer_presence: Optional[Literal["off_session", "on_session"]] + """ + Indicates whether the customer was present in your checkout flow during this payment. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["payment_attempt_record"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Information about the Payment Method debited for this payment. + """ + payment_record: Optional[str] + """ + ID of the Payment Record this Payment Attempt Record belongs to. + """ + payment_reference: Optional[str] + """ + An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + """ + reported_by: Literal["self", "stripe"] + """ + Indicates who reported the payment. + """ + shipping_details: Optional[ShippingDetails] + """ + Shipping information for this payment. + """ + + @classmethod + def list( + cls, **params: Unpack["PaymentAttemptRecord.ListParams"] + ) -> ListObject["PaymentAttemptRecord"]: + """ + List all the Payment Attempt Records attached to the specified Payment Record. + """ + 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["PaymentAttemptRecord.ListParams"] + ) -> ListObject["PaymentAttemptRecord"]: + """ + List all the Payment Attempt Records attached to the specified Payment Record. + """ + 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["PaymentAttemptRecord.RetrieveParams"] + ) -> "PaymentAttemptRecord": + """ + Retrieves a Payment Attempt Record with the given ID + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentAttemptRecord.RetrieveParams"] + ) -> "PaymentAttemptRecord": + """ + Retrieves a Payment Attempt Record with the given ID + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "amount_canceled": AmountCanceled, + "amount_failed": AmountFailed, + "amount_guaranteed": AmountGuaranteed, + "amount_requested": AmountRequested, + "customer_details": CustomerDetails, + "payment_method_details": PaymentMethodDetails, + "shipping_details": ShippingDetails, + } diff --git a/stripe/_payment_attempt_record_service.py b/stripe/_payment_attempt_record_service.py new file mode 100644 index 000000000..922b9dc49 --- /dev/null +++ b/stripe/_payment_attempt_record_service.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._payment_attempt_record import PaymentAttemptRecord +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class PaymentAttemptRecordService(StripeService): + class ListParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_record: str + """ + The ID of the Payment Record. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "PaymentAttemptRecordService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[PaymentAttemptRecord]: + """ + List all the Payment Attempt Records attached to the specified Payment Record. + """ + return cast( + ListObject[PaymentAttemptRecord], + self._request( + "get", + "/v1/payment_attempt_records", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "PaymentAttemptRecordService.ListParams", + options: RequestOptions = {}, + ) -> ListObject[PaymentAttemptRecord]: + """ + List all the Payment Attempt Records attached to the specified Payment Record. + """ + return cast( + ListObject[PaymentAttemptRecord], + await self._request_async( + "get", + "/v1/payment_attempt_records", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "PaymentAttemptRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentAttemptRecord: + """ + Retrieves a Payment Attempt Record with the given ID + """ + return cast( + PaymentAttemptRecord, + self._request( + "get", + "/v1/payment_attempt_records/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "PaymentAttemptRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentAttemptRecord: + """ + Retrieves a Payment Attempt Record with the given ID + """ + return cast( + PaymentAttemptRecord, + await self._request_async( + "get", + "/v1/payment_attempt_records/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 175b190c7..1550ea734 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -4,6 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource @@ -37,12 +38,16 @@ from stripe._card import Card as CardResource from stripe._charge import Charge from stripe._customer import Customer + from stripe._payment_intent_amount_details_line_item import ( + PaymentIntentAmountDetailsLineItem, + ) from stripe._payment_method import PaymentMethod from stripe._review import Review from stripe._setup_intent import SetupIntent from stripe._source import Source +@nested_resource_class_methods("amount_details_line_item") class PaymentIntent( CreateableAPIResource["PaymentIntent"], ListableAPIResource["PaymentIntent"], @@ -66,14 +71,44 @@ class PaymentIntent( OBJECT_NAME: ClassVar[Literal["payment_intent"]] = "payment_intent" class AmountDetails(StripeObject): + class Shipping(StripeObject): + amount: Optional[int] + """ + Portion of the amount that is for shipping. + """ + from_postal_code: Optional[str] + """ + The postal code that represents the shipping source. + """ + to_postal_code: Optional[str] + """ + The postal code that represents the shipping destination. + """ + + class Tax(StripeObject): + total_tax_amount: Optional[int] + """ + Total portion of the amount that is for tax. + """ + class Tip(StripeObject): amount: Optional[int] """ Portion of the amount that corresponds to a tip. """ + discount_amount: Optional[int] + """ + The amount an item was discounted for. + """ + line_items: Optional[ListObject["PaymentIntentAmountDetailsLineItem"]] + """ + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + """ + shipping: Optional[Shipping] + tax: Optional[Tax] tip: Optional[Tip] - _inner_class_types = {"tip": Tip} + _inner_class_types = {"shipping": Shipping, "tax": Tax, "tip": Tip} class AutomaticPaymentMethods(StripeObject): allow_redirects: Optional[Literal["always", "never"]] @@ -87,6 +122,20 @@ class AutomaticPaymentMethods(StripeObject): Automatically calculates compatible payment methods """ + class Hooks(StripeObject): + class Inputs(StripeObject): + class Tax(StripeObject): + calculation: str + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ + + tax: Optional[Tax] + _inner_class_types = {"tax": Tax} + + inputs: Optional[Inputs] + _inner_class_types = {"inputs": Inputs} + class LastPaymentError(StripeObject): advice_code: Optional[str] """ @@ -146,6 +195,7 @@ class LastPaymentError(StripeObject): "email_invalid", "expired_card", "financial_connections_account_inactive", + "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", @@ -242,6 +292,7 @@ class LastPaymentError(StripeObject): "return_intent_already_processed", "routing_number_invalid", "secret_key_required", + "sensitive_data_access_expired", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", @@ -261,6 +312,7 @@ class LastPaymentError(StripeObject): "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", + "terminal_reader_collected_data_invalid", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", @@ -274,6 +326,8 @@ class LastPaymentError(StripeObject): "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", + "v2_account_disconnection_unsupported", + "v2_account_missing_configuration", ] ] """ @@ -1332,6 +1386,357 @@ class WechatPayRedirectToIosApp(StripeObject): "wechat_pay_redirect_to_ios_app": WechatPayRedirectToIosApp, } + class PaymentDetails(StripeObject): + class CarRental(StripeObject): + class Affiliate(StripeObject): + name: Optional[str] + """ + The name of the affiliate that originated the purchase. + """ + + class Delivery(StripeObject): + class Recipient(StripeObject): + email: Optional[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: Optional[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: Optional[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + mode: Optional[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: Optional[Recipient] + _inner_class_types = {"recipient": Recipient} + + class Distance(StripeObject): + amount: Optional[int] + """ + Distance traveled. + """ + unit: Optional[str] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers` + """ + + class Driver(StripeObject): + driver_identification_number: Optional[str] + """ + Driver's identification number. + """ + driver_tax_number: Optional[str] + """ + Driver's tax number. + """ + name: Optional[str] + """ + Full name of the driver on the reservation. + """ + + class PickupAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class ReturnAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + affiliate: Optional[Affiliate] + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: Optional[str] + """ + Class code of the car. + """ + car_make: Optional[str] + """ + Make of the car. + """ + car_model: Optional[str] + """ + Model of the car. + """ + company: Optional[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: Optional[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: Optional[Delivery] + distance: Optional[Distance] + drivers: Optional[List[Driver]] + """ + The details of the drivers associated with the trip. + """ + extra_charges: Optional[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: Optional[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: Optional[PickupAddress] + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: Optional[str] + """ + Name of the pickup location. + """ + rate_amount: Optional[int] + """ + Rental rate. + """ + rate_interval: Optional[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: Optional[str] + """ + The full name of the person or entity renting the car. + """ + return_address: Optional[ReturnAddress] + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: Optional[str] + """ + Name of the return location. + """ + tax_exempt: Optional[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: Optional[str] + """ + The vehicle identification number of the car. + """ + _inner_class_types = { + "affiliate": Affiliate, + "delivery": Delivery, + "distance": Distance, + "drivers": Driver, + "pickup_address": PickupAddress, + "return_address": ReturnAddress, + } + + class EventDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class Affiliate(StripeObject): + name: Optional[str] + """ + The name of the affiliate that originated the purchase. + """ + + class Delivery(StripeObject): + class Recipient(StripeObject): + email: Optional[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: Optional[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: Optional[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + mode: Optional[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: Optional[Recipient] + _inner_class_types = {"recipient": Recipient} + + access_controlled_venue: Optional[bool] + """ + Indicates if the tickets are digitally checked when entering the venue. + """ + address: Optional[Address] + affiliate: Optional[Affiliate] + company: Optional[str] + """ + The name of the company + """ + delivery: Optional[Delivery] + ends_at: Optional[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: Optional[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: Optional[str] + """ + The name of the event. + """ + starts_at: Optional[int] + """ + Event start time. Measured in seconds since the Unix epoch. + """ + _inner_class_types = { + "address": Address, + "affiliate": Affiliate, + "delivery": Delivery, + } + + class Subscription(StripeObject): + class Affiliate(StripeObject): + name: Optional[str] + """ + The name of the affiliate that originated the purchase. + """ + + class BillingInterval(StripeObject): + count: Optional[int] + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Optional[Literal["day", "month", "week", "year"]] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + affiliate: Optional[Affiliate] + auto_renewal: Optional[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: Optional[BillingInterval] + ends_at: Optional[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: Optional[str] + """ + Name of the product on subscription. e.g. Apple Music Subscription. + """ + starts_at: Optional[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + _inner_class_types = { + "affiliate": Affiliate, + "billing_interval": BillingInterval, + } + + car_rental: Optional[CarRental] + customer_reference: Optional[str] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: Optional[EventDetails] + order_reference: Optional[str] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: Optional[Subscription] + _inner_class_types = { + "car_rental": CarRental, + "event_details": EventDetails, + "subscription": Subscription, + } + class PaymentMethodConfigurationDetails(StripeObject): id: str """ @@ -1647,6 +2052,40 @@ class MandateOptions(StripeObject): Specifies the type of mandates supported. Possible values are `india`. """ + class StatementDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + phone: Optional[str] + """ + Phone number + """ + _inner_class_types = {"address": Address} + capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. @@ -1681,6 +2120,12 @@ class MandateOptions(StripeObject): """ Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. """ + request_decremental_authorization: Optional[ + Literal["if_available", "never"] + ] + """ + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + """ request_extended_authorization: Optional[ Literal["if_available", "never"] ] @@ -1701,6 +2146,12 @@ class MandateOptions(StripeObject): """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ + request_partial_authorization: Optional[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ request_three_d_secure: Optional[ Literal["any", "automatic", "challenge"] ] @@ -1731,9 +2182,11 @@ class MandateOptions(StripeObject): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + statement_details: Optional[StatementDetails] _inner_class_types = { "installments": Installments, "mandate_options": MandateOptions, + "statement_details": StatementDetails, } class CardPresent(StripeObject): @@ -1868,6 +2321,18 @@ class Giropay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class Gopay(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Grabpay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -1880,6 +2345,26 @@ class Grabpay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class IdBankTransfer(StripeObject): + expires_after: Optional[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now till 2678400 seconds (31 days) from now. + """ + expires_at: Optional[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Ideal(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ @@ -1995,6 +2480,18 @@ class Link(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class MbWay(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Mobilepay(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -2107,15 +2604,67 @@ class Paynow(StripeObject): """ class Paypal(StripeObject): - capture_method: Optional[Literal["manual"]] - """ - Controls when the funds will be captured from the customer's account. - """ - preferred_locale: Optional[str] - """ - Preferred locale of the PayPal checkout page that the customer is redirected to. - """ - reference: Optional[str] + class LineItem(StripeObject): + class Tax(StripeObject): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + category: Optional[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: Optional[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Cannot be a negative number. + """ + sku: Optional[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: Optional[str] + """ + The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + """ + tax: Optional[Tax] + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + _inner_class_types = {"tax": Tax} + + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: Optional[List[LineItem]] + """ + The line items purchased by the customer. + """ + preferred_locale: Optional[str] + """ + Preferred locale of the PayPal checkout page that the customer is redirected to. + """ + reference: Optional[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: Optional[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ @@ -2129,6 +2678,76 @@ class Paypal(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + subsellers: Optional[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + _inner_class_types = {"line_items": LineItem} + + class Payto(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Optional[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + _inner_class_types = {"mandate_options": MandateOptions} class Pix(StripeObject): expires_after_seconds: Optional[int] @@ -2162,6 +2781,21 @@ class Promptpay(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class Qris(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class Rechnung(StripeObject): + pass + class RevolutPay(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -2216,6 +2850,18 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Shopeepay(StripeObject): + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Sofort(StripeObject): preferred_language: Optional[ Literal["de", "en", "es", "fr", "it", "nl", "pl"] @@ -2234,6 +2880,18 @@ class Sofort(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class StripeBalance(StripeObject): + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Swish(StripeObject): reference: Optional[str] """ @@ -2271,8 +2929,19 @@ class Filters(StripeObject): """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ + + class ManualEntry(StripeObject): + mode: Optional[Literal["automatic", "custom"]] + """ + Settings for configuring manual entry of account details. + """ filters: Optional[Filters] + manual_entry: Optional[ManualEntry] permissions: Optional[ List[ Literal[ @@ -2287,7 +2956,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -2296,7 +2972,10 @@ class Filters(StripeObject): """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ - _inner_class_types = {"filters": Filters} + _inner_class_types = { + "filters": Filters, + "manual_entry": ManualEntry, + } class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] @@ -2390,7 +3069,9 @@ class Zip(StripeObject): eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -2398,6 +3079,7 @@ class Zip(StripeObject): konbini: Optional[Konbini] kr_card: Optional[KrCard] link: Optional[Link] + mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] @@ -2408,13 +3090,18 @@ class Zip(StripeObject): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] promptpay: Optional[Promptpay] + qris: Optional[Qris] + rechnung: Optional[Rechnung] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] + stripe_balance: Optional[StripeBalance] swish: Optional[Swish] twint: Optional[Twint] us_bank_account: Optional[UsBankAccount] @@ -2440,7 +3127,9 @@ class Zip(StripeObject): "eps": Eps, "fpx": Fpx, "giropay": Giropay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -2448,6 +3137,7 @@ class Zip(StripeObject): "konbini": Konbini, "kr_card": KrCard, "link": Link, + "mb_way": MbWay, "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, @@ -2458,13 +3148,18 @@ class Zip(StripeObject): "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "promptpay": Promptpay, + "qris": Qris, + "rechnung": Rechnung, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, + "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, @@ -2613,10 +3308,20 @@ class CaptureParams(RequestOptions): """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ + hooks: NotRequired["PaymentIntent.CaptureParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_details: NotRequired[ + "Literal['']|PaymentIntent.CaptureParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ statement_descriptor: NotRequired[str] """ Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). @@ -2633,560 +3338,614 @@ class CaptureParams(RequestOptions): is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - class CaptureParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntent.CaptureParamsHooksInputs"] """ - The amount that will be transferred automatically when a charge succeeds. + Arguments passed in automations """ - class ConfirmParams(RequestOptions): - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] - ] + class CaptureParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntent.CaptureParamsHooksInputsTax"] """ - Controls when the funds will be captured from the customer's account. + Tax arguments for automations """ - confirmation_token: NotRequired[str] + + class CaptureParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id """ - ID of the ConfirmationToken used to confirm this PaymentIntent. - If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + class CaptureParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRental" + ] """ - error_on_requires_action: NotRequired[bool] + Car rental details for this PaymentIntent. """ - Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + customer_reference: NotRequired["Literal['']|str"] """ - expand: NotRequired[List[str]] + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. """ - Specifies which fields in the response should be expanded. + event_details: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetails" + ] """ - mandate: NotRequired[str] + Event details for this PaymentIntent """ - ID of the mandate that's used for this payment. + flight: NotRequired["PaymentIntent.CaptureParamsPaymentDetailsFlight"] """ - mandate_data: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsMandateData" + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsLodging" ] - off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ - Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + Lodging reservation details for this PaymentIntent """ - payment_method: NotRequired[str] + order_reference: NotRequired["Literal['']|str"] """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent. + A unique value assigned by the business to identify the transaction. """ - payment_method_data: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodData" + subscription: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsSubscription" ] """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + Subscription details for this PaymentIntent """ - payment_method_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptions" + + class CaptureParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalAffiliate" ] """ - Payment method-specific configuration for this PaymentIntent. + Affiliate details for this purchase. """ - payment_method_types: NotRequired[List[str]] + booking_number: str """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The booking number associated with the car rental. """ - radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] + car_class_code: NotRequired[str] """ - Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + Class code of the car. """ - receipt_email: NotRequired["Literal['']|str"] + car_make: NotRequired[str] """ - Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + Make of the car. """ - return_url: NotRequired[str] + car_model: NotRequired[str] """ - The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - This parameter is only used for cards and other redirect-based payment methods. + Model of the car. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" - ] + company: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The name of the rental car company. """ - shipping: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsShipping" - ] + customer_service_phone_number: NotRequired[str] """ - Shipping information for this PaymentIntent. + The customer service phone number of the car rental company. """ - use_stripe_sdk: NotRequired[bool] + days_rented: int """ - Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + Number of days the car is being rented. """ - - class ConfirmParamsMandateData(TypedDict): - customer_acceptance: NotRequired[ - "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptance" + delivery: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalDelivery" ] """ - This hash contains details about the customer acceptance of the Mandate. + Delivery details for this purchase. """ - - class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired[int] + distance: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalDistance" + ] """ - The time at which the customer accepted the Mandate. + The details of the distance traveled during the rental period. """ - offline: NotRequired[ - "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOffline" + drivers: NotRequired[ + List["PaymentIntent.CaptureParamsPaymentDetailsCarRentalDriver"] ] """ - If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + The details of the passengers in the travel reservation """ - online: NotRequired[ - "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOnline" + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] ] """ - If this is a Mandate accepted online, this hash contains details about the online acceptance. + List of additional charges being billed. """ - type: Literal["offline", "online"] + no_show: NotRequired[bool] """ - The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + Indicates if the customer did not keep nor cancel their booking. """ - - class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): - pass - - class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired[str] + pickup_address: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalPickupAddress" + ] """ - The IP address from which the Mandate was accepted by the customer. + Car pick-up address. """ - user_agent: NotRequired[str] + pickup_at: int """ - The user agent of the browser from which the Mandate was accepted by the customer. + Car pick-up time. Measured in seconds since the Unix epoch. """ - - class ConfirmParamsPaymentMethodData(TypedDict): - acss_debit: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAcssDebit" - ] + pickup_location_name: NotRequired[str] """ - If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + Name of the pickup location. """ - affirm: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAffirm" - ] + rate_amount: NotRequired[int] """ - If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + Rental rate. """ - afterpay_clearpay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAfterpayClearpay" - ] + rate_interval: NotRequired[Literal["day", "month", "week"]] """ - If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + The frequency at which the rate amount is applied. One of `day`, `week` or `month` """ - alipay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAlipay" - ] + renter_name: NotRequired[str] """ - If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + The name of the person or entity renting the car. """ - allow_redisplay: NotRequired[ - Literal["always", "limited", "unspecified"] + return_address: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalReturnAddress" ] """ - This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + Car return address. """ - alma: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataAlma"] + return_at: int """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + Car return time. Measured in seconds since the Unix epoch. """ - amazon_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" - ] + return_location_name: NotRequired[str] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + Name of the return location. """ - au_becs_debit: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" - ] + tax_exempt: NotRequired[bool] """ - If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + Indicates whether the goods or services are tax-exempt or tax is not collected. """ - bacs_debit: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataBacsDebit" - ] + vehicle_identification_number: NotRequired[str] """ - If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + The vehicle identification number. """ - bancontact: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataBancontact" - ] + + class CaptureParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + The name of the affiliate that originated the purchase. """ - billie: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataBillie" - ] + + class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + The delivery method for the payment """ - billing_details: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetails" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ - Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + Details of the recipient. """ - blik: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataBlik"] + + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + The email of the recipient the ticket is delivered to. """ - boleto: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataBoleto" - ] + name: NotRequired[str] """ - If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + The name of the recipient the ticket is delivered to. """ - cashapp: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataCashapp" - ] + phone: NotRequired[str] """ - If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + The phone number of the recipient the ticket is delivered to. """ - customer_balance: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataCustomerBalance" - ] + + class CaptureParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + Distance traveled. """ - eps: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataEps"] + unit: NotRequired[Literal["kilometers", "miles"]] """ - If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - fpx: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataFpx"] + + class CaptureParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] """ - If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + Driver's identification number. """ - giropay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataGiropay" - ] + driver_tax_number: NotRequired[str] """ - If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + Driver's tax number. """ - grabpay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataGrabpay" - ] + name: str """ - If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + Full name of the person or entity on the car reservation. """ - ideal: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataIdeal"] + + class CaptureParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + City, district, suburb, town, or village. """ - interac_present: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataInteracPresent" - ] + country: NotRequired[str] """ - If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - kakao_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataKakaoPay" - ] + line1: NotRequired[str] """ - If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - klarna: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataKlarna" - ] + line2: NotRequired[str] """ - If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + Address line 2 (e.g., apartment, suite, unit, or building). """ - konbini: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataKonbini" - ] + postal_code: NotRequired[str] """ - If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + ZIP or postal code. """ - kr_card: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataKrCard" - ] + state: NotRequired[str] """ - If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + State, county, province, or region. """ - link: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataLink"] + + class CaptureParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + City, district, suburb, town, or village. """ - metadata: NotRequired[Dict[str, str]] + country: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - mobilepay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataMobilepay" - ] + line1: NotRequired[str] """ - If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - multibanco: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataMultibanco" - ] + line2: NotRequired[str] """ - If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + Address line 2 (e.g., apartment, suite, unit, or building). """ - naver_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataNaverPay" - ] + postal_code: NotRequired[str] """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + ZIP or postal code. """ - nz_bank_account: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataNzBankAccount" - ] + state: NotRequired[str] """ - If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + State, county, province, or region. """ - oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] + + class CaptureParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + Indicates if the tickets are digitally checked when entering the venue. """ - p24: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataP24"] + address: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsAddress" + ] """ - If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + The event location's address. """ - pay_by_bank: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataPayByBank" + affiliate: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsAffiliate" ] """ - If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + Affiliate details for this purchase. """ - payco: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayco"] + company: NotRequired[str] """ - If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + The name of the company """ - paynow: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataPaynow" + delivery: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsDelivery" ] """ - If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + Delivery details for this purchase. """ - paypal: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataPaypal" - ] + ends_at: NotRequired[int] """ - If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + Event end time. Measured in seconds since the Unix epoch. """ - pix: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPix"] + genre: NotRequired[str] """ - If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + Type of the event entertainment (concert, sports event etc) """ - promptpay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataPromptpay" - ] + name: str """ - If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + The name of the event. """ - radar_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataRadarOptions" - ] + starts_at: NotRequired[int] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + Event start time. Measured in seconds since the Unix epoch. """ - revolut_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataRevolutPay" - ] + + class CaptureParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + City, district, suburb, town, or village. """ - samsung_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataSamsungPay" - ] + country: NotRequired[str] """ - If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - satispay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataSatispay" - ] + line1: NotRequired[str] """ - If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - sepa_debit: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataSepaDebit" - ] + line2: NotRequired[str] """ - If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + Address line 2 (e.g., apartment, suite, unit, or building). """ - sofort: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataSofort" - ] + postal_code: NotRequired[str] """ - If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + ZIP or postal code. """ - swish: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataSwish"] + state: NotRequired[str] """ - If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + State, county, province, or region. """ - twint: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataTwint"] + + class CaptureParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + The name of the affiliate that originated the purchase. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "blik", - "boleto", - "cashapp", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "sepa_debit", - "sofort", - "swish", - "twint", - "us_bank_account", - "wechat_pay", - "zip", - ] + + class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + The delivery method for the payment """ - us_bank_account: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataUsBankAccount" + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ - If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + Details of the recipient. """ - wechat_pay: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataWechatPay" - ] + + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + The email of the recipient the ticket is delivered to. """ - zip: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataZip"] + name: NotRequired[str] """ - If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + The name of the recipient the ticket is delivered to. """ - - class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): - account_number: str + phone: NotRequired[str] """ - Customer's bank account number. + The phone number of the recipient the ticket is delivered to. """ - institution_number: str + + class CaptureParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsFlightAffiliate" + ] """ - Institution number of the customer's bank. + Affiliate details for this purchase. """ - transit_number: str + agency_number: NotRequired[str] """ - Transit number of the customer's bank. + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["PaymentIntent.CaptureParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List[ + "PaymentIntent.CaptureParamsPaymentDetailsFlightSegment" + ] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - class ConfirmParamsPaymentMethodDataAffirm(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAlipay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAlma(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): - pass + class CaptureParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ - class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): - account_number: str + class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - The account number for the bank account. + The delivery method for the payment """ - bsb_number: str + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsFlightDeliveryRecipient" + ] """ - Bank-State-Branch number of the bank account. + Details of the recipient. """ - class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired[str] + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Account number of the bank account that the funds will be debited from. + The email of the recipient the ticket is delivered to. """ - sort_code: NotRequired[str] + name: NotRequired[str] """ - Sort code of the bank account. (e.g., `10-20-30`) + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodDataBancontact(TypedDict): - pass + class CaptureParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ - class ConfirmParamsPaymentMethodDataBillie(TypedDict): - pass + class CaptureParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ - class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): + class CaptureParamsPaymentDetailsLodging(TypedDict): address: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" + "PaymentIntent.CaptureParamsPaymentDetailsLodgingAddress" ] """ - Billing address. + The lodging location's address. """ - email: NotRequired["Literal['']|str"] + adults: NotRequired[int] """ - Email address. + The number of adults on the booking """ - name: NotRequired["Literal['']|str"] + affiliate: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsLodgingAffiliate" + ] """ - Full name. + Affiliate details for this purchase. """ - phone: NotRequired["Literal['']|str"] + booking_number: NotRequired[str] """ - Billing phone number (including extension). + The booking number associated with the lodging reservation. """ - tax_id: NotRequired[str] + category: NotRequired[Literal["hotel", "vacation_rental"]] """ - Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["PaymentIntent.CaptureParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount """ - class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + class CaptureParamsPaymentDetailsLodgingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -3212,3329 +3971,6997 @@ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): State, county, province, or region. """ - class ConfirmParamsPaymentMethodDataBlik(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataBoleto(TypedDict): - tax_id: str + class CaptureParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str """ - The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodDataCashapp(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataEps(TypedDict): - bank: NotRequired[ - Literal[ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau", - ] + class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" ] """ - The customer's bank. + Details of the recipient. """ - class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Account holder type for FPX transaction + The email of the recipient the ticket is delivered to. """ - bank: Literal[ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob", - ] + name: NotRequired[str] """ - The customer's bank. + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodDataGiropay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): - pass + class CaptureParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ - class ConfirmParamsPaymentMethodDataIdeal(TypedDict): - bank: NotRequired[ - Literal[ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "n26", - "nn", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot", - "yoursafe", - ] + class CaptureParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsSubscriptionAffiliate" ] """ - The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + Affiliate details for this purchase. """ - - class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKlarna(TypedDict): - dob: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodDataKlarnaDob" + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "PaymentIntent.CaptureParamsPaymentDetailsSubscriptionBillingInterval" ] """ - Customer's date of birth + Subscription billing details for this purchase. """ - - class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): - day: int + ends_at: NotRequired[int] """ - The day of birth, between 1 and 31. + Subscription end time. Measured in seconds since the Unix epoch. """ - month: int + name: str """ - The month of birth, between 1 and 12. + Name of the product on subscription. e.g. Apple Music Subscription """ - year: int + starts_at: NotRequired[int] """ - The four-digit year of birth. + Subscription start time. Measured in seconds since the Unix epoch. """ - class ConfirmParamsPaymentMethodDataKonbini(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKrCard(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataLink(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + class CaptureParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): - account_holder_name: NotRequired[str] - """ - The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. - """ - account_number: str + class CaptureParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int """ - The account number for the bank account. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - bank_code: str + interval: Literal["day", "month", "week", "year"] """ - The numeric code for the bank account's bank. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - branch_code: str + + class CaptureParamsTransferData(TypedDict): + amount: NotRequired[int] """ - The numeric code for the bank account's bank branch. + The amount that will be transferred automatically when a charge succeeds. """ - reference: NotRequired[str] - suffix: str + + class ConfirmParams(RequestOptions): + application_fee_amount: NotRequired["Literal['']|int"] """ - The suffix of the bank account number. + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - - class ConfirmParamsPaymentMethodDataOxxo(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataP24(TypedDict): - bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] ] """ - The customer's bank. - """ - - class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPayco(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPaynow(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPaypal(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPix(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired[str] + Controls when the funds will be captured from the customer's account. """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + confirmation_token: NotRequired[str] """ + ID of the ConfirmationToken used to confirm this PaymentIntent. - class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSatispay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): - iban: str - """ - IBAN of the bank account. + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - - class ConfirmParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + error_on_requires_action: NotRequired[bool] """ - Two-letter ISO code representing the country the bank account is located in. + Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). """ - - class ConfirmParamsPaymentMethodDataSwish(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataTwint(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + expand: NotRequired[List[str]] """ - Account holder type: individual or company. + Specifies which fields in the response should be expanded. """ - account_number: NotRequired[str] + fx_quote: NotRequired[str] """ - Account number of the bank account. + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. """ - account_type: NotRequired[Literal["checking", "savings"]] + hooks: NotRequired["PaymentIntent.ConfirmParamsHooks"] """ - Account type: checkings or savings. Defaults to checking if omitted. + Automations to be run during the PaymentIntent lifecycle """ - financial_connections_account: NotRequired[str] + mandate: NotRequired[str] """ - The ID of a Financial Connections Account to use as a payment method. + ID of the mandate that's used for this payment. """ - routing_number: NotRequired[str] + mandate_data: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsMandateData" + ] + off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ - Routing number of the bank account. + Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ - - class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataZip(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptions(TypedDict): - acss_debit: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit" + payment_details: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentDetails" ] """ - If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + Provides industry-specific information about the charge. """ - affirm: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAffirm" - ] + payment_method: NotRequired[str] """ - If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent. """ - afterpay_clearpay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" + payment_method_data: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodData" ] """ - If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. """ - alipay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlipay" + payment_method_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptions" ] """ - If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + Payment method-specific configuration for this PaymentIntent. """ - alma: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlma" - ] + payment_method_types: NotRequired[List[str]] """ - If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ - amazon_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" - ] + radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] """ - If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ - au_becs_debit: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit" - ] + receipt_email: NotRequired["Literal['']|str"] """ - If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - bacs_debit: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit" - ] + return_url: NotRequired[str] """ - If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + This parameter is only used for cards and other redirect-based payment methods. """ - bancontact: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBancontact" + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']" ] """ - If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - billie: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBillie" + shipping: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsShipping" ] """ - If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + Shipping information for this PaymentIntent. """ - blik: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBlik" - ] + use_stripe_sdk: NotRequired[bool] """ - If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ - boleto: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBoleto" - ] + + class ConfirmParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntent.ConfirmParamsHooksInputs"] """ - If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + Arguments passed in automations """ - card: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCard" - ] + + class ConfirmParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntent.ConfirmParamsHooksInputsTax"] """ - Configuration for any card payments attempted on this PaymentIntent. + Tax arguments for automations """ - card_present: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent" - ] + + class ConfirmParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] """ - If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id """ - cashapp: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCashapp" + + class ConfirmParamsMandateData(TypedDict): + customer_acceptance: NotRequired[ + "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptance" ] """ - If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + This hash contains details about the customer acceptance of the Mandate. """ - customer_balance: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalance" - ] + + class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): + accepted_at: NotRequired[int] """ - If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + The time at which the customer accepted the Mandate. """ - eps: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsEps" + offline: NotRequired[ + "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ - If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ - fpx: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsFpx" + online: NotRequired[ + "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ - If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + If this is a Mandate accepted online, this hash contains details about the online acceptance. """ - giropay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGiropay" - ] + type: Literal["offline", "online"] """ - If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ - grabpay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGrabpay" - ] + + class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): + pass + + class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: NotRequired[str] """ - If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + The IP address from which the Mandate was accepted by the customer. """ - ideal: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdeal" - ] + user_agent: NotRequired[str] """ - If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + The user agent of the browser from which the Mandate was accepted by the customer. """ - interac_present: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsInteracPresent" + + class ConfirmParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRental" ] """ - If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + Car rental details for this PaymentIntent. """ - kakao_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKakaoPay" - ] + customer_reference: NotRequired["Literal['']|str"] """ - If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. """ - klarna: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna" + event_details: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetails" ] """ - If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + Event details for this PaymentIntent """ - konbini: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKonbini" - ] + flight: NotRequired["PaymentIntent.ConfirmParamsPaymentDetailsFlight"] """ - If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + Flight reservation details for this PaymentIntent """ - kr_card: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKrCard" + lodging: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodging" ] """ - If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + Lodging reservation details for this PaymentIntent """ - link: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsLink" - ] + order_reference: NotRequired["Literal['']|str"] """ - If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + A unique value assigned by the business to identify the transaction. """ - mobilepay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMobilepay" + subscription: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsSubscription" ] """ - If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + Subscription details for this PaymentIntent """ - multibanco: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMultibanco" + + class ConfirmParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalAffiliate" ] """ - If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + Affiliate details for this purchase. """ - naver_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNaverPay" - ] + booking_number: str """ - If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + The booking number associated with the car rental. """ - nz_bank_account: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNzBankAccount" - ] + car_class_code: NotRequired[str] """ - If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + Class code of the car. """ - oxxo: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" - ] + car_make: NotRequired[str] """ - If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + Make of the car. """ - p24: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsP24" - ] + car_model: NotRequired[str] """ - If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + Model of the car. """ - pay_by_bank: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayByBank" - ] + company: NotRequired[str] """ - If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + The name of the rental car company. """ - payco: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayco" - ] + customer_service_phone_number: NotRequired[str] """ - If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + The customer service phone number of the car rental company. """ - paynow: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaynow" - ] + days_rented: int """ - If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + Number of days the car is being rented. """ - paypal: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypal" + delivery: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDelivery" ] """ - If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + Delivery details for this purchase. """ - pix: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPix" + distance: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDistance" ] """ - If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + The details of the distance traveled during the rental period. """ - promptpay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPromptpay" + drivers: NotRequired[ + List["PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDriver"] ] """ - If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + The details of the passengers in the travel reservation """ - revolut_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay" + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] ] """ - If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + List of additional charges being billed. """ - samsung_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSamsungPay" - ] + no_show: NotRequired[bool] """ - If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + Indicates if the customer did not keep nor cancel their booking. """ - satispay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSatispay" + pickup_address: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalPickupAddress" ] """ - If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + Car pick-up address. """ - sepa_debit: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" - ] + pickup_at: int """ - If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + Car pick-up time. Measured in seconds since the Unix epoch. """ - sofort: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSofort" - ] + pickup_location_name: NotRequired[str] """ - If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + Name of the pickup location. """ - swish: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSwish" - ] + rate_amount: NotRequired[int] """ - If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + Rental rate. """ - twint: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsTwint" - ] + rate_interval: NotRequired[Literal["day", "month", "week"]] """ - If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + The frequency at which the rate amount is applied. One of `day`, `week` or `month` """ - us_bank_account: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" - ] + renter_name: NotRequired[str] """ - If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + The name of the person or entity renting the car. """ - wechat_pay: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsWechatPay" + return_address: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalReturnAddress" ] """ - If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + Car return address. """ - zip: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsZip" - ] + return_at: int """ - If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + Car return time. Measured in seconds since the Unix epoch. """ - - class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" - ] + return_location_name: NotRequired[str] """ - Additional fields for Mandate creation + Name of the return location. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + tax_exempt: NotRequired[bool] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Indicates whether the goods or services are tax-exempt or tax is not collected. """ - target_date: NotRequired[str] + vehicle_identification_number: NotRequired[str] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + The vehicle identification number. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + + class ConfirmParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - Bank account verification method. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): - custom_mandate_url: NotRequired["Literal['']|str"] + class ConfirmParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - A URL for custom mandate text to render during confirmation step. - The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + The delivery method for the payment """ - interval_description: NotRequired[str] + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient" + ] """ - Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + Details of the recipient. """ - payment_schedule: NotRequired[ - Literal["combined", "interval", "sporadic"] - ] + + class ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Payment schedule for the mandate. + The email of the recipient the ticket is delivered to. """ - transaction_type: NotRequired[Literal["business", "personal"]] + name: NotRequired[str] """ - Transaction type of the mandate. + The name of the recipient the ticket is delivered to. """ - - class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - preferred_locale: NotRequired[str] + Distance traveled. """ - Preferred language of the Affirm authorization page that the customer is redirected to. + unit: NotRequired[Literal["kilometers", "miles"]] """ - setup_future_usage: NotRequired[Literal["none"]] + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Driver's identification number. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + driver_tax_number: NotRequired[str] """ - reference: NotRequired[str] + Driver's tax number. """ - An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. - This field differs from the statement descriptor and item name. + name: str """ - setup_future_usage: NotRequired[Literal["none"]] + Full name of the person or entity on the car reservation. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + City, district, suburb, town, or village. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + country: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + line1: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Address line 1 (e.g., street, PO Box, or company name). """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + line2: NotRequired[str] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + Address line 2 (e.g., apartment, suite, unit, or building). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + postal_code: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - target_date: NotRequired[str] + City, district, suburb, town, or village. """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + class ConfirmParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] + """ + Indicates if the tickets are digitally checked when entering the venue. + """ + address: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsAddress" ] """ - Additional fields for Mandate creation + The event location's address. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + affiliate: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsAffiliate" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Affiliate details for this purchase. """ - target_date: NotRequired[str] + company: NotRequired[str] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + The name of the company """ - - class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + delivery: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsDelivery" + ] """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + Delivery details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + ends_at: NotRequired[int] """ - Preferred language of the Bancontact authorization page that the customer is redirected to. + Event end time. Measured in seconds since the Unix epoch. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + genre: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Type of the event entertainment (concert, sports event etc) """ - - class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + name: str """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. """ - class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired[str] + class ConfirmParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + City, district, suburb, town, or village. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + country: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - - class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired[int] + line1: NotRequired[str] """ - The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + Address line 1 (e.g., street, PO Box, or company name). """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + line2: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Address line 2 (e.g., apartment, suite, unit, or building). """ - - class ConfirmParamsPaymentMethodOptionsCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + postal_code: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + ZIP or postal code. """ - cvc_token: NotRequired[str] + state: NotRequired[str] """ - A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + State, county, province, or region. """ - installments: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallments" - ] + + class ConfirmParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. """ - Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + class ConfirmParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - mandate_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ - Configuration options for setting up an eMandate for cards issued in India. + Details of the recipient. """ - moto: NotRequired[bool] + + class ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - When specified, this parameter indicates that a transaction will be marked - as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - parameter can only be provided during confirmation. + The email of the recipient the ticket is delivered to. """ - network: NotRequired[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "girocard", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", - ] - ] + name: NotRequired[str] """ - Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + The name of the recipient the ticket is delivered to. """ - request_extended_authorization: NotRequired[ - Literal["if_available", "never"] - ] + phone: NotRequired[str] """ - Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + The phone number of the recipient the ticket is delivered to. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + + class ConfirmParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsFlightAffiliate" ] """ - Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + Affiliate details for this purchase. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + agency_number: NotRequired[str] """ - Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + carrier: NotRequired[str] """ - Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. """ - request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + delivery: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsFlightDelivery" ] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + Delivery details for this purchase. """ - require_cvc_recollection: NotRequired[bool] + passenger_name: NotRequired[str] """ - When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + The name of the person or entity on the reservation. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + passengers: NotRequired[ + List["PaymentIntent.ConfirmParamsPaymentDetailsFlightPassenger"] ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The details of the passengers in the travel reservation. """ - statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] + segments: List[ + "PaymentIntent.ConfirmParamsPaymentDetailsFlightSegment" + ] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + The individual flight segments associated with the trip. """ - statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + ticket_number: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + The ticket number associated with the travel reservation. """ - three_d_secure: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" - ] + + class ConfirmParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str """ - If 3D Secure authentication was performed with a third-party provider, - the authentication details to use for this payment. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired[bool] + class ConfirmParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Setting to true enables installments for this PaymentIntent. - This will cause the response to contain a list of available installment plans. - Setting to false will prevent any selected plan from applying to a charge. + The delivery method for the payment """ - plan: NotRequired[ - "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsFlightDeliveryRecipient" ] """ - The selected installment plan to use for this payment attempt. - This parameter can only be provided during confirmation. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: NotRequired[int] + class ConfirmParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + The email of the recipient the ticket is delivered to. """ - interval: NotRequired[Literal["month"]] + name: NotRequired[str] """ - For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. - One of `month`. + The name of the recipient the ticket is delivered to. """ - type: Literal["fixed_count"] + phone: NotRequired[str] """ - Type of installment plan, one of `fixed_count`. + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): - amount: int + class ConfirmParamsPaymentDetailsFlightPassenger(TypedDict): + name: str """ - Amount to be charged for future payments. + Full name of the person or entity on the flight reservation. """ - amount_type: Literal["fixed", "maximum"] + + class ConfirmParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + The flight segment amount. """ - description: NotRequired[str] + arrival_airport: NotRequired[str] """ - A description of the mandate or subscription that is meant to be displayed to the customer. + The International Air Transport Association (IATA) airport code for the arrival airport. """ - end_date: NotRequired[int] + arrives_at: NotRequired[int] """ - End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + The arrival time for the flight segment. Measured in seconds since the Unix epoch. """ - interval: Literal["day", "month", "sporadic", "week", "year"] + carrier: NotRequired[str] """ - Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. """ - interval_count: NotRequired[int] + departs_at: int """ - The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + The departure time for the flight segment. Measured in seconds since the Unix epoch. """ - reference: str + departure_airport: NotRequired[str] """ - Unique identifier for the mandate or subscription. + The International Air Transport Association (IATA) airport code for the departure airport. """ - start_date: int + flight_number: NotRequired[str] """ - Start date of the mandate or subscription. Start date should not be lesser than yesterday. + The flight number associated with the segment """ - supported_types: NotRequired[List[Literal["india"]]] + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] """ - Specifies the type of mandates supported. Possible values are `india`. + The fare class for the segment. """ - class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired[bool] + class ConfirmParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodgingAddress" + ] """ - Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + The lodging location's address. """ - request_incremental_authorization_support: NotRequired[bool] + adults: NotRequired[int] """ - Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + The number of adults on the booking """ - routing: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresentRouting" + affiliate: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodgingAffiliate" ] """ - Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + Affiliate details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): - requested_priority: NotRequired[Literal["domestic", "international"]] + booking_number: NotRequired[str] """ - Routing requested priority + The booking number associated with the lodging reservation. """ - - class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[ - Literal["A", "C", "I", "N", "R", "U", "Y"] - ] + category: NotRequired[Literal["hotel", "vacation_rental"]] """ - The `transStatus` returned from the card Issuer's ACS in the ARes. + The lodging category """ - cryptogram: str + checkin_at: int """ - The cryptogram, also known as the "authentication value" (AAV, CAVV or - AEVV). This value is 20 bytes, base64-encoded into a 28-character string. - (Most 3D Secure providers will return the base64-encoded version, which - is what you should specify here.) + Lodging check-in time. Measured in seconds since the Unix epoch. """ - electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] - ] + checkout_at: int """ - The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - provider and indicates what degree of authentication was performed. + Lodging check-out time. Measured in seconds since the Unix epoch. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + customer_service_phone_number: NotRequired[str] """ - The exemption requested via 3DS and accepted by the issuer at authentication time. + The customer service phone number of the lodging company. """ - network_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodgingDelivery" ] """ - Network specific 3DS fields. Network specific arguments require an - explicit card brand choice. The parameter `payment_method_options.card.network`` - must be populated accordingly + Delivery details for this purchase. """ - requestor_challenge_indicator: NotRequired[str] + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] """ - The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + List of additional charges being billed. """ - transaction_id: str + fire_safety_act_compliance: NotRequired[bool] """ - For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server - Transaction ID (dsTransID). + Indicates whether the lodging location is compliant with the Fire Safety Act. """ - version: Literal["1.0.2", "2.1.0", "2.2.0"] + name: NotRequired[str] """ - The version of 3D Secure that was performed. + The name of the lodging location. """ - - class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( - TypedDict, - ): - cartes_bancaires: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["PaymentIntent.ConfirmParamsPaymentDetailsLodgingPassenger"] ] """ - Cartes Bancaires-specific 3DS fields. + The details of the passengers in the travel reservation """ - - class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( - TypedDict, - ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + property_phone_number: NotRequired[str] """ - The cryptogram calculation algorithm used by the card Issuer's ACS - to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. - messageExtension: CB-AVALGO + The phone number of the lodging location. """ - cb_exemption: NotRequired[str] + room_class: NotRequired[str] """ - The exemption indicator returned from Cartes Bancaires in the ARes. - message extension: CB-EXEMPTION; string (4 characters) - This is a 3 byte bitmap (low significant byte first and most significant - bit first) that has been Base64 encoded + The room class for this purchase. """ - cb_score: NotRequired[int] + room_nights: NotRequired[int] """ - The risk score returned from Cartes Bancaires in the ARes. - message extension: CB-SCORE; numeric value 0-99 + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount """ - class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - Controls when the funds are captured from the customer's account. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + class ConfirmParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsLodgingDeliveryRecipient" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): - bank_transfer: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" - ] + class ConfirmParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + The email of the recipient the ticket is delivered to. """ - funding_type: NotRequired[Literal["bank_transfer"]] + name: NotRequired[str] """ - The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + The name of the recipient the ticket is delivered to. """ - setup_future_usage: NotRequired[Literal["none"]] + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. """ - class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( - TypedDict, - ): - eu_bank_transfer: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + class ConfirmParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsSubscriptionAffiliate" ] """ - Configuration for the eu_bank_transfer funding type. + Affiliate details for this purchase. """ - requested_address_types: NotRequired[ - List[ - Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", - ] - ] - ] + auto_renewal: NotRequired[bool] """ - List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - - Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + Info whether the subscription will be auto renewed upon expiry. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + billing_interval: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentDetailsSubscriptionBillingInterval" ] """ - The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + Subscription billing details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( - TypedDict, - ): - country: str + ends_at: NotRequired[int] """ - The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + Subscription end time. Measured in seconds since the Unix epoch. """ - - class ConfirmParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + name: str """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Name of the product on subscription. e.g. Apple Music Subscription """ - - class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + starts_at: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Subscription start time. Measured in seconds since the Unix epoch. """ - class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ConfirmParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ConfirmParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + class ConfirmParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAcssDebit" + ] + """ + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + """ + afterpay_clearpay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAfterpayClearpay" + ] + """ + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + """ + alipay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAlipay" + ] + """ + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ + alma: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ + amazon_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ + au_becs_debit: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" + ] + """ + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + """ + bacs_debit: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + """ + bancontact: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + """ + billie: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + """ + billing_details: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + blik: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ + boleto: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + """ + cashapp: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + """ + customer_balance: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataCustomerBalance" + ] + """ + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + """ + eps: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataEps"] + """ + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + """ + fpx: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataFpx"] + """ + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + """ + giropay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + """ + gopay: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ + grabpay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + """ + id_bank_transfer: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ + ideal: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataIdeal"] + """ + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + """ + interac_present: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataInteracPresent" + ] + """ + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + """ + kakao_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ + klarna: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + """ + konbini: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + """ + kr_card: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ + link: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataLink"] + """ + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + """ + mb_way: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + mobilepay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ + multibanco: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ + naver_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ + nz_bank_account: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ + oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] + """ + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + """ + p24: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataP24"] + """ + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + """ + pay_by_bank: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ + payco: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ + paynow: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + """ + paypal: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + """ + payto: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ + pix: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPix"] + """ + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + """ + promptpay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + """ + qris: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ + radar_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataRadarOptions" + ] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + rechnung: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ + revolut_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataRevolutPay" + ] + """ + If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + """ + samsung_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ + satispay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + """ + sepa_debit: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + """ + shopeepay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ + sofort: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataSofort" + ] + """ + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + """ + stripe_balance: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ + swish: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataSwish"] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ + twint: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataTwint"] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "sepa_debit", + "shopeepay", + "sofort", + "stripe_balance", + "swish", + "twint", + "us_bank_account", + "wechat_pay", + "zip", + ] + """ + The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + """ + us_bank_account: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataUsBankAccount" + ] + """ + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + """ + wechat_pay: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataWechatPay" + ] + """ + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + """ + zip: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataZip"] + """ + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + """ + + class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str + """ + Customer's bank account number. + """ + institution_number: str + """ + Institution number of the customer's bank. + """ + transit_number: str + """ + Transit number of the customer's bank. + """ + + class ConfirmParamsPaymentMethodDataAffirm(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataAlipay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str + """ + The account number for the bank account. + """ + bsb_number: str + """ + Bank-State-Branch number of the bank account. + """ + + class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired[str] + """ + Account number of the bank account that the funds will be debited from. + """ + sort_code: NotRequired[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class ConfirmParamsPaymentMethodDataBancontact(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired["Literal['']|str"] + """ + Email address. + """ + name: NotRequired["Literal['']|str"] + """ + Full name. + """ + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + tax_id: NotRequired[str] + """ + Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + """ + + class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ConfirmParamsPaymentMethodDataBlik(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str + """ + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + """ + + class ConfirmParamsPaymentMethodDataCashapp(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] + """ + The customer's bank. + """ + + class ConfirmParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] + """ + Account holder type for FPX transaction + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. + """ + + class ConfirmParamsPaymentMethodDataGiropay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataGopay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] + """ + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + """ + + class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataKlarnaDob" + ] + """ + Customer's date of birth + """ + + class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class ConfirmParamsPaymentMethodDataKonbini(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataLink(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMbWay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] + """ + The customer's bank. + """ + + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPaypal(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + + class ConfirmParamsPaymentMethodDataPix(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataQris(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class ConfirmParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntent.ConfirmParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class ConfirmParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str + """ + IBAN of the bank account. + """ + + class ConfirmParamsPaymentMethodDataShopeepay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + + class ConfirmParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] + """ + Account holder type: individual or company. + """ + account_number: NotRequired[str] + """ + Account number of the bank account. + """ + account_type: NotRequired[Literal["checking", "savings"]] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + financial_connections_account: NotRequired[str] + """ + The ID of a Financial Connections Account to use as a payment method. + """ + routing_number: NotRequired[str] + """ + Routing number of the bank account. + """ + + class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataZip(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit" + ] + """ + If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + """ + affirm: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + """ + afterpay_clearpay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + """ + alipay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlipay" + ] + """ + If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + """ + alma: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ + au_becs_debit: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit" + ] + """ + If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + """ + bacs_debit: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + """ + bancontact: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + """ + billie: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ + blik: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBlik" + ] + """ + If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + """ + boleto: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + """ + card: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCard" + ] + """ + Configuration for any card payments attempted on this PaymentIntent. + """ + card_present: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + """ + cashapp: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + """ + customer_balance: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalance" + ] + """ + If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + """ + eps: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsEps" + ] + """ + If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + """ + fpx: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsFpx" + ] + """ + If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + """ + giropay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + """ + gopay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGopay" + ] + """ + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. + """ + grabpay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ + ideal: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdeal" + ] + """ + If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + """ + interac_present: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsInteracPresent" + ] + """ + If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ + klarna: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + """ + konbini: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + """ + kr_card: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ + link: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsLink" + ] + """ + If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + """ + mb_way: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMbWay" + ] + """ + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. + """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ + multibanco: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ + oxxo: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" + ] + """ + If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + """ + p24: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsP24" + ] + """ + If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ + payco: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ + paynow: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + """ + paypal: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + """ + payto: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. + """ + pix: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPix" + ] + """ + If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + """ + promptpay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + """ + qris: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsQris" + ] + """ + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. + """ + rechnung: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. + """ + revolut_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay" + ] + """ + If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ + satispay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + """ + sepa_debit: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + """ + shopeepay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsShopeepay" + ] + """ + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. + """ + sofort: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSofort" + ] + """ + If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + """ + stripe_balance: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsStripeBalance" + ] + """ + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. + """ + swish: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ + twint: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ + us_bank_account: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" + ] + """ + If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + """ + wechat_pay: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsWechatPay" + ] + """ + If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + """ + zip: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsZip" + ] + """ + If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + """ + + class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[str] + """ + Preferred language of the Affirm authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + This field differs from the statement descriptor and item name. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ + + class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + cvc_token: NotRequired[str] + """ + A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + """ + installments: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallments" + ] + """ + Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + + For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + """ + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" + ] + """ + Configuration options for setting up an eMandate for cards issued in India. + """ + moto: NotRequired[bool] + """ + When specified, this parameter indicates that a transaction will be marked + as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + parameter can only be provided during confirmation. + """ + network: NotRequired[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "girocard", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + ] + """ + Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + """ + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + """ + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + """ + request_multicapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + """ + request_overcapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + """ + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ + request_three_d_secure: NotRequired[ + Literal["any", "automatic", "challenge"] + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ + require_cvc_recollection: NotRequired[bool] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + """ + statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + """ + statement_details: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardStatementDetails" + ] + """ + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. + """ + three_d_secure: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): + enabled: NotRequired[bool] + """ + Setting to true enables installments for this PaymentIntent. + This will cause the response to contain a list of available installment plans. + Setting to false will prevent any selected plan from applying to a charge. + """ + plan: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" + ] + """ + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. + """ + + class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] + """ + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + """ + interval: NotRequired[Literal["month"]] + """ + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + One of `month`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + + class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): + amount: int + """ + Amount to be charged for future payments. + """ + amount_type: Literal["fixed", "maximum"] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + """ + interval: Literal["day", "month", "sporadic", "week", "year"] + """ + Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + """ + reference: str + """ + Unique identifier for the mandate or subscription. + """ + start_date: int + """ + Start date of the mandate or subscription. Start date should not be lesser than yesterday. + """ + supported_types: NotRequired[List[Literal["india"]]] + """ + Specifies the type of mandates supported. Possible values are `india`. + """ + + class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): + request_extended_authorization: NotRequired[bool] + """ + Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + """ + request_incremental_authorization_support: NotRequired[bool] + """ + Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + """ + routing: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ + + class ConfirmParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardStatementDetailsAddress" + ] + """ + Please pass in an address that is within your Stripe user account country + """ + phone: NotRequired[str] + """ + Phone number (e.g., a toll-free number that customers can call) + """ + + class ConfirmParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + Literal["A", "C", "I", "N", "R", "U", "Y"] + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired[str] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired[str] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired[int] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ + + class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): + bank_transfer: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class ConfirmParamsPaymentMethodOptionsEps(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsGopay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): + confirmation_number: NotRequired["Literal['']|str"] + """ + An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + """ + expires_after_days: NotRequired["Literal['']|int"] + """ + The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + """ + expires_at: NotRequired["Literal['']|int"] + """ + The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + """ + product_description: NotRequired["Literal['']|str"] + """ + A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ConfirmParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class ConfirmParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class ConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + + class ConfirmParamsPaymentMethodOptionsPix(TypedDict): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ + expires_at: NotRequired[int] + """ + The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsRechnung(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsSatispay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class ConfirmParamsPaymentMethodOptionsShopeepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + A reference for this payment to be displayed in the Swish app. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): + financial_connections: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" + ] + """ + Additional fields for Financial Connections Session creation + """ + mandate_options: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + networks: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" + ] + """ + Additional fields for network related functions + """ + preferred_settlement_speed: NotRequired[ + "Literal['']|Literal['fastest', 'standard']" + ] + """ + Preferred transaction settlement speed + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( + TypedDict, + ): + filters: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ + manual_entry: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ + permissions: NotRequired[ + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] + ] + """ + The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + """ + prefetch: NotRequired[ + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] + ] + """ + List of data features that you would like to retrieve upon account creation. + """ + return_url: NotRequired[str] + """ + For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( + TypedDict, + ): + collection_method: NotRequired["Literal['']|Literal['paper']"] + """ + The method used to collect offline mandate customer acceptance. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + """ + Triggers validations to run across the selected networks + """ + + class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsZip(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class ConfirmParamsShipping(TypedDict): + address: "PaymentIntent.ConfirmParamsShippingAddress" + """ + Shipping address. + """ + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + + class ConfirmParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParams(RequestOptions): + amount: int + """ + Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + automatic_payment_methods: NotRequired[ + "PaymentIntent.CreateParamsAutomaticPaymentMethods" + ] + """ + When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + """ + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + confirm: NotRequired[bool] + """ + Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + """ + confirmation_method: NotRequired[Literal["automatic", "manual"]] + """ + Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + """ + confirmation_token: NotRequired[str] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + ID of the Customer this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Customers cannot be used with this PaymentIntent. + + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + """ + customer_account: NotRequired[str] + """ + ID of the Account this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Accounts cannot be used with this PaymentIntent. + + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + error_on_requires_action: NotRequired[bool] + """ + Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fx_quote: NotRequired[str] + """ + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. + """ + hooks: NotRequired["PaymentIntent.CreateParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ + mandate: NotRequired[str] + """ + ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + mandate_data: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsMandateData" + ] + """ + This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + off_session: NotRequired["bool|Literal['one_off', 'recurring']"] + """ + Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + payment_details: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ + payment_method: NotRequired[str] + """ + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. + + If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. + If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent. + end + """ + payment_method_configuration: NotRequired[str] + """ + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + """ + payment_method_data: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodData" + ] + """ + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. + """ + payment_method_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptions" + ] + """ + Payment method-specific configuration for this PaymentIntent. + """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + """ + radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] + """ + Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + """ + receipt_email: NotRequired[str] + """ + Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + """ + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + secret_key_confirmation: NotRequired[Literal["optional", "required"]] + """ + Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + """ + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + shipping: NotRequired["PaymentIntent.CreateParamsShipping"] + """ + Shipping information for this PaymentIntent. + """ + statement_descriptor: NotRequired[str] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + """ + transfer_data: NotRequired["PaymentIntent.CreateParamsTransferData"] + """ + The parameters that you can use to automatically create a Transfer. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + transfer_group: NotRequired[str] + """ + A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + """ + use_stripe_sdk: NotRequired[bool] + """ + Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + """ + + class CreateParamsAutomaticPaymentMethods(TypedDict): + allow_redirects: NotRequired[Literal["always", "never"]] + """ + Controls whether this PaymentIntent will accept redirect-based payment methods. + + Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + """ + enabled: bool + """ + Whether this feature is enabled. + """ + + class CreateParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntent.CreateParamsHooksInputs"] + """ + Arguments passed in automations + """ + + class CreateParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntent.CreateParamsHooksInputsTax"] + """ + Tax arguments for automations + """ + + class CreateParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ + + class CreateParamsMandateData(TypedDict): + customer_acceptance: ( + "PaymentIntent.CreateParamsMandateDataCustomerAcceptance" + ) + """ + This hash contains details about the customer acceptance of the Mandate. + """ + + class CreateParamsMandateDataCustomerAcceptance(TypedDict): + accepted_at: NotRequired[int] + """ + The time at which the customer accepted the Mandate. + """ + offline: NotRequired[ + "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOffline" + ] + """ + If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + """ + online: NotRequired[ + "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOnline" + ] + """ + If this is a Mandate accepted online, this hash contains details about the online acceptance. + """ + type: Literal["offline", "online"] + """ + The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + """ + + class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): + pass + + class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: str + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: str + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ + + class CreateParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRental" + ] + """ + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["PaymentIntent.CreateParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired["PaymentIntent.CreateParamsPaymentDetailsLodging"] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent + """ + + class CreateParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List["PaymentIntent.CreateParamsPaymentDetailsCarRentalDriver"] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalPickupAddress" + ] + """ + Car pick-up address. + """ + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: NotRequired[str] + """ + Name of the pickup location. + """ + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. + """ + + class CreateParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] + """ + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ + + class CreateParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ + + class CreateParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] + """ + Indicates if the tickets are digitally checked when entering the venue. + """ + address: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetailsAddress" + ] + """ + The event location's address. + """ + affiliate: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetailsAffiliate" + ] + """ + Affiliate details for this purchase. + """ + company: NotRequired[str] + """ + The name of the company + """ + delivery: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. + """ + + class CreateParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsFlightAffiliate" + ] + """ + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List["PaymentIntent.CreateParamsPaymentDetailsFlightPassenger"] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List["PaymentIntent.CreateParamsPaymentDetailsFlightSegment"] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. + """ + + class CreateParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class CreateParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class CreateParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsLodgingAddress" + ] + """ + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List["PaymentIntent.CreateParamsPaymentDetailsLodgingPassenger"] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class CreateParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class CreateParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "PaymentIntent.CreateParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class CreateParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + class CreateParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAcssDebit" + ] + """ + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + """ + afterpay_clearpay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAfterpayClearpay" + ] + """ + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + """ + alipay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAlipay" + ] + """ + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ + alma: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataAlma"] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ + amazon_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ + au_becs_debit: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataAuBecsDebit" + ] + """ + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + """ + bacs_debit: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + """ + bancontact: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + """ + billie: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + """ + billing_details: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + blik: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ + boleto: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + """ + cashapp: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + """ + customer_balance: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataCustomerBalance" + ] + """ + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + """ + eps: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataEps"] + """ + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + """ + fpx: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataFpx"] + """ + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ - - class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + giropay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataGiropay" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ - - class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + gopay: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataGopay"] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + grabpay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataGrabpay" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ - - class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + id_bank_transfer: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataIdBankTransfer" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] - ] + ideal: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataIdeal"] """ - Preferred language of the Klarna authorization page that the customer is redirected to + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + interac_present: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataInteracPresent" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ - - class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): - confirmation_number: NotRequired["Literal['']|str"] + kakao_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKakaoPay" + ] """ - An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. """ - expires_after_days: NotRequired["Literal['']|int"] + klarna: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKlarna" + ] """ - The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ - expires_at: NotRequired["Literal['']|int"] + konbini: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKonbini" + ] """ - The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ - product_description: NotRequired["Literal['']|str"] + kr_card: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKrCard" + ] """ - A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + link: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataLink"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - - class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + mb_way: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataMbWay"] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + metadata: NotRequired[Dict[str, str]] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - - class ConfirmParamsPaymentMethodOptionsLink(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + mobilepay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataMobilepay" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ - persistent_token: NotRequired[str] + multibanco: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataMultibanco" + ] """ - [Deprecated] This is a legacy parameter that no longer has any function. + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + naver_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataNaverPay" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + nz_bank_account: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataNzBankAccount" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ - - class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + p24: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataP24"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ - - class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + pay_by_bank: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPayByBank" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + payco: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayco"] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ + paynow: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPaynow" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ - - class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + paypal: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPaypal" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ - target_date: NotRequired[str] + payto: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayto"] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. """ - - class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired[int] + pix: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPix"] """ - The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + promptpay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPromptpay" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ - - class ConfirmParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + qris: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataQris"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. """ - tos_shown_and_accepted: NotRequired[bool] + radar_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataRadarOptions" + ] """ - Confirm that the payer has accepted the P24 terms and conditions. + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ - - class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + rechnung: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataRechnung" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. """ - - class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + revolut_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataRevolutPay" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + samsung_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSamsungPay" + ] """ - Controls when the funds will be captured from the customer's account. + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + satispay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSatispay" ] """ - [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. """ - reference: NotRequired[str] + sepa_debit: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSepaDebit" + ] """ - A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - risk_correlation_id: NotRequired[str] + shopeepay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataShopeepay" + ] """ - The risk correlation ID for an on-session payment using a saved PayPal payment method. + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + sofort: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataSofort" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ - - class ConfirmParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired[int] + stripe_balance: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataStripeBalance" + ] """ - The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + This hash contains details about the Stripe balance payment method. """ - expires_at: NotRequired[int] + swish: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataSwish"] """ - The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + twint: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataTwint"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - - class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "sepa_debit", + "shopeepay", + "sofort", + "stripe_balance", + "swish", + "twint", + "us_bank_account", + "wechat_pay", + "zip", + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ - - class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + us_bank_account: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataUsBankAccount" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + wechat_pay: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataWechatPay" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + zip: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataZip"] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ - class ConfirmParamsPaymentMethodOptionsSatispay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class CreateParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Customer's bank account number. """ - - class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" - ] + institution_number: str """ - Additional fields for Mandate creation + Institution number of the customer's bank. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + transit_number: str + """ + Transit number of the customer's bank. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class CreateParamsPaymentMethodDataAffirm(TypedDict): + pass - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentMethodDataAlipay(TypedDict): + pass - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. - """ - target_date: NotRequired[str] + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + The account number for the bank account. """ - - class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + bsb_number: str """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + Bank-State-Branch number of the bank account. """ - class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): - preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" - ] + class CreateParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired[str] """ - Language shown to the payer on redirect. + Account number of the bank account that the funds will be debited from. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + sort_code: NotRequired[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class CreateParamsPaymentMethodDataBancontact(TypedDict): + pass - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" + ] """ - - class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] + Billing address. """ - A reference for this payment to be displayed in the Swish app. + email: NotRequired["Literal['']|str"] """ - setup_future_usage: NotRequired[Literal["none"]] + Email address. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + name: NotRequired["Literal['']|str"] """ - - class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + Full name. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + tax_id: NotRequired[str] + """ + Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. """ - class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): - financial_connections: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" - ] + class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + city: NotRequired[str] """ - Additional fields for Financial Connections Session creation + City, district, suburb, town, or village. """ - mandate_options: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" - ] + country: NotRequired[str] """ - Additional fields for Mandate creation + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - networks: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" - ] + line1: NotRequired[str] """ - Additional fields for network related functions + Address line 1 (e.g., street, PO Box, or company name). """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] + line2: NotRequired[str] """ - Preferred transaction settlement speed + Address line 2 (e.g., apartment, suite, unit, or building). """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class CreateParamsPaymentMethodDataBlik(TypedDict): + pass - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class CreateParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str + """ + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentMethodDataCashapp(TypedDict): + pass - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class CreateParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] """ - target_date: NotRequired[str] + The customer's bank. """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + + class CreateParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + Account holder type for FPX transaction + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", ] """ - Bank account verification method. + The customer's bank. """ - class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( - TypedDict, - ): - filters: NotRequired[ - "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" - ] + class CreateParamsPaymentMethodDataGiropay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] """ - Provide filters for the linked accounts that the customer can select for the payment method. + Bank where the account is held. """ - permissions: NotRequired[ - List[ - Literal[ - "balances", "ownership", "payment_method", "transactions" - ] + + class CreateParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", ] ] """ - The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - """ - prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] - ] - """ - List of data features that you would like to retrieve upon account creation. - """ - return_url: NotRequired[str] - """ - For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ - class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( - TypedDict, - ): - account_subcategories: NotRequired[ - List[Literal["checking", "savings"]] - ] - """ - The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. - """ + class CreateParamsPaymentMethodDataInteracPresent(TypedDict): + pass - class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( - TypedDict, - ): - collection_method: NotRequired["Literal['']|Literal['paper']"] - """ - The method used to collect offline mandate customer acceptance. - """ + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass - class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + class CreateParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataKlarnaDob" + ] """ - Triggers validations to run across the selected networks + Customer's date of birth """ - class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired[str] + class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The day of birth, between 1 and 31. """ - client: NotRequired[Literal["android", "ios", "web"]] + month: int """ - The client type that the end customer will pay from + The month of birth, between 1 and 12. """ - setup_future_usage: NotRequired[Literal["none"]] + year: int """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The four-digit year of birth. """ - class ConfirmParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] - """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. + class CreateParamsPaymentMethodDataKonbini(TypedDict): + pass - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class CreateParamsPaymentMethodDataLink(TypedDict): + pass - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. - """ + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass - class ConfirmParamsRadarOptions(TypedDict): - session: NotRequired[str] - """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - """ + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass - class ConfirmParamsShipping(TypedDict): - address: "PaymentIntent.ConfirmParamsShippingAddress" - """ - Shipping address. - """ - carrier: NotRequired[str] - """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - """ - name: str - """ - Recipient name. - """ - phone: NotRequired[str] - """ - Recipient phone (including extension). - """ - tracking_number: NotRequired[str] + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ - class ConfirmParamsShippingAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. - """ - country: NotRequired[str] + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. """ - line1: NotRequired[str] + account_number: str """ - Address line 1 (e.g., street, PO Box, or company name). + The account number for the bank account. """ - line2: NotRequired[str] + bank_code: str """ - Address line 2 (e.g., apartment, suite, unit, or building). + The numeric code for the bank account's bank. """ - postal_code: NotRequired[str] + branch_code: str """ - ZIP or postal code. + The numeric code for the bank account's bank branch. """ - state: NotRequired[str] + reference: NotRequired[str] + suffix: str """ - State, county, province, or region. + The suffix of the bank account number. """ - class CreateParams(RequestOptions): - amount: int - """ - Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + class CreateParamsPaymentMethodDataOxxo(TypedDict): + pass + + class CreateParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] """ - application_fee_amount: NotRequired[int] + The customer's bank. """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaynow(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaypal(TypedDict): + pass + + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] """ - automatic_payment_methods: NotRequired[ - "PaymentIntent.CreateParamsAutomaticPaymentMethods" - ] + The account number for the bank account. """ - When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + bsb_number: NotRequired[str] """ - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] - ] + Bank-State-Branch number of the bank account. """ - Controls when the funds will be captured from the customer's account. + pay_id: NotRequired[str] """ - confirm: NotRequired[bool] + The PayID alias for the bank account. """ - Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + + class CreateParamsPaymentMethodDataPix(TypedDict): + pass + + class CreateParamsPaymentMethodDataPromptpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired[str] """ - confirmation_method: NotRequired[Literal["automatic", "manual"]] + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ - Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntent.CreateParamsPaymentMethodDataRechnungDob" """ - confirmation_token: NotRequired[str] + Customer's date of birth """ - ID of the ConfirmationToken used to confirm this PaymentIntent. - If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int """ - currency: str + The day of birth, between 1 and 31. """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + month: int """ - customer: NotRequired[str] + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. """ - ID of the Customer this PaymentIntent belongs to, if one exists. - Payment methods attached to other Customers cannot be used with this PaymentIntent. + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): + pass - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str """ - description: NotRequired[str] + IBAN of the bank account. """ - An arbitrary string attached to the object. Often useful for displaying to users. + + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ - error_on_requires_action: NotRequired[bool] + Two-letter ISO code representing the country the bank account is located in. """ - Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] """ - expand: NotRequired[List[str]] + The connected account ID whose Stripe balance to use as the source of payment """ - Specifies which fields in the response should be expanded. + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ - mandate: NotRequired[str] + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance """ - ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] """ - mandate_data: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsMandateData" - ] + Account holder type: individual or company. """ - This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + account_number: NotRequired[str] """ - metadata: NotRequired[Dict[str, str]] + Account number of the bank account. """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + account_type: NotRequired[Literal["checking", "savings"]] """ - off_session: NotRequired["bool|Literal['one_off', 'recurring']"] + Account type: checkings or savings. Defaults to checking if omitted. """ - Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + financial_connections_account: NotRequired[str] """ - on_behalf_of: NotRequired[str] + The ID of a Financial Connections Account to use as a payment method. """ - The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + routing_number: NotRequired[str] """ - payment_method: NotRequired[str] + Routing number of the bank account. """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. - If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. - If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent. - end - """ - payment_method_configuration: NotRequired[str] - """ - The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. - """ - payment_method_data: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodData" + class CreateParamsPaymentMethodDataWechatPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataZip(TypedDict): + pass + + class CreateParamsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit" ] """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ - payment_method_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptions" + affirm: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAffirm" ] """ - Payment method-specific configuration for this PaymentIntent. + If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ - payment_method_types: NotRequired[List[str]] + afterpay_clearpay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAfterpayClearpay" + ] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ - radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] + alipay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlipay" + ] """ - Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ - receipt_email: NotRequired[str] + alma: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlma" + ] """ - Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. """ - return_url: NotRequired[str] + amazon_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAmazonPay" + ] """ - The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + au_becs_debit: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ - shipping: NotRequired["PaymentIntent.CreateParamsShipping"] + bacs_debit: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit" + ] """ - Shipping information for this PaymentIntent. + If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ - statement_descriptor: NotRequired[str] + bancontact: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBancontact" + ] """ - Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - - Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ - statement_descriptor_suffix: NotRequired[str] + billie: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBillie" + ] """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. """ - transfer_data: NotRequired["PaymentIntent.CreateParamsTransferData"] + blik: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBlik" + ] """ - The parameters that you can use to automatically create a Transfer. - Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ - transfer_group: NotRequired[str] + boleto: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBoleto" + ] """ - A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ - use_stripe_sdk: NotRequired[bool] + card: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCard" + ] """ - Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + Configuration for any card payments attempted on this PaymentIntent. """ - - class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired[Literal["always", "never"]] + card_present: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent" + ] """ - Controls whether this PaymentIntent will accept redirect-based payment methods. - - Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ - enabled: bool + cashapp: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCashapp" + ] """ - Whether this feature is enabled. + If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ - - class CreateParamsMandateData(TypedDict): - customer_acceptance: ( - "PaymentIntent.CreateParamsMandateDataCustomerAcceptance" - ) + customer_balance: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalance" + ] """ - This hash contains details about the customer acceptance of the Mandate. + If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ - - class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired[int] + eps: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsEps" + ] """ - The time at which the customer accepted the Mandate. + If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ - offline: NotRequired[ - "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOffline" + fpx: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsFpx" ] """ - If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ - online: NotRequired[ - "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOnline" + giropay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGiropay" ] """ - If this is a Mandate accepted online, this hash contains details about the online acceptance. + If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ - type: Literal["offline", "online"] + gopay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGopay" + ] """ - The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. """ - - class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): - pass - - class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: str + grabpay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGrabpay" + ] """ - The IP address from which the Mandate was accepted by the customer. + If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ - user_agent: str + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdBankTransfer" + ] """ - The user agent of the browser from which the Mandate was accepted by the customer. + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. """ - - class CreateParamsPaymentMethodData(TypedDict): - acss_debit: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAcssDebit" + ideal: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdeal" ] """ - If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ - affirm: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAffirm" + interac_present: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsInteracPresent" ] """ - If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ - afterpay_clearpay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAfterpayClearpay" + kakao_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKakaoPay" ] """ - If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. """ - alipay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAlipay" + klarna: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKlarna" ] """ - If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ - allow_redisplay: NotRequired[ - Literal["always", "limited", "unspecified"] + konbini: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKonbini" ] """ - This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ - alma: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataAlma"] + kr_card: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKrCard" + ] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. """ - amazon_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" + link: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsLink" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ - au_becs_debit: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataAuBecsDebit" + mb_way: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMbWay" ] """ - If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. """ - bacs_debit: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataBacsDebit" + mobilepay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMobilepay" ] """ - If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ - bancontact: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataBancontact" + multibanco: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMultibanco" ] """ - If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ - billie: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataBillie" + naver_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNaverPay" ] """ - If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ - billing_details: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataBillingDetails" + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNzBankAccount" ] """ - Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. """ - blik: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataBlik"] + oxxo: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" + ] """ - If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ - boleto: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataBoleto" + p24: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsP24" ] """ - If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ - cashapp: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataCashapp" + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayByBank" ] """ - If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. """ - customer_balance: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataCustomerBalance" + payco: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayco" ] """ - If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. """ - eps: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataEps"] + paynow: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaynow" + ] """ - If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ - fpx: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataFpx"] + paypal: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaypal" + ] """ - If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ - giropay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataGiropay" + payto: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayto" ] """ - If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. """ - grabpay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataGrabpay" + pix: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPix" ] """ - If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ - ideal: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataIdeal"] + promptpay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPromptpay" + ] """ - If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ - interac_present: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataInteracPresent" + qris: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsQris" ] """ - If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. """ - kakao_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataKakaoPay" + rechnung: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsRechnung" ] """ - If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. """ - klarna: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataKlarna" + revolut_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay" ] """ - If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ - konbini: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataKonbini" + samsung_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSamsungPay" ] """ - If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. """ - kr_card: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataKrCard" + satispay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSatispay" ] """ - If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. """ - link: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataLink"] + sepa_debit: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit" + ] """ - If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ - metadata: NotRequired[Dict[str, str]] + shopeepay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsShopeepay" + ] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. """ - mobilepay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataMobilepay" + sofort: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSofort" ] """ - If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ - multibanco: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataMultibanco" + stripe_balance: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsStripeBalance" ] """ - If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ - naver_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataNaverPay" + swish: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSwish" ] """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ - nz_bank_account: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataNzBankAccount" + twint: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsTwint" ] """ - If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ - oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] + us_bank_account: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount" + ] """ - If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ - p24: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataP24"] + wechat_pay: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsWechatPay" + ] """ - If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ - pay_by_bank: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataPayByBank" + zip: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsZip" ] """ - If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ - payco: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayco"] + + class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" + ] """ - If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + Additional fields for Mandate creation """ - paynow: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataPaynow" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ - If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - paypal: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataPaypal" + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] ] """ - If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + Bank account verification method. """ - pix: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPix"] + + class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): + custom_mandate_url: NotRequired["Literal['']|str"] """ - If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - promptpay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataPromptpay" - ] + interval_description: NotRequired[str] """ - If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - radar_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataRadarOptions" + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] ] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + Payment schedule for the mandate. """ - revolut_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataRevolutPay" - ] + transaction_type: NotRequired[Literal["business", "personal"]] """ - If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + Transaction type of the mandate. """ - samsung_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataSamsungPay" - ] + + class CreateParamsPaymentMethodOptionsAffirm(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - satispay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataSatispay" - ] + preferred_locale: NotRequired[str] """ - If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + Preferred language of the Affirm authorization page that the customer is redirected to. """ - sepa_debit: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataSepaDebit" - ] + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - sofort: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataSofort" - ] + + class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - swish: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataSwish"] + reference: NotRequired[str] """ - If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + This field differs from the statement descriptor and item name. """ - twint: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataTwint"] + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "blik", - "boleto", - "cashapp", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "sepa_debit", - "sofort", - "swish", - "twint", - "us_bank_account", - "wechat_pay", - "zip", + + class CreateParamsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - us_bank_account: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataUsBankAccount" - ] + + class CreateParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - wechat_pay: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataWechatPay" - ] + + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - zip: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataZip"] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ - If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - class CreateParamsPaymentMethodDataAcssDebit(TypedDict): - account_number: str + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ - Customer's bank account number. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - institution_number: str + target_date: NotRequired[str] """ - Institution number of the customer's bank. + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - transit_number: str + + class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] """ - Transit number of the customer's bank. + Additional fields for Mandate creation """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataAffirm(TypedDict): - pass - - class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): - pass - - class CreateParamsPaymentMethodDataAlipay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataAlma(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataAmazonPay(TypedDict): - pass + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): - account_number: str - """ - The account number for the bank account. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - bsb_number: str + target_date: NotRequired[str] """ - Bank-State-Branch number of the bank account. + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired[str] + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] """ - Account number of the bank account that the funds will be debited from. + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. """ - sort_code: NotRequired[str] + + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ - Sort code of the bank account. (e.g., `10-20-30`) + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataBancontact(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataBillie(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataBillingDetails(TypedDict): - address: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" - ] - """ - Billing address. - """ - email: NotRequired["Literal['']|str"] - """ - Email address. + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - name: NotRequired["Literal['']|str"] + + class CreateParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Full name. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - phone: NotRequired["Literal['']|str"] + + class CreateParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] """ - Billing phone number (including extension). + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ - tax_id: NotRequired[str] + setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ - Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired[str] + class CreateParamsPaymentMethodOptionsBoleto(TypedDict): + expires_after_days: NotRequired[int] """ - City, district, suburb, town, or village. + The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ - country: NotRequired[str] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - line1: NotRequired[str] + + class CreateParamsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Address line 1 (e.g., street, PO Box, or company name). + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - line2: NotRequired[str] + cvc_token: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ - postal_code: NotRequired[str] + installments: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallments" + ] """ - ZIP or postal code. + Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + + For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ - state: NotRequired[str] + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" + ] """ - State, county, province, or region. + Configuration options for setting up an eMandate for cards issued in India. """ - - class CreateParamsPaymentMethodDataBlik(TypedDict): - pass - - class CreateParamsPaymentMethodDataBoleto(TypedDict): - tax_id: str + moto: NotRequired[bool] """ - The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + When specified, this parameter indicates that a transaction will be marked + as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + parameter can only be provided during confirmation. """ - - class CreateParamsPaymentMethodDataCashapp(TypedDict): - pass - - class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): - pass - - class CreateParamsPaymentMethodDataEps(TypedDict): - bank: NotRequired[ + network: NotRequired[ Literal[ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau", + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "girocard", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", ] ] """ - The customer's bank. + Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ - - class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] """ - Account holder type for FPX transaction + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. """ - bank: Literal[ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob", + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - The customer's bank. + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ - - class CreateParamsPaymentMethodDataGiropay(TypedDict): - pass - - class CreateParamsPaymentMethodDataGrabpay(TypedDict): - pass - - class CreateParamsPaymentMethodDataIdeal(TypedDict): - bank: NotRequired[ - Literal[ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "n26", - "nn", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot", - "yoursafe", - ] + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - - class CreateParamsPaymentMethodDataInteracPresent(TypedDict): - pass - - class CreateParamsPaymentMethodDataKakaoPay(TypedDict): - pass - - class CreateParamsPaymentMethodDataKlarna(TypedDict): - dob: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodDataKlarnaDob" - ] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ - Customer's date of birth + Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - - class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): - day: int + request_overcapture: NotRequired[Literal["if_available", "never"]] """ - The day of birth, between 1 and 31. + Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ - month: int + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] """ - The month of birth, between 1 and 12. + Request partial authorization on this PaymentIntent. """ - year: int + request_three_d_secure: NotRequired[ + Literal["any", "automatic", "challenge"] + ] """ - The four-digit year of birth. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + require_cvc_recollection: NotRequired[bool] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataKonbini(TypedDict): - pass - - class CreateParamsPaymentMethodDataKrCard(TypedDict): - pass - - class CreateParamsPaymentMethodDataLink(TypedDict): - pass - - class CreateParamsPaymentMethodDataMobilepay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataMultibanco(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] - """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. - """ + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): - account_holder_name: NotRequired[str] - """ - The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - account_number: str + statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ - The account number for the bank account. + Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ - bank_code: str + statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ - The numeric code for the bank account's bank. + Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ - branch_code: str + statement_details: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardStatementDetails" + ] """ - The numeric code for the bank account's bank branch. + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ - reference: NotRequired[str] - suffix: str + three_d_secure: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] """ - The suffix of the bank account number. + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. """ - class CreateParamsPaymentMethodDataOxxo(TypedDict): - pass - - class CreateParamsPaymentMethodDataP24(TypedDict): - bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): + enabled: NotRequired[bool] + """ + Setting to true enables installments for this PaymentIntent. + This will cause the response to contain a list of available installment plans. + Setting to false will prevent any selected plan from applying to a charge. + """ + plan: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ - The customer's bank. + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. """ - class CreateParamsPaymentMethodDataPayByBank(TypedDict): - pass - - class CreateParamsPaymentMethodDataPayco(TypedDict): - pass - - class CreateParamsPaymentMethodDataPaynow(TypedDict): - pass - - class CreateParamsPaymentMethodDataPaypal(TypedDict): - pass - - class CreateParamsPaymentMethodDataPix(TypedDict): - pass - - class CreateParamsPaymentMethodDataPromptpay(TypedDict): - pass - - class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired[str] + class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - - class CreateParamsPaymentMethodDataRevolutPay(TypedDict): - pass - - class CreateParamsPaymentMethodDataSamsungPay(TypedDict): - pass - - class CreateParamsPaymentMethodDataSatispay(TypedDict): - pass - - class CreateParamsPaymentMethodDataSepaDebit(TypedDict): - iban: str + interval: NotRequired[Literal["month"]] """ - IBAN of the bank account. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + One of `month`. """ - - class CreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + type: Literal["fixed_count"] """ - Two-letter ISO code representing the country the bank account is located in. + Type of installment plan, one of `fixed_count`. """ - class CreateParamsPaymentMethodDataSwish(TypedDict): - pass - - class CreateParamsPaymentMethodDataTwint(TypedDict): - pass - - class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): + amount: int """ - Account holder type: individual or company. + Amount to be charged for future payments. """ - account_number: NotRequired[str] + amount_type: Literal["fixed", "maximum"] """ - Account number of the bank account. + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ - account_type: NotRequired[Literal["checking", "savings"]] + description: NotRequired[str] """ - Account type: checkings or savings. Defaults to checking if omitted. + A description of the mandate or subscription that is meant to be displayed to the customer. """ - financial_connections_account: NotRequired[str] + end_date: NotRequired[int] """ - The ID of a Financial Connections Account to use as a payment method. + End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ - routing_number: NotRequired[str] + interval: Literal["day", "month", "sporadic", "week", "year"] """ - Routing number of the bank account. + Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - - class CreateParamsPaymentMethodDataWechatPay(TypedDict): - pass - - class CreateParamsPaymentMethodDataZip(TypedDict): - pass - - class CreateParamsPaymentMethodOptions(TypedDict): - acss_debit: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit" - ] + interval_count: NotRequired[int] """ - If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ - affirm: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAffirm" - ] + reference: str """ - If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + Unique identifier for the mandate or subscription. """ - afterpay_clearpay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAfterpayClearpay" - ] + start_date: int """ - If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - alipay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlipay" - ] + supported_types: NotRequired[List[Literal["india"]]] """ - If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + Specifies the type of mandates supported. Possible values are `india`. """ - alma: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlma" - ] + + class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): + request_extended_authorization: NotRequired[bool] """ - If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - amazon_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAmazonPay" - ] + request_incremental_authorization_support: NotRequired[bool] """ - If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - au_becs_debit: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit" + routing: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardPresentRouting" ] """ - If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ - bacs_debit: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit" - ] + + class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] """ - If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + Routing requested priority """ - bancontact: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBancontact" + + class CreateParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardStatementDetailsAddress" ] """ - If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + Please pass in an address that is within your Stripe user account country """ - billie: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBillie" - ] + phone: NotRequired[str] """ - If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + Phone number (e.g., a toll-free number that customers can call) """ - blik: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBlik" - ] + + class CreateParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] """ - If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + City, district, suburb, town, or village. """ - boleto: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBoleto" - ] + country: NotRequired[str] """ - If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - card: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCard" - ] + line1: NotRequired[str] """ - Configuration for any card payments attempted on this PaymentIntent. + Address line 1 (e.g., street, PO Box, or company name). """ - card_present: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent" - ] + line2: NotRequired[str] """ - If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + Address line 2 (e.g., apartment, suite, unit, or building). """ - cashapp: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCashapp" - ] + postal_code: NotRequired[str] """ - If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + ZIP or postal code. """ - customer_balance: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalance" - ] + state: NotRequired[str] """ - If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + State, county, province, or region. """ - eps: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsEps" + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ - If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + The `transStatus` returned from the card Issuer's ACS in the ARes. """ - fpx: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsFpx" - ] + cryptogram: str """ - If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) """ - giropay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGiropay" + electronic_commerce_indicator: NotRequired[ + Literal["01", "02", "05", "06", "07"] ] """ - If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. """ - grabpay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGrabpay" - ] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ - If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + The exemption requested via 3DS and accepted by the issuer at authentication time. """ - ideal: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdeal" + network_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ - If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly """ - interac_present: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsInteracPresent" - ] + requestor_challenge_indicator: NotRequired[str] """ - If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - kakao_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKakaoPay" - ] + transaction_id: str """ - If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). """ - klarna: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKlarna" - ] + version: Literal["1.0.2", "2.1.0", "2.2.0"] """ - If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + The version of 3D Secure that was performed. """ - konbini: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKonbini" + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ - If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + Cartes Bancaires-specific 3DS fields. """ - kr_card: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKrCard" - ] + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ - If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO """ - link: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsLink" - ] + cb_exemption: NotRequired[str] """ - If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded """ - mobilepay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMobilepay" - ] + cb_score: NotRequired[int] """ - If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 """ - multibanco: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMultibanco" - ] + + class CreateParamsPaymentMethodOptionsCashapp(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - naver_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNaverPay" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ - If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - nz_bank_account: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsNzBankAccount" + + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): + bank_transfer: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ - If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - oxxo: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" - ] + funding_type: NotRequired[Literal["bank_transfer"]] """ - If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ - p24: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsP24" - ] + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - pay_by_bank: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayByBank" + + class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ - If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + Configuration for the eu_bank_transfer funding type. """ - payco: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayco" + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] ] """ - If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - paynow: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaynow" + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", ] """ - If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ - paypal: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaypal" - ] + + class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str """ - If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ - pix: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPix" - ] + + class CreateParamsPaymentMethodOptionsEps(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - promptpay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPromptpay" - ] + + class CreateParamsPaymentMethodOptionsFpx(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - revolut_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay" - ] + + class CreateParamsPaymentMethodOptionsGiropay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - samsung_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSamsungPay" - ] + + class CreateParamsPaymentMethodOptionsGopay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - satispay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSatispay" - ] + + class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - sepa_debit: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit" - ] + + class CreateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] """ - If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. """ - sofort: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSofort" - ] + expires_at: NotRequired[int] """ - If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. """ - swish: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSwish" - ] + setup_future_usage: NotRequired[Literal["none"]] """ - If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - twint: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsTwint" + + class CreateParamsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - us_bank_account: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount" - ] + + class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - wechat_pay: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsWechatPay" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - """ - zip: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsZip" - ] + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ + Controls when the funds are captured from the customer's account. - class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] ] """ - Additional fields for Mandate creation + Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6546,40 +10973,38 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] - """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. - """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + + class CreateParamsPaymentMethodOptionsKonbini(TypedDict): + confirmation_number: NotRequired["Literal['']|str"] """ - Bank account verification method. + An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ - - class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): - custom_mandate_url: NotRequired["Literal['']|str"] + expires_after_days: NotRequired["Literal['']|int"] """ - A URL for custom mandate text to render during confirmation step. - The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ - interval_description: NotRequired[str] + expires_at: NotRequired["Literal['']|int"] """ - Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ - payment_schedule: NotRequired[ - Literal["combined", "interval", "sporadic"] - ] + product_description: NotRequired["Literal['']|str"] """ - Payment schedule for the mandate. + A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ - transaction_type: NotRequired[Literal["business", "personal"]] + setup_future_usage: NotRequired[Literal["none"]] """ - Transaction type of the mandate. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAffirm(TypedDict): + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -6588,11 +11013,9 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - preferred_locale: NotRequired[str] - """ - Preferred language of the Affirm authorization page that the customer is redirected to. - """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6601,11 +11024,9 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): + class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -6614,12 +11035,13 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - reference: NotRequired[str] + persistent_token: NotRequired[str] """ - An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. - This field differs from the statement descriptor and item name. + [Deprecated] This is a legacy parameter that no longer has any function. """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6632,10 +11054,8 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + class CreateParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6648,7 +11068,7 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAlma(TypedDict): + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -6657,8 +11077,34 @@ class CreateParamsPaymentMethodOptionsAlma(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -6680,7 +11126,7 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): + class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -6700,16 +11146,12 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" - ] + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] """ - Additional fields for Mandate creation + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6721,25 +11163,9 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] - """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. - """ - - class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] - """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. - """ - class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] - """ - Preferred language of the Bancontact authorization page that the customer is redirected to. - """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + class CreateParamsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6751,8 +11177,15 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ - class CreateParamsPaymentMethodOptionsBillie(TypedDict): + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -6762,12 +11195,8 @@ class CreateParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - class CreateParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired[str] - """ - The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6780,13 +11209,61 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired[int] + class CreateParamsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "PaymentIntent.CreateParamsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] + """ + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6799,92 +11276,68 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - - class CreateParamsPaymentMethodOptionsCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + subsellers: NotRequired[List[str]] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. """ - cvc_token: NotRequired[str] + + class CreateParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] """ - A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + Type of the line item. """ - installments: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallments" - ] + description: NotRequired[str] """ - Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - - For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + Description of the line item. """ - mandate_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" - ] + name: str """ - Configuration options for setting up an eMandate for cards issued in India. + Descriptive name of the line item. """ - moto: NotRequired[bool] + quantity: int """ - When specified, this parameter indicates that a transaction will be marked - as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - parameter can only be provided during confirmation. + Quantity of the line item. Must be a positive number. """ - network: NotRequired[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "girocard", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", - ] - ] + sku: NotRequired[str] """ - Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + Client facing stock keeping unit, article number or similar. """ - request_extended_authorization: NotRequired[ - Literal["if_available", "never"] - ] + sold_by: NotRequired[str] """ - Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + The Stripe account ID of the connected account that sells the item. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + tax: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsPaypalLineItemTax" ] """ - Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + The tax information for the line item. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + unit_amount: int """ - Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + Price for a single unit of the line item in minor units. Cannot be a negative number. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + + class CreateParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int """ - Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + The tax for a single unit of the line item in minor units. Cannot be a negative number. """ - request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] - ] + behavior: Literal["exclusive", "inclusive"] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + The tax behavior for the line item. """ - require_cvc_recollection: NotRequired[bool] + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] """ - When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6897,204 +11350,257 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] - """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - """ - statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + Amount that will be collected. It is required when `amount_type` is `fixed`. """ - three_d_secure: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" - ] + amount_type: NotRequired[Literal["fixed", "maximum"]] """ - If 3D Secure authentication was performed with a third-party provider, - the authentication details to use for this payment. + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. """ - - class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired[bool] + end_date: NotRequired[str] """ - Setting to true enables installments for this PaymentIntent. - This will cause the response to contain a list of available installment plans. - Setting to false will prevent any selected plan from applying to a charge. + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ - plan: NotRequired[ - "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] ] """ - The selected installment plan to use for this payment attempt. - This parameter can only be provided during confirmation. - """ - - class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: NotRequired[int] - """ - For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + The periodicity at which payments will be collected. """ - interval: NotRequired[Literal["month"]] + payments_per_period: NotRequired[int] """ - For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. - One of `month`. + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ - type: Literal["fixed_count"] + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] """ - Type of installment plan, one of `fixed_count`. + The purpose for which payments are made. Defaults to retail. """ - class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): - amount: int - """ - Amount to be charged for future payments. - """ - amount_type: Literal["fixed", "maximum"] - """ - One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - """ - description: NotRequired[str] - """ - A description of the mandate or subscription that is meant to be displayed to the customer. - """ - end_date: NotRequired[int] - """ - End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - """ - interval: Literal["day", "month", "sporadic", "week", "year"] - """ - Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - """ - interval_count: NotRequired[int] + class CreateParamsPaymentMethodOptionsPix(TypedDict): + expires_after_seconds: NotRequired[int] """ - The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ - reference: str + expires_at: NotRequired[int] """ - Unique identifier for the mandate or subscription. + The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ - start_date: int + setup_future_usage: NotRequired[Literal["none"]] """ - Start date of the mandate or subscription. Start date should not be lesser than yesterday. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - supported_types: NotRequired[List[Literal["india"]]] + + class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Specifies the type of mandates supported. Possible values are `india`. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired[bool] + class CreateParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - request_incremental_authorization_support: NotRequired[bool] + + class CreateParamsPaymentMethodOptionsRechnung(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - routing: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardPresentRouting" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. - """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): - requested_priority: NotRequired[Literal["domestic", "international"]] - """ - Routing requested priority + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[ - Literal["A", "C", "I", "N", "R", "U", "Y"] - ] + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - The `transStatus` returned from the card Issuer's ACS in the ARes. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - cryptogram: str + + class CreateParamsPaymentMethodOptionsSatispay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - The cryptogram, also known as the "authentication value" (AAV, CAVV or - AEVV). This value is 20 bytes, base64-encoded into a 28-character string. - (Most 3D Secure providers will return the base64-encoded version, which - is what you should specify here.) + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ - The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - provider and indicates what degree of authentication was performed. - """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] - """ - The exemption requested via 3DS and accepted by the issuer at authentication time. + Additional fields for Mandate creation """ - network_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ - Network specific 3DS fields. Network specific arguments require an - explicit card brand choice. The parameter `payment_method_options.card.network`` - must be populated accordingly + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - requestor_challenge_indicator: NotRequired[str] + target_date: NotRequired[str] """ - The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - transaction_id: str + + class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] """ - For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server - Transaction ID (dsTransID). + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. """ - version: Literal["1.0.2", "2.1.0", "2.2.0"] + + class CreateParamsPaymentMethodOptionsShopeepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - The version of 3D Secure that was performed. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( - TypedDict, - ): - cartes_bancaires: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + class CreateParamsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ - Cartes Bancaires-specific 3DS fields. + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( - TypedDict, - ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - The cryptogram calculation algorithm used by the card Issuer's ACS - to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. - messageExtension: CB-AVALGO + + class CreateParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ - cb_exemption: NotRequired[str] + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - The exemption indicator returned from Cartes Bancaires in the ARes. - message extension: CB-EXEMPTION; string (4 characters) - This is a 3 byte bitmap (low significant byte first and most significant - bit first) that has been Base64 encoded + + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] """ - cb_score: NotRequired[int] + A reference for this payment to be displayed in the Swish app. """ - The risk score returned from Cartes Bancaires in the ARes. - message extension: CB-SCORE; numeric value 0-99 + setup_future_usage: NotRequired[Literal["none"]] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsCashapp(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + + class CreateParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7107,18 +11613,34 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): - bank_transfer: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): + financial_connections: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ - Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + Additional fields for Financial Connections Session creation """ - funding_type: NotRequired[Literal["bank_transfer"]] + mandate_options: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" + ] """ - The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + Additional fields for Mandate creation """ - setup_future_usage: NotRequired[Literal["none"]] + networks: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" + ] + """ + Additional fields for network related functions + """ + preferred_settlement_speed: NotRequired[ + "Literal['']|Literal['fastest', 'standard']" + ] + """ + Preferred transaction settlement speed + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7130,82 +11652,105 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ - class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): - eu_bank_transfer: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + filters: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ - Configuration for the eu_bank_transfer funding type. + Provide filters for the linked accounts that the customer can select for the payment method. """ - requested_address_types: NotRequired[ + manual_entry: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ + permissions: NotRequired[ + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] + ] + """ + The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + """ + prefetch: NotRequired[ List[ Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", + "balances", + "inferred_balances", + "ownership", + "transactions", ] ] ] """ - List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - - Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + List of data features that you would like to retrieve upon account creation. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", - ] + return_url: NotRequired[str] """ - The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ - class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - country: str + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] """ - The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ - - class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + institution: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + ID of the institution to use to filter for selectable accounts. """ - class CreateParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( + TypedDict, + ): + collection_method: NotRequired["Literal['']|Literal['paper']"] + """ + The method used to collect offline mandate customer acceptance. + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + """ + Triggers validations to run across the selected networks """ - class CreateParamsPaymentMethodOptionsGiropay(TypedDict): + class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7219,7 +11764,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): + class CreateParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7233,263 +11778,387 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + class CreateParamsRadarOptions(TypedDict): + session: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ - class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): - pass - - class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class CreateParamsShipping(TypedDict): + address: "PaymentIntent.CreateParamsShippingAddress" """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Shipping address. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class CreateParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class CreateParamsPaymentMethodOptionsKlarna(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] """ - Controls when the funds are captured from the customer's account. + The amount that will be transferred automatically when a charge succeeds. + The amount is capped at the total transaction amount and if no amount is set, + the full amount is transferred. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + If you intend to collect a fee and you need a more robust reporting experience, using + [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) + might be a better fit for your integration. + """ + destination: str + """ + If specified, successful charges will be attributed to the destination + account for tax reporting, and the funds from charges will be transferred + to the destination account. The ID of the resulting transfer will be + returned on the successful charge's `transfer` field. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class DecrementAuthorizationParams(RequestOptions): + amount: int """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] - ] + The updated total amount that you intend to collect from the cardholder. This amount must be smaller than the currently authorized amount and greater than the already captured amount. """ - Preferred language of the Klarna authorization page that the customer is redirected to + application_fee_amount: NotRequired[int] """ - setup_future_usage: NotRequired[Literal["none"]] + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + hooks: NotRequired["PaymentIntent.DecrementAuthorizationParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + transfer_data: NotRequired[ + "PaymentIntent.DecrementAuthorizationParamsTransferData" + ] + """ + The parameters used to automatically create a transfer after the payment is captured. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class DecrementAuthorizationParamsHooks(TypedDict): + inputs: NotRequired[ + "PaymentIntent.DecrementAuthorizationParamsHooksInputs" + ] + """ + Arguments passed in automations + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class DecrementAuthorizationParamsHooksInputs(TypedDict): + tax: NotRequired[ + "PaymentIntent.DecrementAuthorizationParamsHooksInputsTax" + ] + """ + Tax arguments for automations + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class DecrementAuthorizationParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class DecrementAuthorizationParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when a charge succeeds. """ - class CreateParamsPaymentMethodOptionsKonbini(TypedDict): - confirmation_number: NotRequired["Literal['']|str"] + class IncrementAuthorizationParams(RequestOptions): + amount: int """ - An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. """ - expires_after_days: NotRequired["Literal['']|int"] + application_fee_amount: NotRequired[int] """ - The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - expires_at: NotRequired["Literal['']|int"] + description: NotRequired[str] """ - The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + An arbitrary string attached to the object. Often useful for displaying to users. """ - product_description: NotRequired["Literal['']|str"] + expand: NotRequired[List[str]] """ - A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + Specifies which fields in the response should be expanded. """ - setup_future_usage: NotRequired[Literal["none"]] + hooks: NotRequired["PaymentIntent.IncrementAuthorizationParamsHooks"] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Automations to be run during the PaymentIntent lifecycle """ - - class CreateParamsPaymentMethodOptionsKrCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + metadata: NotRequired[Dict[str, str]] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + payment_method_options: NotRequired[ + "PaymentIntent.IncrementAuthorizationParamsPaymentMethodOptions" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Payment method-specific configuration for this PaymentIntent. """ - - class CreateParamsPaymentMethodOptionsLink(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + statement_descriptor: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). """ - persistent_token: NotRequired[str] + transfer_data: NotRequired[ + "PaymentIntent.IncrementAuthorizationParamsTransferData" + ] """ - [Deprecated] This is a legacy parameter that no longer has any function. + The parameters used to automatically create a transfer after the payment is captured. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + + class IncrementAuthorizationParamsHooks(TypedDict): + inputs: NotRequired[ + "PaymentIntent.IncrementAuthorizationParamsHooksInputs" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Arguments passed in automations """ - class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class IncrementAuthorizationParamsHooksInputs(TypedDict): + tax: NotRequired[ + "PaymentIntent.IncrementAuthorizationParamsHooksInputsTax" + ] + """ + Tax arguments for automations """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class IncrementAuthorizationParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] """ - setup_future_usage: NotRequired[Literal["none"]] + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class IncrementAuthorizationParamsPaymentMethodOptions(TypedDict): + card: NotRequired[ + "PaymentIntent.IncrementAuthorizationParamsPaymentMethodOptionsCard" + ] + """ + Configuration for any card payments attempted on this PaymentIntent. + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class IncrementAuthorizationParamsPaymentMethodOptionsCard(TypedDict): + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class IncrementAuthorizationParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when a charge succeeds. + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ListAmountDetailsLineItemsParams(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. """ - class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ListParams(RequestOptions): + created: NotRequired["PaymentIntent.ListParamsCreated|int"] + """ + A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + """ + customer: NotRequired[str] + """ + Only return PaymentIntents for the customer that this customer ID specifies. + """ + customer_account: NotRequired[str] + """ + Only return PaymentIntents for the account that this ID specifies. + """ + 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. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class ModifyParams(RequestOptions): + amount: NotRequired[int] + """ + Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + currency: NotRequired[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + ID of the Customer this PaymentIntent belongs to, if one exists. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Payment methods attached to other Customers cannot be used with this PaymentIntent. - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ - - class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + customer_account: NotRequired[str] """ - Controls when the funds are captured from the customer's account. + ID of the Account this PaymentIntent belongs to, if one exists. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fx_quote: NotRequired[str] + """ + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. + """ + hooks: NotRequired["PaymentIntent.ModifyParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ + mandate_data: NotRequired["PaymentIntent.ModifyParamsMandateData"] + """ + This hash contains details about the Mandate to create. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_details: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ + payment_method: NotRequired[str] + payment_method_configuration: NotRequired[str] + """ + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + """ + payment_method_data: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodData" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. + """ + payment_method_options: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptions" + ] + """ + Payment-method-specific configuration for this PaymentIntent. + """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + receipt_email: NotRequired["Literal['']|str"] + """ + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - - class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7502,694 +12171,768 @@ class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] + shipping: NotRequired["Literal['']|PaymentIntent.ModifyParamsShipping"] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Shipping information for this PaymentIntent. """ + statement_descriptor: NotRequired[str] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired[int] + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ - The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + statement_descriptor_suffix: NotRequired[str] """ - setup_future_usage: NotRequired[Literal["none"]] + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + transfer_data: NotRequired["PaymentIntent.ModifyParamsTransferData"] + """ + Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + transfer_group: NotRequired[str] + """ + A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ModifyParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntent.ModifyParamsHooksInputs"] + """ + Arguments passed in automations """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class ModifyParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntent.ModifyParamsHooksInputsTax"] + """ + Tax arguments for automations + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class ModifyParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class ModifyParamsMandateData(TypedDict): + customer_acceptance: ( + "PaymentIntent.ModifyParamsMandateDataCustomerAcceptance" + ) + """ + This hash contains details about the customer acceptance of the Mandate. + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ModifyParamsMandateDataCustomerAcceptance(TypedDict): + online: "PaymentIntent.ModifyParamsMandateDataCustomerAcceptanceOnline" """ - tos_shown_and_accepted: NotRequired[bool] + If this is a Mandate accepted online, this hash contains details about the online acceptance. """ - Confirm that the payer has accepted the P24 terms and conditions. + type: Literal["online"] """ - - class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): - pass - - class CreateParamsPaymentMethodOptionsPayco(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + The type of customer acceptance information included with the Mandate. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ModifyParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Mandate was accepted by the customer. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ModifyParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRental" + ] + """ + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired["PaymentIntent.ModifyParamsPaymentDetailsFlight"] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired["PaymentIntent.ModifyParamsPaymentDetailsLodging"] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent """ - class CreateParamsPaymentMethodOptionsPaypal(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ModifyParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalAffiliate" + ] """ - Controls when the funds will be captured from the customer's account. + Affiliate details for this purchase. """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List["PaymentIntent.ModifyParamsPaymentDetailsCarRentalDriver"] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] ] ] """ - [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + List of additional charges being billed. """ - reference: NotRequired[str] + no_show: NotRequired[bool] """ - A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + Indicates if the customer did not keep nor cancel their booking. """ - risk_correlation_id: NotRequired[str] + pickup_address: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalPickupAddress" + ] """ - The risk correlation ID for an on-session payment using a saved PayPal payment method. + Car pick-up address. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: NotRequired[str] + """ + Name of the pickup location. + """ + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalReturnAddress" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Car return address. """ - - class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired[int] + return_at: int """ - The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + Car return time. Measured in seconds since the Unix epoch. """ - expires_at: NotRequired[int] + return_location_name: NotRequired[str] """ - The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + Name of the return location. """ - setup_future_usage: NotRequired[Literal["none"]] + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ModifyParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. """ - class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ModifyParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class ModifyParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class ModifyParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] + """ + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class ModifyParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ModifyParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + State, county, province, or region. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ModifyParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + City, district, suburb, town, or village. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + country: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + line1: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSatispay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Address line 1 (e.g., street, PO Box, or company name). """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" - ] + class ModifyParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - Additional fields for Mandate creation + Indicates if the tickets are digitally checked when entering the venue. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + address: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsAddress" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The event location's address. """ - target_date: NotRequired[str] + affiliate: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsAffiliate" + ] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Affiliate details for this purchase. """ - - class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + company: NotRequired[str] """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + The name of the company """ - - class CreateParamsPaymentMethodOptionsSofort(TypedDict): - preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + delivery: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsDelivery" ] """ - Language shown to the payer on redirect. + Delivery details for this purchase. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + ends_at: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Event end time. Measured in seconds since the Unix epoch. """ - - class CreateParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] + genre: NotRequired[str] """ - A reference for this payment to be displayed in the Swish app. + Type of the event entertainment (concert, sports event etc) """ - setup_future_usage: NotRequired[Literal["none"]] + name: str """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The name of the event. """ - - class CreateParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + starts_at: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Event start time. Measured in seconds since the Unix epoch. """ - class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): - financial_connections: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" - ] + class ModifyParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - Additional fields for Financial Connections Session creation + City, district, suburb, town, or village. """ - mandate_options: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" - ] + country: NotRequired[str] """ - Additional fields for Mandate creation + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - networks: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" - ] + line1: NotRequired[str] """ - Additional fields for network related functions + Address line 1 (e.g., street, PO Box, or company name). """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] + line2: NotRequired[str] """ - Preferred transaction settlement speed + Address line 2 (e.g., apartment, suite, unit, or building). """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + postal_code: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + ZIP or postal code. """ - target_date: NotRequired[str] + state: NotRequired[str] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + State, county, province, or region. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + + class ModifyParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - Bank account verification method. + The name of the affiliate that originated the purchase. """ - class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( - TypedDict, - ): - filters: NotRequired[ - "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" - ] + class ModifyParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Provide filters for the linked accounts that the customer can select for the payment method. + The delivery method for the payment """ - permissions: NotRequired[ - List[ - Literal[ - "balances", "ownership", "payment_method", "transactions" - ] - ] + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ - The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + Details of the recipient. """ - prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] - ] + + class ModifyParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - List of data features that you would like to retrieve upon account creation. + The email of the recipient the ticket is delivered to. """ - return_url: NotRequired[str] + name: NotRequired[str] """ - For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( - TypedDict, - ): - account_subcategories: NotRequired[ - List[Literal["checking", "savings"]] + class ModifyParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsFlightAffiliate" ] """ - The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + Affiliate details for this purchase. """ - - class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( - TypedDict, - ): - collection_method: NotRequired["Literal['']|Literal['paper']"] + agency_number: NotRequired[str] """ - The method used to collect offline mandate customer acceptance. + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. """ - - class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + carrier: NotRequired[str] """ - Triggers validations to run across the selected networks + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. """ - - class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired[str] + delivery: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsFlightDelivery" + ] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + Delivery details for this purchase. """ - client: NotRequired[Literal["android", "ios", "web"]] + passenger_name: NotRequired[str] """ - The client type that the end customer will pay from + The name of the person or entity on the reservation. """ - setup_future_usage: NotRequired[Literal["none"]] + passengers: NotRequired[ + List["PaymentIntent.ModifyParamsPaymentDetailsFlightPassenger"] + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The details of the passengers in the travel reservation. """ - - class CreateParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + segments: List["PaymentIntent.ModifyParamsPaymentDetailsFlightSegment"] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ModifyParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. """ - class CreateParamsRadarOptions(TypedDict): - session: NotRequired[str] + class ModifyParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. """ - class CreateParamsShipping(TypedDict): - address: "PaymentIntent.CreateParamsShippingAddress" + class ModifyParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Shipping address. + The email of the recipient the ticket is delivered to. """ - carrier: NotRequired[str] + name: NotRequired[str] """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ + + class ModifyParamsPaymentDetailsFlightPassenger(TypedDict): name: str """ - Recipient name. + Full name of the person or entity on the flight reservation. """ - phone: NotRequired[str] + + class ModifyParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - Recipient phone (including extension). + The flight segment amount. """ - tracking_number: NotRequired[str] + arrival_airport: NotRequired[str] """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + The International Air Transport Association (IATA) airport code for the arrival airport. """ - - class CreateParamsShippingAddress(TypedDict): - city: NotRequired[str] + arrives_at: NotRequired[int] """ - City, district, suburb, town, or village. + The arrival time for the flight segment. Measured in seconds since the Unix epoch. """ - country: NotRequired[str] + carrier: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. """ - line1: NotRequired[str] + departs_at: int """ - Address line 1 (e.g., street, PO Box, or company name). + The departure time for the flight segment. Measured in seconds since the Unix epoch. """ - line2: NotRequired[str] + departure_airport: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + The International Air Transport Association (IATA) airport code for the departure airport. """ - postal_code: NotRequired[str] + flight_number: NotRequired[str] """ - ZIP or postal code. + The flight number associated with the segment """ - state: NotRequired[str] + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] """ - State, county, province, or region. + The fare class for the segment. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class ModifyParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsLodgingAddress" + ] """ - The amount that will be transferred automatically when a charge succeeds. - The amount is capped at the total transaction amount and if no amount is set, - the full amount is transferred. - - If you intend to collect a fee and you need a more robust reporting experience, using - [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) - might be a better fit for your integration. + The lodging location's address. """ - destination: str + adults: NotRequired[int] """ - If specified, successful charges will be attributed to the destination - account for tax reporting, and the funds from charges will be transferred - to the destination account. The ID of the resulting transfer will be - returned on the successful charge's `transfer` field. + The number of adults on the booking """ - - class IncrementAuthorizationParams(RequestOptions): - amount: int + affiliate: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsLodgingAffiliate" + ] """ - The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. + Affiliate details for this purchase. """ - application_fee_amount: NotRequired[int] + booking_number: NotRequired[str] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The booking number associated with the lodging reservation. """ - description: NotRequired[str] + category: NotRequired[Literal["hotel", "vacation_rental"]] """ - An arbitrary string attached to the object. Often useful for displaying to users. + The lodging category """ - expand: NotRequired[List[str]] + checkin_at: int """ - Specifies which fields in the response should be expanded. + Lodging check-in time. Measured in seconds since the Unix epoch. """ - metadata: NotRequired[Dict[str, str]] + checkout_at: int """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + Lodging check-out time. Measured in seconds since the Unix epoch. """ - statement_descriptor: NotRequired[str] + customer_service_phone_number: NotRequired[str] """ - Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + The customer service phone number of the lodging company. """ - transfer_data: NotRequired[ - "PaymentIntent.IncrementAuthorizationParamsTransferData" + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsLodgingDelivery" ] """ - The parameters used to automatically create a transfer after the payment is captured. - Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + Delivery details for this purchase. """ - - class IncrementAuthorizationParamsTransferData(TypedDict): - amount: NotRequired[int] + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] """ - The amount that will be transferred automatically when a charge succeeds. + List of additional charges being billed. """ - - class ListParams(RequestOptions): - created: NotRequired["PaymentIntent.ListParamsCreated|int"] + fire_safety_act_compliance: NotRequired[bool] """ - A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + Indicates whether the lodging location is compliant with the Fire Safety Act. """ - customer: NotRequired[str] + name: NotRequired[str] """ - Only return PaymentIntents for the customer that this customer ID specifies. + The name of the lodging location. """ - ending_before: NotRequired[str] + no_show: NotRequired[bool] """ - 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. + Indicates if the customer did not keep their booking while failing to cancel the reservation. """ - expand: NotRequired[List[str]] + number_of_rooms: NotRequired[int] """ - Specifies which fields in the response should be expanded. + The number of rooms on the booking """ - limit: NotRequired[int] + passengers: NotRequired[ + List["PaymentIntent.ModifyParamsPaymentDetailsLodgingPassenger"] + ] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + The details of the passengers in the travel reservation """ - starting_after: NotRequired[str] + property_phone_number: 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. + The phone number of the lodging location. """ - - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + room_class: NotRequired[str] """ - Minimum value to filter by (exclusive) + The room class for this purchase. """ - gte: NotRequired[int] + room_nights: NotRequired[int] """ - Minimum value to filter by (inclusive) + The number of room nights """ - lt: NotRequired[int] + total_room_tax_amount: NotRequired[int] """ - Maximum value to filter by (exclusive) + The total tax amount associating with the room reservation. """ - lte: NotRequired[int] + total_tax_amount: NotRequired[int] """ - Maximum value to filter by (inclusive) + The total tax amount """ - class ModifyParams(RequestOptions): - amount: NotRequired[int] + class ModifyParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] """ - Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + City, district, suburb, town, or village. """ - application_fee_amount: NotRequired["Literal['']|int"] + country: NotRequired[str] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] - ] + line1: NotRequired[str] """ - Controls when the funds will be captured from the customer's account. + Address line 1 (e.g., street, PO Box, or company name). """ - currency: NotRequired[str] + line2: NotRequired[str] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Address line 2 (e.g., apartment, suite, unit, or building). """ - customer: NotRequired[str] + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - ID of the Customer this PaymentIntent belongs to, if one exists. - - Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + class ModifyParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str """ - description: NotRequired[str] + The name of the affiliate that originated the purchase. """ - An arbitrary string attached to the object. Often useful for displaying to users. + + class ModifyParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - expand: NotRequired[List[str]] + The delivery method for the payment """ - Specifies which fields in the response should be expanded. + recipient: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsLodgingDeliveryRecipient" + ] """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + Details of the recipient. """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + + class ModifyParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - payment_method: NotRequired[str] + The email of the recipient the ticket is delivered to. """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. To unset this field to null, pass in an empty string. + name: NotRequired[str] """ - payment_method_configuration: NotRequired[str] + The name of the recipient the ticket is delivered to. """ - The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + phone: NotRequired[str] """ - payment_method_data: NotRequired[ - "PaymentIntent.ModifyParamsPaymentMethodData" - ] + The phone number of the recipient the ticket is delivered to. """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + + class ModifyParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str """ - payment_method_options: NotRequired[ - "PaymentIntent.ModifyParamsPaymentMethodOptions" + Full name of the person or entity on the lodging reservation. + """ + + class ModifyParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsSubscriptionAffiliate" ] """ - Payment-method-specific configuration for this PaymentIntent. + Affiliate details for this purchase. """ - payment_method_types: NotRequired[List[str]] + auto_renewal: NotRequired[bool] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + Info whether the subscription will be auto renewed upon expiry. """ - receipt_email: NotRequired["Literal['']|str"] + billing_interval: NotRequired[ + "PaymentIntent.ModifyParamsPaymentDetailsSubscriptionBillingInterval" + ] """ - Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + Subscription billing details for this purchase. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" - ] + ends_at: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Subscription end time. Measured in seconds since the Unix epoch. """ - shipping: NotRequired["Literal['']|PaymentIntent.ModifyParamsShipping"] + name: str """ - Shipping information for this PaymentIntent. + Name of the product on subscription. e.g. Apple Music Subscription """ - statement_descriptor: NotRequired[str] + starts_at: NotRequired[int] """ - Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - - Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Subscription start time. Measured in seconds since the Unix epoch. """ - statement_descriptor_suffix: NotRequired[str] + + class ModifyParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + The name of the affiliate that originated the purchase. """ - transfer_data: NotRequired["PaymentIntent.ModifyParamsTransferData"] + + class ModifyParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int """ - Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - transfer_group: NotRequired[str] + interval: Literal["day", "month", "week", "year"] """ - A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ class ModifyParamsPaymentMethodData(TypedDict): @@ -8299,12 +13042,22 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -8343,6 +13096,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -8401,6 +13158,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -8411,12 +13172,22 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataRevolutPay" ] @@ -8441,12 +13212,24 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -8473,13 +13256,16 @@ class ModifyParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -8490,13 +13276,18 @@ class ModifyParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -8716,9 +13507,18 @@ class ModifyParamsPaymentMethodDataFpx(TypedDict): class ModifyParamsPaymentMethodDataGiropay(TypedDict): pass + class ModifyParamsPaymentMethodDataGopay(TypedDict): + pass + class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass + class ModifyParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -8781,6 +13581,9 @@ class ModifyParamsPaymentMethodDataKrCard(TypedDict): class ModifyParamsPaymentMethodDataLink(TypedDict): pass + class ModifyParamsPaymentMethodDataMbWay(TypedDict): + pass + class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -8866,18 +13669,55 @@ class ModifyParamsPaymentMethodDataPaynow(TypedDict): class ModifyParamsPaymentMethodDataPaypal(TypedDict): pass + class ModifyParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class ModifyParamsPaymentMethodDataPix(TypedDict): pass class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass + class ModifyParamsPaymentMethodDataQris(TypedDict): + pass + class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class ModifyParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntent.ModifyParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class ModifyParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -8893,12 +13733,25 @@ class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class ModifyParamsPaymentMethodDataShopeepay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class ModifyParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class ModifyParamsPaymentMethodDataSwish(TypedDict): pass @@ -9048,11 +13901,23 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ + gopay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsGopay" + ] + """ + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. + """ grabpay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsGrabpay" ] """ - If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsIdeal" @@ -9096,6 +13961,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mb_way: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMbWay" + ] + """ + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. + """ mobilepay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMobilepay" ] @@ -9156,6 +14027,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. + """ pix: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPix" ] @@ -9168,6 +14045,18 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ + qris: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsQris" + ] + """ + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. + """ + rechnung: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. + """ revolut_pay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay" ] @@ -9192,12 +14081,24 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + shopeepay: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsShopeepay" + ] + """ + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. + """ sofort: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + stripe_balance: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsStripeBalance" + ] + """ + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSwish" ] @@ -9557,6 +14458,12 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] @@ -9577,6 +14484,12 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] @@ -9609,6 +14522,12 @@ class ModifyParamsPaymentMethodOptionsCard(TypedDict): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + statement_details: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCardStatementDetails" + ] + """ + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. + """ three_d_secure: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -9707,6 +14626,46 @@ class ModifyParamsPaymentMethodOptionsCardPresentRouting(TypedDict): Routing requested priority """ + class ModifyParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsCardStatementDetailsAddress" + ] + """ + Please pass in an address that is within your Stripe user account country + """ + phone: NotRequired[str] + """ + Phone number (e.g., a toll-free number that customers can call) + """ + + class ModifyParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -9923,6 +14882,20 @@ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsGopay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -9937,6 +14910,28 @@ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -10133,6 +15128,20 @@ class ModifyParamsPaymentMethodOptionsLink(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -10279,6 +15288,14 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): """ Controls when the funds will be captured from the customer's account. """ + line_items: NotRequired[ + List[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -10311,6 +15328,10 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. @@ -10329,6 +15350,131 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ModifyParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class ModifyParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class ModifyParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ class ModifyParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] @@ -10366,6 +15512,23 @@ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ModifyParamsPaymentMethodOptionsRechnung(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -10440,6 +15603,20 @@ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. """ + class ModifyParamsPaymentMethodOptionsShopeepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" @@ -10462,6 +15639,22 @@ class ModifyParamsPaymentMethodOptionsSofort(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -10553,6 +15746,12 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -10564,7 +15763,14 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -10583,6 +15789,18 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -10716,6 +15934,28 @@ class SearchParams(RequestOptions): The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). """ + class TriggerActionParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + scan_qr_code: NotRequired[ + "PaymentIntent.TriggerActionParamsScanQrCode" + ] + """ + True to simulate success, false to simulate failure. + """ + type: Literal["expire", "fund"] + """ + The type of action to be simulated. + """ + + class TriggerActionParamsScanQrCode(TypedDict): + result: NotRequired[Literal["failure", "success"]] + """ + Whether the QR Code scan's payment should succeed or fail. + """ + class VerifyMicrodepositsParams(RequestOptions): amounts: NotRequired[List[int]] """ @@ -10806,10 +16046,23 @@ class VerifyMicrodepositsParams(RequestOptions): If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ + customer_account: Optional[str] + """ + ID of the Account this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Accounts cannot be used with this PaymentIntent. + + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ + fx_quote: Optional[str] + """ + The FX Quote used for the PaymentIntent. + """ + hooks: Optional[Hooks] id: str """ Unique identifier for the object. @@ -10842,6 +16095,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. """ + payment_details: Optional[PaymentDetails] payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the payment method used in this PaymentIntent. @@ -10873,6 +16127,10 @@ class VerifyMicrodepositsParams(RequestOptions): """ ID of the review associated with this PaymentIntent, if any. """ + secret_key_confirmation: Optional[Literal["optional", "required"]] + """ + Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + """ setup_future_usage: Optional[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -11678,6 +16936,242 @@ async def create_async( ), ) + @classmethod + def _cls_decrement_authorization( + cls, + intent: str, + **params: Unpack["PaymentIntent.DecrementAuthorizationParams"], + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + "PaymentIntent", + cls._static_request( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + def decrement_authorization( + intent: str, + **params: Unpack["PaymentIntent.DecrementAuthorizationParams"], + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + ... + + @overload + def decrement_authorization( + self, **params: Unpack["PaymentIntent.DecrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + ... + + @class_method_variant("_cls_decrement_authorization") + def decrement_authorization( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.DecrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + "PaymentIntent", + self._request( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_decrement_authorization_async( + cls, + intent: str, + **params: Unpack["PaymentIntent.DecrementAuthorizationParams"], + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def decrement_authorization_async( + intent: str, + **params: Unpack["PaymentIntent.DecrementAuthorizationParams"], + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + ... + + @overload + async def decrement_authorization_async( + self, **params: Unpack["PaymentIntent.DecrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + ... + + @class_method_variant("_cls_decrement_authorization_async") + async def decrement_authorization_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.DecrementAuthorizationParams"] + ) -> "PaymentIntent": + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_increment_authorization( cls, @@ -12094,6 +17588,116 @@ async def retrieve_async( await instance.refresh_async() return instance + @classmethod + def _cls_trigger_action( + cls, intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + cls._static_request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + def trigger_action( + intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @overload + def trigger_action( + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @class_method_variant("_cls_trigger_action") + def trigger_action( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + self._request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_trigger_action_async( + cls, intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + await cls._static_request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def trigger_action_async( + intent: str, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @overload + async def trigger_action_async( + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + ... + + @class_method_variant("_cls_trigger_action_async") + async def trigger_action_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentIntent.TriggerActionParams"] + ) -> "PaymentIntent": + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + "PaymentIntent", + await self._request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_verify_microdeposits( cls, @@ -12250,11 +17854,53 @@ async def search_auto_paging_iter_async( ) -> AsyncIterator["PaymentIntent"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() + @classmethod + def list_amount_details_line_items( + cls, + intent: str, + **params: Unpack["PaymentIntent.ListAmountDetailsLineItemsParams"], + ) -> ListObject["PaymentIntentAmountDetailsLineItem"]: + """ + Lists all LineItems of a given PaymentIntent. + """ + return cast( + ListObject["PaymentIntentAmountDetailsLineItem"], + cls._static_request( + "get", + "/v1/payment_intents/{intent}/amount_details_line_items".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + + @classmethod + async def list_amount_details_line_items_async( + cls, + intent: str, + **params: Unpack["PaymentIntent.ListAmountDetailsLineItemsParams"], + ) -> ListObject["PaymentIntentAmountDetailsLineItem"]: + """ + Lists all LineItems of a given PaymentIntent. + """ + return cast( + ListObject["PaymentIntentAmountDetailsLineItem"], + await cls._static_request_async( + "get", + "/v1/payment_intents/{intent}/amount_details_line_items".format( + intent=sanitize_id(intent) + ), + params=params, + ), + ) + _inner_class_types = { "amount_details": AmountDetails, "automatic_payment_methods": AutomaticPaymentMethods, + "hooks": Hooks, "last_payment_error": LastPaymentError, "next_action": NextAction, + "payment_details": PaymentDetails, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, "presentment_details": PresentmentDetails, diff --git a/stripe/_payment_intent_amount_details_line_item.py b/stripe/_payment_intent_amount_details_line_item.py new file mode 100644 index 000000000..31b6098f6 --- /dev/null +++ b/stripe/_payment_intent_amount_details_line_item.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class PaymentIntentAmountDetailsLineItem(StripeObject): + OBJECT_NAME: ClassVar[ + Literal["payment_intent_amount_details_line_item"] + ] = "payment_intent_amount_details_line_item" + + class PaymentMethodOptions(StripeObject): + class Card(StripeObject): + commodity_code: Optional[str] + + class CardPresent(StripeObject): + commodity_code: Optional[str] + + class Klarna(StripeObject): + image_url: Optional[str] + product_url: Optional[str] + + class Paypal(StripeObject): + category: Optional[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: Optional[str] + """ + Description of the line item. + """ + sold_by: Optional[str] + """ + The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + """ + + card: Optional[Card] + card_present: Optional[CardPresent] + klarna: Optional[Klarna] + paypal: Optional[Paypal] + _inner_class_types = { + "card": Card, + "card_present": CardPresent, + "klarna": Klarna, + "paypal": Paypal, + } + + class Tax(StripeObject): + total_tax_amount: int + """ + Total portion of the amount that is for tax. + """ + + discount_amount: Optional[int] + """ + The amount an item was discounted for. Positive integer. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["payment_intent_amount_details_line_item"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_method_options: Optional[PaymentMethodOptions] + """ + Payment method-specific information for line items. + """ + product_code: Optional[str] + """ + Unique identifier of the product. At most 12 characters long. + """ + product_name: str + """ + Name of the product. At most 100 characters long. + """ + quantity: int + """ + Number of items of the product. Positive integer. + """ + tax: Optional[Tax] + """ + Contains information about the tax on the item. + """ + unit_cost: int + """ + Cost of the product. Non-negative integer. + """ + unit_of_measure: Optional[str] + """ + A unit of measure for the line item, such as gallons, feet, meters, etc. + """ + _inner_class_types = { + "payment_method_options": PaymentMethodOptions, + "tax": Tax, + } diff --git a/stripe/_payment_intent_amount_details_line_item_service.py b/stripe/_payment_intent_amount_details_line_item_service.py new file mode 100644 index 000000000..d922e480b --- /dev/null +++ b/stripe/_payment_intent_amount_details_line_item_service.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._payment_intent_amount_details_line_item import ( + PaymentIntentAmountDetailsLineItem, +) +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class PaymentIntentAmountDetailsLineItemService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + intent: str, + params: "PaymentIntentAmountDetailsLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentIntentAmountDetailsLineItem]: + """ + Lists all LineItems of a given PaymentIntent. + """ + return cast( + ListObject[PaymentIntentAmountDetailsLineItem], + self._request( + "get", + "/v1/payment_intents/{intent}/amount_details_line_items".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + intent: str, + params: "PaymentIntentAmountDetailsLineItemService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PaymentIntentAmountDetailsLineItem]: + """ + Lists all LineItems of a given PaymentIntent. + """ + return cast( + ListObject[PaymentIntentAmountDetailsLineItem], + await self._request_async( + "get", + "/v1/payment_intents/{intent}/amount_details_line_items".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 5cd968d97..98a356fa7 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -2,15 +2,26 @@ # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_intent import PaymentIntent +from stripe._payment_intent_amount_details_line_item_service import ( + PaymentIntentAmountDetailsLineItemService, +) from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id -from typing import Dict, List, cast +from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class PaymentIntentService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.amount_details_line_items = ( + PaymentIntentAmountDetailsLineItemService( + self._requestor, + ) + ) + class ApplyCustomerBalanceParams(TypedDict): amount: NotRequired[int] """ @@ -60,10 +71,20 @@ class CaptureParams(TypedDict): """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ + hooks: NotRequired["PaymentIntentService.CaptureParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_details: NotRequired[ + "Literal['']|PaymentIntentService.CaptureParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ statement_descriptor: NotRequired[str] """ Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). @@ -82,2648 +103,2112 @@ class CaptureParams(TypedDict): is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - class CaptureParamsTransferData(TypedDict): - amount: NotRequired[int] + class CaptureParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntentService.CaptureParamsHooksInputs"] """ - The amount that will be transferred automatically when a charge succeeds. + Arguments passed in automations """ - class ConfirmParams(TypedDict): - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] - ] - """ - Controls when the funds will be captured from the customer's account. + class CaptureParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntentService.CaptureParamsHooksInputsTax"] """ - confirmation_token: NotRequired[str] + Tax arguments for automations """ - ID of the ConfirmationToken used to confirm this PaymentIntent. - If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. - """ - error_on_requires_action: NotRequired[bool] + class CaptureParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] """ - Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id """ - expand: NotRequired[List[str]] + + class CaptureParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRental" + ] """ - Specifies which fields in the response should be expanded. + Car rental details for this PaymentIntent. """ - mandate: NotRequired[str] + customer_reference: NotRequired["Literal['']|str"] """ - ID of the mandate that's used for this payment. + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. """ - mandate_data: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsMandateData" + event_details: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsEventDetails" ] - off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ - Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + Event details for this PaymentIntent """ - payment_method: NotRequired[str] + flight: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlight" + ] """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent. + Flight reservation details for this PaymentIntent """ - payment_method_data: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodData" + lodging: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodging" ] """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + Lodging reservation details for this PaymentIntent """ - payment_method_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptions" - ] + order_reference: NotRequired["Literal['']|str"] """ - Payment method-specific configuration for this PaymentIntent. + A unique value assigned by the business to identify the transaction. """ - payment_method_types: NotRequired[List[str]] + subscription: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsSubscription" + ] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + Subscription details for this PaymentIntent """ - radar_options: NotRequired[ - "PaymentIntentService.ConfirmParamsRadarOptions" + + class CaptureParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalAffiliate" ] """ - Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + Affiliate details for this purchase. """ - receipt_email: NotRequired["Literal['']|str"] + booking_number: str """ - Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + The booking number associated with the car rental. """ - return_url: NotRequired[str] + car_class_code: NotRequired[str] """ - The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - This parameter is only used for cards and other redirect-based payment methods. + Class code of the car. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" - ] + car_make: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Make of the car. """ - shipping: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsShipping" - ] + car_model: NotRequired[str] """ - Shipping information for this PaymentIntent. + Model of the car. """ - use_stripe_sdk: NotRequired[bool] + company: NotRequired[str] """ - Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + The name of the rental car company. """ - - class ConfirmParamsMandateData(TypedDict): - customer_acceptance: NotRequired[ - "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptance" - ] + customer_service_phone_number: NotRequired[str] """ - This hash contains details about the customer acceptance of the Mandate. + The customer service phone number of the car rental company. """ - - class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired[int] + days_rented: int """ - The time at which the customer accepted the Mandate. + Number of days the car is being rented. """ - offline: NotRequired[ - "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOffline" + delivery: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalDelivery" ] """ - If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + Delivery details for this purchase. """ - online: NotRequired[ - "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOnline" + distance: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalDistance" ] """ - If this is a Mandate accepted online, this hash contains details about the online acceptance. + The details of the distance traveled during the rental period. """ - type: Literal["offline", "online"] + drivers: NotRequired[ + List[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalDriver" + ] + ] """ - The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + The details of the passengers in the travel reservation """ - - class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): - pass - - class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: NotRequired[str] + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] """ - The IP address from which the Mandate was accepted by the customer. + List of additional charges being billed. """ - user_agent: NotRequired[str] + no_show: NotRequired[bool] """ - The user agent of the browser from which the Mandate was accepted by the customer. + Indicates if the customer did not keep nor cancel their booking. """ - - class ConfirmParamsPaymentMethodData(TypedDict): - acss_debit: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAcssDebit" + pickup_address: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalPickupAddress" ] """ - If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + Car pick-up address. """ - affirm: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAffirm" - ] + pickup_at: int """ - If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + Car pick-up time. Measured in seconds since the Unix epoch. """ - afterpay_clearpay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAfterpayClearpay" - ] + pickup_location_name: NotRequired[str] """ - If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + Name of the pickup location. """ - alipay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAlipay" - ] + rate_amount: NotRequired[int] """ - If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + Rental rate. """ - allow_redisplay: NotRequired[ - Literal["always", "limited", "unspecified"] - ] + rate_interval: NotRequired[Literal["day", "month", "week"]] """ - This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + The frequency at which the rate amount is applied. One of `day`, `week` or `month` """ - alma: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAlma" - ] + renter_name: NotRequired[str] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + The name of the person or entity renting the car. """ - amazon_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" + return_address: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalReturnAddress" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + Car return address. """ - au_becs_debit: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" - ] + return_at: int """ - If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + Car return time. Measured in seconds since the Unix epoch. """ - bacs_debit: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBacsDebit" - ] + return_location_name: NotRequired[str] """ - If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + Name of the return location. """ - bancontact: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBancontact" - ] + tax_exempt: NotRequired[bool] """ - If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + Indicates whether the goods or services are tax-exempt or tax is not collected. """ - billie: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBillie" - ] + vehicle_identification_number: NotRequired[str] """ - If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + The vehicle identification number. """ - billing_details: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetails" - ] + + class CaptureParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + The name of the affiliate that originated the purchase. """ - blik: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBlik" - ] + + class CaptureParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + The delivery method for the payment """ - boleto: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataBoleto" + recipient: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ - If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + Details of the recipient. """ - cashapp: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataCashapp" - ] + + class CaptureParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + The email of the recipient the ticket is delivered to. """ - customer_balance: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" - ] + name: NotRequired[str] """ - If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + The name of the recipient the ticket is delivered to. """ - eps: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataEps" - ] + phone: NotRequired[str] """ - If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + The phone number of the recipient the ticket is delivered to. """ - fpx: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataFpx" - ] + + class CaptureParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + Distance traveled. """ - giropay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataGiropay" - ] + unit: NotRequired[Literal["kilometers", "miles"]] """ - If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - grabpay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataGrabpay" - ] + + class CaptureParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] """ - If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + Driver's identification number. """ - ideal: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataIdeal" - ] + driver_tax_number: NotRequired[str] """ - If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + Driver's tax number. """ - interac_present: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataInteracPresent" - ] + name: str """ - If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + Full name of the person or entity on the car reservation. """ - kakao_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataKakaoPay" - ] + + class CaptureParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + City, district, suburb, town, or village. """ - klarna: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarna" - ] + country: NotRequired[str] """ - If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - konbini: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataKonbini" - ] + line1: NotRequired[str] """ - If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - kr_card: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataKrCard" - ] + line2: NotRequired[str] """ - If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + Address line 2 (e.g., apartment, suite, unit, or building). """ - link: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataLink" - ] + postal_code: NotRequired[str] """ - If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + ZIP or postal code. """ - metadata: NotRequired[Dict[str, str]] + state: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + State, county, province, or region. """ - mobilepay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataMobilepay" - ] + + class CaptureParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + City, district, suburb, town, or village. """ - multibanco: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataMultibanco" - ] + country: NotRequired[str] """ - If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - naver_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataNaverPay" - ] + line1: NotRequired[str] """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - nz_bank_account: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataNzBankAccount" - ] + line2: NotRequired[str] """ - If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + Address line 2 (e.g., apartment, suite, unit, or building). """ - oxxo: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" - ] + postal_code: NotRequired[str] """ - If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + ZIP or postal code. """ - p24: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataP24" - ] + state: NotRequired[str] """ - If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + State, county, province, or region. """ - pay_by_bank: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPayByBank" - ] + + class CaptureParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + Indicates if the tickets are digitally checked when entering the venue. """ - payco: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPayco" + address: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsEventDetailsAddress" ] """ - If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + The event location's address. """ - paynow: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPaynow" + affiliate: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsEventDetailsAffiliate" ] """ - If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + Affiliate details for this purchase. """ - paypal: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPaypal" - ] + company: NotRequired[str] """ - If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + The name of the company """ - pix: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPix" + delivery: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsEventDetailsDelivery" ] """ - If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + Delivery details for this purchase. """ - promptpay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataPromptpay" - ] + ends_at: NotRequired[int] """ - If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + Event end time. Measured in seconds since the Unix epoch. """ - radar_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataRadarOptions" - ] + genre: NotRequired[str] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + Type of the event entertainment (concert, sports event etc) """ - revolut_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataRevolutPay" - ] + name: str """ - If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + The name of the event. """ - samsung_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataSamsungPay" - ] + starts_at: NotRequired[int] """ - If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + Event start time. Measured in seconds since the Unix epoch. """ - satispay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataSatispay" - ] + + class CaptureParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + City, district, suburb, town, or village. """ - sepa_debit: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataSepaDebit" - ] + country: NotRequired[str] """ - If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - sofort: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataSofort" - ] + line1: NotRequired[str] """ - If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + Address line 1 (e.g., street, PO Box, or company name). """ - swish: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataSwish" - ] + line2: NotRequired[str] """ - If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + Address line 2 (e.g., apartment, suite, unit, or building). """ - twint: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataTwint" - ] + postal_code: NotRequired[str] """ - If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + ZIP or postal code. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "blik", - "boleto", - "cashapp", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "sepa_debit", - "sofort", - "swish", - "twint", - "us_bank_account", - "wechat_pay", - "zip", - ] + state: NotRequired[str] """ - The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + State, county, province, or region. """ - us_bank_account: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataUsBankAccount" - ] + + class CaptureParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + The name of the affiliate that originated the purchase. """ - wechat_pay: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataWechatPay" - ] + + class CaptureParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + The delivery method for the payment """ - zip: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataZip" + recipient: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ - If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + Details of the recipient. """ - class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): - account_number: str + class CaptureParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Customer's bank account number. + The email of the recipient the ticket is delivered to. """ - institution_number: str + name: NotRequired[str] """ - Institution number of the customer's bank. + The name of the recipient the ticket is delivered to. """ - transit_number: str + phone: NotRequired[str] """ - Transit number of the customer's bank. + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodDataAffirm(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAlipay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAlma(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): - account_number: str + class CaptureParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlightAffiliate" + ] """ - The account number for the bank account. + Affiliate details for this purchase. """ - bsb_number: str + agency_number: NotRequired[str] """ - Bank-State-Branch number of the bank account. + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. """ - - class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired[str] + carrier: NotRequired[str] """ - Account number of the bank account that the funds will be debited from. + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. """ - sort_code: NotRequired[str] + delivery: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlightDelivery" + ] """ - Sort code of the bank account. (e.g., `10-20-30`) + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlightPassenger" + ] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlightSegment" + ] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - class ConfirmParamsPaymentMethodDataBancontact(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataBillie(TypedDict): - pass + class CaptureParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ - class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): - address: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" + class CaptureParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsFlightDeliveryRecipient" ] """ - Billing address. + Details of the recipient. """ - email: NotRequired["Literal['']|str"] + + class CaptureParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Email address. + The email of the recipient the ticket is delivered to. """ - name: NotRequired["Literal['']|str"] + name: NotRequired[str] """ - Full name. + The name of the recipient the ticket is delivered to. """ - phone: NotRequired["Literal['']|str"] + phone: NotRequired[str] """ - Billing phone number (including extension). + The phone number of the recipient the ticket is delivered to. """ - tax_id: NotRequired[str] + + class CaptureParamsPaymentDetailsFlightPassenger(TypedDict): + name: str """ - Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + Full name of the person or entity on the flight reservation. """ - class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired[str] + class CaptureParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - City, district, suburb, town, or village. + The flight segment amount. """ - country: NotRequired[str] + arrival_airport: NotRequired[str] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + The International Air Transport Association (IATA) airport code for the arrival airport. """ - line1: NotRequired[str] + arrives_at: NotRequired[int] """ - Address line 1 (e.g., street, PO Box, or company name). + The arrival time for the flight segment. Measured in seconds since the Unix epoch. """ - line2: NotRequired[str] + carrier: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. """ - postal_code: NotRequired[str] + departs_at: int """ - ZIP or postal code. + The departure time for the flight segment. Measured in seconds since the Unix epoch. """ - state: NotRequired[str] + departure_airport: NotRequired[str] """ - State, county, province, or region. + The International Air Transport Association (IATA) airport code for the departure airport. """ - - class ConfirmParamsPaymentMethodDataBlik(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataBoleto(TypedDict): - tax_id: str + flight_number: NotRequired[str] """ - The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. """ - class ConfirmParamsPaymentMethodDataCashapp(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataEps(TypedDict): - bank: NotRequired[ - Literal[ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau", - ] + class CaptureParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodgingAddress" ] """ - The customer's bank. + The lodging location's address. """ - - class ConfirmParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + adults: NotRequired[int] """ - Account holder type for FPX transaction + The number of adults on the booking """ - bank: Literal[ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob", + affiliate: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodgingAffiliate" ] """ - The customer's bank. + Affiliate details for this purchase. """ - - class ConfirmParamsPaymentMethodDataGiropay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataIdeal(TypedDict): - bank: NotRequired[ - Literal[ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "n26", - "nn", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot", - "yoursafe", - ] - ] + booking_number: NotRequired[str] """ - The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + The booking number associated with the lodging reservation. """ - - class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKlarna(TypedDict): - dob: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" - ] + category: NotRequired[Literal["hotel", "vacation_rental"]] """ - Customer's date of birth + The lodging category """ - - class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): - day: int + checkin_at: int """ - The day of birth, between 1 and 31. + Lodging check-in time. Measured in seconds since the Unix epoch. """ - month: int + checkout_at: int """ - The month of birth, between 1 and 12. + Lodging check-out time. Measured in seconds since the Unix epoch. """ - year: int + customer_service_phone_number: NotRequired[str] """ - The four-digit year of birth. + The customer service phone number of the lodging company. """ - - class ConfirmParamsPaymentMethodDataKonbini(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataKrCard(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataLink(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + daily_room_rate_amount: NotRequired[int] """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + The daily lodging room rate. """ - - class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): - account_holder_name: NotRequired[str] + delivery: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodgingDelivery" + ] """ - The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + Delivery details for this purchase. """ - account_number: str + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] """ - The account number for the bank account. + List of additional charges being billed. """ - bank_code: str + fire_safety_act_compliance: NotRequired[bool] """ - The numeric code for the bank account's bank. + Indicates whether the lodging location is compliant with the Fire Safety Act. """ - branch_code: str + name: NotRequired[str] """ - The numeric code for the bank account's bank branch. + The name of the lodging location. """ - reference: NotRequired[str] - suffix: str + no_show: NotRequired[bool] """ - The suffix of the bank account number. + Indicates if the customer did not keep their booking while failing to cancel the reservation. """ - - class ConfirmParamsPaymentMethodDataOxxo(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataP24(TypedDict): - bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodgingPassenger" ] ] """ - The customer's bank. + The details of the passengers in the travel reservation """ - - class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPayco(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPaynow(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPaypal(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPix(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired[str] + property_phone_number: NotRequired[str] """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + The phone number of the lodging location. """ - - class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSatispay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): - iban: str + room_class: NotRequired[str] """ - IBAN of the bank account. + The room class for this purchase. """ - - class ConfirmParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + room_nights: NotRequired[int] """ - Two-letter ISO code representing the country the bank account is located in. + The number of room nights """ - - class ConfirmParamsPaymentMethodDataSwish(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataTwint(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + total_room_tax_amount: NotRequired[int] """ - Account holder type: individual or company. + The total tax amount associating with the room reservation. """ - account_number: NotRequired[str] + total_tax_amount: NotRequired[int] """ - Account number of the bank account. + The total tax amount """ - account_type: NotRequired[Literal["checking", "savings"]] + + class CaptureParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] """ - Account type: checkings or savings. Defaults to checking if omitted. + City, district, suburb, town, or village. """ - financial_connections_account: NotRequired[str] + country: NotRequired[str] """ - The ID of a Financial Connections Account to use as a payment method. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - routing_number: NotRequired[str] + line1: NotRequired[str] """ - Routing number of the bank account. + Address line 1 (e.g., street, PO Box, or company name). """ - - class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): - pass - - class ConfirmParamsPaymentMethodDataZip(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptions(TypedDict): - acss_debit: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebit" - ] + line2: NotRequired[str] """ - If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + Address line 2 (e.g., apartment, suite, unit, or building). """ - affirm: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAffirm" - ] + postal_code: NotRequired[str] """ - If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + ZIP or postal code. """ - afterpay_clearpay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" - ] + state: NotRequired[str] """ - If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + State, county, province, or region. """ - alipay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlipay" - ] + + class CaptureParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str """ - If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + The name of the affiliate that originated the purchase. """ - alma: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlma" - ] + + class CaptureParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + The delivery method for the payment """ - amazon_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" + recipient: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsLodgingDeliveryRecipient" ] """ - If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + Details of the recipient. """ - au_becs_debit: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAuBecsDebit" - ] + + class CaptureParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + The email of the recipient the ticket is delivered to. """ - bacs_debit: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebit" - ] + name: NotRequired[str] """ - If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + The name of the recipient the ticket is delivered to. """ - bancontact: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBancontact" - ] + phone: NotRequired[str] """ - If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + The phone number of the recipient the ticket is delivered to. """ - billie: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBillie" - ] + + class CaptureParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str """ - If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + Full name of the person or entity on the lodging reservation. """ - blik: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBlik" + + class CaptureParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsSubscriptionAffiliate" ] """ - If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + Affiliate details for this purchase. """ - boleto: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBoleto" - ] + auto_renewal: NotRequired[bool] """ - If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + Info whether the subscription will be auto renewed upon expiry. """ - card: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCard" + billing_interval: NotRequired[ + "PaymentIntentService.CaptureParamsPaymentDetailsSubscriptionBillingInterval" ] """ - Configuration for any card payments attempted on this PaymentIntent. + Subscription billing details for this purchase. """ - card_present: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresent" - ] + ends_at: NotRequired[int] """ - If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + Subscription end time. Measured in seconds since the Unix epoch. """ - cashapp: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCashapp" - ] + name: str """ - If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + Name of the product on subscription. e.g. Apple Music Subscription """ - customer_balance: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalance" - ] + starts_at: NotRequired[int] """ - If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + Subscription start time. Measured in seconds since the Unix epoch. """ - eps: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsEps" - ] + + class CaptureParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str """ - If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + The name of the affiliate that originated the purchase. """ - fpx: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsFpx" - ] + + class CaptureParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int """ - If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - giropay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGiropay" - ] + interval: Literal["day", "month", "week", "year"] """ - If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - grabpay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGrabpay" - ] + + class CaptureParamsTransferData(TypedDict): + amount: NotRequired[int] """ - If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + The amount that will be transferred automatically when a charge succeeds. """ - ideal: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdeal" - ] + + class ConfirmParams(TypedDict): + application_fee_amount: NotRequired["Literal['']|int"] """ - If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - interac_present: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsInteracPresent" + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] ] """ - If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + Controls when the funds will be captured from the customer's account. """ - kakao_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKakaoPay" - ] + confirmation_token: NotRequired[str] """ - If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ - klarna: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarna" - ] + error_on_requires_action: NotRequired[bool] """ - If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). """ - konbini: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKonbini" - ] + expand: NotRequired[List[str]] """ - If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + Specifies which fields in the response should be expanded. """ - kr_card: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKrCard" - ] + fx_quote: NotRequired[str] """ - If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. """ - link: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsLink" - ] + hooks: NotRequired["PaymentIntentService.ConfirmParamsHooks"] """ - If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + Automations to be run during the PaymentIntent lifecycle """ - mobilepay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMobilepay" - ] + mandate: NotRequired[str] """ - If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + ID of the mandate that's used for this payment. """ - multibanco: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMultibanco" + mandate_data: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsMandateData" ] + off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ - If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ - naver_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNaverPay" + payment_details: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentDetails" ] """ - If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + Provides industry-specific information about the charge. """ - nz_bank_account: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNzBankAccount" - ] + payment_method: NotRequired[str] """ - If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + If the payment method is attached to a Customer, it must match the [customer](https://stripe.com/docs/api#create_payment_intent-customer) that is set on this PaymentIntent. """ - oxxo: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" + payment_method_data: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodData" ] """ - If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. """ - p24: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsP24" + payment_method_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptions" ] """ - If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + Payment method-specific configuration for this PaymentIntent. """ - pay_by_bank: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayByBank" - ] + payment_method_types: NotRequired[List[str]] """ - If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ - payco: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayco" + radar_options: NotRequired[ + "PaymentIntentService.ConfirmParamsRadarOptions" ] """ - If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ - paynow: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaynow" - ] + receipt_email: NotRequired["Literal['']|str"] """ - If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - paypal: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaypal" - ] + return_url: NotRequired[str] """ - If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + This parameter is only used for cards and other redirect-based payment methods. """ - pix: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPix" + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']" ] """ - If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - promptpay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPromptpay" + shipping: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsShipping" ] """ - If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - """ - revolut_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsRevolutPay" - ] + Shipping information for this PaymentIntent. """ - If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + use_stripe_sdk: NotRequired[bool] """ - samsung_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSamsungPay" - ] + Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ - If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + + class ConfirmParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntentService.ConfirmParamsHooksInputs"] """ - satispay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSatispay" - ] + Arguments passed in automations """ - If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + + class ConfirmParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntentService.ConfirmParamsHooksInputsTax"] """ - sepa_debit: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" - ] + Tax arguments for automations """ - If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + + class ConfirmParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] """ - sofort: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSofort" - ] + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id """ - If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - """ - swish: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSwish" + + class ConfirmParamsMandateData(TypedDict): + customer_acceptance: NotRequired[ + "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptance" ] """ - If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + This hash contains details about the customer acceptance of the Mandate. """ - twint: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsTwint" - ] + + class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): + accepted_at: NotRequired[int] """ - If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + The time at which the customer accepted the Mandate. """ - us_bank_account: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" + offline: NotRequired[ + "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ - If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ - wechat_pay: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsWechatPay" + online: NotRequired[ + "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ - If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + If this is a Mandate accepted online, this hash contains details about the online acceptance. """ - zip: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsZip" - ] + type: Literal["offline", "online"] """ - If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ - class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" + class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): + pass + + class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: NotRequired[str] + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ + + class ConfirmParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRental" ] """ - Additional fields for Mandate creation + Car rental details for this PaymentIntent. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsEventDetails" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Event details for this PaymentIntent """ - target_date: NotRequired[str] + flight: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlight" + ] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Flight reservation details for this PaymentIntent """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + lodging: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodging" ] """ - Bank account verification method. + Lodging reservation details for this PaymentIntent """ - - class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): - custom_mandate_url: NotRequired["Literal['']|str"] + order_reference: NotRequired["Literal['']|str"] """ - A URL for custom mandate text to render during confirmation step. - The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + A unique value assigned by the business to identify the transaction. """ - interval_description: NotRequired[str] + subscription: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsSubscription" + ] """ - Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + Subscription details for this PaymentIntent """ - payment_schedule: NotRequired[ - Literal["combined", "interval", "sporadic"] + + class ConfirmParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalAffiliate" ] """ - Payment schedule for the mandate. + Affiliate details for this purchase. """ - transaction_type: NotRequired[Literal["business", "personal"]] + booking_number: str """ - Transaction type of the mandate. + The booking number associated with the car rental. """ - - class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + car_class_code: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Class code of the car. """ - preferred_locale: NotRequired[str] + car_make: NotRequired[str] """ - Preferred language of the Affirm authorization page that the customer is redirected to. + Make of the car. """ - setup_future_usage: NotRequired[Literal["none"]] + car_model: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Model of the car. """ - - class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + company: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The name of the rental car company. """ - reference: NotRequired[str] + customer_service_phone_number: NotRequired[str] """ - An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. - This field differs from the statement descriptor and item name. + The customer service phone number of the car rental company. """ - setup_future_usage: NotRequired[Literal["none"]] + days_rented: int """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Number of days the car is being rented. """ - - class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + delivery: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalDelivery" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Delivery details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + distance: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalDistance" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The details of the distance traveled during the rental period. """ - - class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + drivers: NotRequired[ + List[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalDriver" + ] + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The details of the passengers in the travel reservation """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + List of additional charges being billed. """ - - class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalPickupAddress" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Car pick-up address. """ - target_date: NotRequired[str] + pickup_at: int """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Car pick-up time. Measured in seconds since the Unix epoch. """ - - class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" - ] + pickup_location_name: NotRequired[str] """ - Additional fields for Mandate creation + Name of the pickup location. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalReturnAddress" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Car return address. """ - target_date: NotRequired[str] + return_at: int """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. """ - class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + class ConfirmParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + class ConfirmParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Preferred language of the Bancontact authorization page that the customer is redirected to. + The delivery method for the payment """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + recipient: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The email of the recipient the ticket is delivered to. """ - - class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired[str] + name: NotRequired[str] """ - The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + The name of the recipient the ticket is delivered to. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - - class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired[int] + Distance traveled. """ - The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + unit: NotRequired[Literal["kilometers", "miles"]] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] """ - - class ConfirmParamsPaymentMethodOptionsCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Driver's identification number. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + driver_tax_number: NotRequired[str] """ - cvc_token: NotRequired[str] + Driver's tax number. """ - A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + name: str """ - installments: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallments" - ] + Full name of the person or entity on the car reservation. """ - Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - """ - mandate_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" - ] + class ConfirmParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - Configuration options for setting up an eMandate for cards issued in India. + City, district, suburb, town, or village. """ - moto: NotRequired[bool] + country: NotRequired[str] """ - When specified, this parameter indicates that a transaction will be marked - as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - parameter can only be provided during confirmation. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - network: NotRequired[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "girocard", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", - ] - ] + line1: NotRequired[str] """ - Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + Address line 1 (e.g., street, PO Box, or company name). """ - request_extended_authorization: NotRequired[ - Literal["if_available", "never"] - ] + line2: NotRequired[str] """ - Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + Address line 2 (e.g., apartment, suite, unit, or building). """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] + postal_code: NotRequired[str] """ - Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + ZIP or postal code. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + state: NotRequired[str] """ - Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + State, county, province, or region. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + + class ConfirmParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + City, district, suburb, town, or village. """ - request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] - ] + country: NotRequired[str] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - require_cvc_recollection: NotRequired[bool] + line1: NotRequired[str] """ - When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + Address line 1 (e.g., street, PO Box, or company name). """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + line2: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Address line 2 (e.g., apartment, suite, unit, or building). """ - statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] + postal_code: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + ZIP or postal code. """ - statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + state: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + State, county, province, or region. """ - three_d_secure: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" - ] + + class ConfirmParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - If 3D Secure authentication was performed with a third-party provider, - the authentication details to use for this payment. + Indicates if the tickets are digitally checked when entering the venue. """ - - class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired[bool] + address: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsEventDetailsAddress" + ] """ - Setting to true enables installments for this PaymentIntent. - This will cause the response to contain a list of available installment plans. - Setting to false will prevent any selected plan from applying to a charge. + The event location's address. """ - plan: NotRequired[ - "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" + affiliate: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsEventDetailsAffiliate" ] """ - The selected installment plan to use for this payment attempt. - This parameter can only be provided during confirmation. + Affiliate details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: NotRequired[int] + company: NotRequired[str] """ - For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + The name of the company """ - interval: NotRequired[Literal["month"]] + delivery: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsEventDetailsDelivery" + ] """ - For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. - One of `month`. + Delivery details for this purchase. """ - type: Literal["fixed_count"] + ends_at: NotRequired[int] """ - Type of installment plan, one of `fixed_count`. + Event end time. Measured in seconds since the Unix epoch. """ - - class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): - amount: int + genre: NotRequired[str] """ - Amount to be charged for future payments. + Type of the event entertainment (concert, sports event etc) """ - amount_type: Literal["fixed", "maximum"] + name: str """ - One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + The name of the event. """ - description: NotRequired[str] + starts_at: NotRequired[int] """ - A description of the mandate or subscription that is meant to be displayed to the customer. + Event start time. Measured in seconds since the Unix epoch. """ - end_date: NotRequired[int] + + class ConfirmParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + City, district, suburb, town, or village. """ - interval: Literal["day", "month", "sporadic", "week", "year"] + country: NotRequired[str] """ - Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - interval_count: NotRequired[int] + line1: NotRequired[str] """ - The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + Address line 1 (e.g., street, PO Box, or company name). """ - reference: str + line2: NotRequired[str] """ - Unique identifier for the mandate or subscription. + Address line 2 (e.g., apartment, suite, unit, or building). """ - start_date: int + postal_code: NotRequired[str] """ - Start date of the mandate or subscription. Start date should not be lesser than yesterday. + ZIP or postal code. """ - supported_types: NotRequired[List[Literal["india"]]] + state: NotRequired[str] """ - Specifies the type of mandates supported. Possible values are `india`. + State, county, province, or region. """ - class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired[bool] + class ConfirmParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + The name of the affiliate that originated the purchase. """ - request_incremental_authorization_support: NotRequired[bool] + + class ConfirmParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + The delivery method for the payment """ - routing: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresentRouting" + recipient: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient" ] """ - Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): - requested_priority: NotRequired[Literal["domestic", "international"]] + class ConfirmParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Routing requested priority + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[ - Literal["A", "C", "I", "N", "R", "U", "Y"] + class ConfirmParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlightAffiliate" ] """ - The `transStatus` returned from the card Issuer's ACS in the ARes. + Affiliate details for this purchase. """ - cryptogram: str + agency_number: NotRequired[str] """ - The cryptogram, also known as the "authentication value" (AAV, CAVV or - AEVV). This value is 20 bytes, base64-encoded into a 28-character string. - (Most 3D Secure providers will return the base64-encoded version, which - is what you should specify here.) + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. """ - electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlightDelivery" ] """ - The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - provider and indicates what degree of authentication was performed. + Delivery details for this purchase. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + passenger_name: NotRequired[str] """ - The exemption requested via 3DS and accepted by the issuer at authentication time. + The name of the person or entity on the reservation. """ - network_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + passengers: NotRequired[ + List[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlightPassenger" + ] ] """ - Network specific 3DS fields. Network specific arguments require an - explicit card brand choice. The parameter `payment_method_options.card.network`` - must be populated accordingly + The details of the passengers in the travel reservation. """ - requestor_challenge_indicator: NotRequired[str] + segments: List[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlightSegment" + ] """ - The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + The individual flight segments associated with the trip. """ - transaction_id: str + ticket_number: NotRequired[str] """ - For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server - Transaction ID (dsTransID). + The ticket number associated with the travel reservation. """ - version: Literal["1.0.2", "2.1.0", "2.2.0"] + + class ConfirmParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str """ - The version of 3D Secure that was performed. + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( - TypedDict, - ): - cartes_bancaires: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + class ConfirmParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsFlightDeliveryRecipient" ] """ - Cartes Bancaires-specific 3DS fields. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( - TypedDict, - ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + class ConfirmParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - The cryptogram calculation algorithm used by the card Issuer's ACS - to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. - messageExtension: CB-AVALGO + The email of the recipient the ticket is delivered to. """ - cb_exemption: NotRequired[str] + name: NotRequired[str] """ - The exemption indicator returned from Cartes Bancaires in the ARes. - message extension: CB-EXEMPTION; string (4 characters) - This is a 3 byte bitmap (low significant byte first and most significant - bit first) that has been Base64 encoded + The name of the recipient the ticket is delivered to. """ - cb_score: NotRequired[int] + phone: NotRequired[str] """ - The risk score returned from Cartes Bancaires in the ARes. - message extension: CB-SCORE; numeric value 0-99 + The phone number of the recipient the ticket is delivered to. """ - class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The fare class for the segment. """ - class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): - bank_transfer: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" + class ConfirmParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodgingAddress" ] """ - Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + The lodging location's address. """ - funding_type: NotRequired[Literal["bank_transfer"]] + adults: NotRequired[int] """ - The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + The number of adults on the booking """ - setup_future_usage: NotRequired[Literal["none"]] + affiliate: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodgingAffiliate" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Affiliate details for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( - TypedDict, - ): - eu_bank_transfer: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodgingDelivery" ] """ - Configuration for the eu_bank_transfer funding type. + Delivery details for this purchase. """ - requested_address_types: NotRequired[ + extra_charges: NotRequired[ List[ Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", ] ] ] """ - List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - - Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + List of additional charges being billed. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodgingPassenger" + ] ] """ - The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + The details of the passengers in the travel reservation """ - - class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( - TypedDict, - ): - country: str + property_phone_number: NotRequired[str] """ - The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + The phone number of the lodging location. """ - - class ConfirmParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + room_class: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The room class for this purchase. """ - - class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + room_nights: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The number of room nights """ - - class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + total_room_tax_amount: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The total tax amount associating with the room reservation. """ - - class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + total_tax_amount: NotRequired[int] + """ + The total tax amount """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class ConfirmParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class ConfirmParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. """ - class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + class ConfirmParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsLodgingDeliveryRecipient" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Details of the recipient. """ - class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - Controls when the funds are captured from the customer's account. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + class ConfirmParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsSubscriptionAffiliate" + ] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentDetailsSubscriptionBillingInterval" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. """ - class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. """ - Controls when the funds are captured from the customer's account. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + class ConfirmParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAcssDebit" + ] """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAffirm" ] """ - Preferred language of the Klarna authorization page that the customer is redirected to + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + afterpay_clearpay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAfterpayClearpay" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ - - class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): - confirmation_number: NotRequired["Literal['']|str"] + alipay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAlipay" + ] """ - An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - expires_after_days: NotRequired["Literal['']|int"] + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] """ - The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ - expires_at: NotRequired["Literal['']|int"] + alma: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAlma" + ] """ - The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. """ - product_description: NotRequired["Literal['']|str"] + amazon_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" + ] """ - A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + au_becs_debit: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ - - class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + bacs_debit: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBacsDebit" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + bancontact: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBancontact" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ - - class ConfirmParamsPaymentMethodOptionsLink(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + billie: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBillie" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. """ - persistent_token: NotRequired[str] + billing_details: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetails" + ] """ - [Deprecated] This is a legacy parameter that no longer has any function. + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + blik: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBlik" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ - - class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + boleto: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataBoleto" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + cashapp: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataCashapp" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + customer_balance: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ - - class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + eps: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataEps" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + fpx: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataFpx" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ - - class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + giropay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataGiropay" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ - target_date: NotRequired[str] + gopay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataGopay" + ] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. """ - - class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired[int] + grabpay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataGrabpay" + ] """ - The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + id_bank_transfer: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. """ - - class ConfirmParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + ideal: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataIdeal" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ - tos_shown_and_accepted: NotRequired[bool] + interac_present: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataInteracPresent" + ] """ - Confirm that the payer has accepted the P24 terms and conditions. + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ - - class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): - pass - - class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + kakao_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKakaoPay" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + klarna: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarna" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ - - class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + konbini: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKonbini" + ] """ - Controls when the funds will be captured from the customer's account. + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + kr_card: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKrCard" ] """ - [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. """ - reference: NotRequired[str] + link: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataLink" + ] """ - A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ - risk_correlation_id: NotRequired[str] + mb_way: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataMbWay" + ] """ - The risk correlation ID for an on-session payment using a saved PayPal payment method. + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + metadata: NotRequired[Dict[str, str]] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - - class ConfirmParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired[int] + mobilepay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataMobilepay" + ] """ - The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ - expires_at: NotRequired[int] + multibanco: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataMultibanco" + ] """ - The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ - setup_future_usage: NotRequired[Literal["none"]] + naver_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataNaverPay" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + nz_bank_account: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataNzBankAccount" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. """ - - class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + oxxo: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + p24: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataP24" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ - - class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + pay_by_bank: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayByBank" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. """ - - class ConfirmParamsPaymentMethodOptionsSatispay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + payco: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayco" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. """ - - class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" + paynow: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPaynow" ] """ - Additional fields for Mandate creation + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + paypal: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPaypal" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ - target_date: NotRequired[str] + payto: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayto" + ] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. """ - - class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + pix: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPix" + ] """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ - - class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): - preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + promptpay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPromptpay" ] """ - Language shown to the payer on redirect. + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + qris: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataQris" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. - """ - - class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] - """ - A reference for this payment to be displayed in the Swish app. - """ - setup_future_usage: NotRequired[Literal["none"]] - """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. """ - - class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + radar_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataRadarOptions" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ - - class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): - financial_connections: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" + rechnung: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataRechnung" ] """ - Additional fields for Financial Connections Session creation + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. """ - mandate_options: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" + revolut_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataRevolutPay" ] """ - Additional fields for Mandate creation + If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ - networks: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" + samsung_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSamsungPay" ] """ - Additional fields for network related functions + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" + satispay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSatispay" ] """ - Preferred transaction settlement speed + If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + sepa_debit: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - target_date: NotRequired[str] + shopeepay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataShopeepay" + ] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + sofort: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSofort" ] """ - Bank account verification method. + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ - - class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( - TypedDict, - ): - filters: NotRequired[ - "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + stripe_balance: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataStripeBalance" ] """ - Provide filters for the linked accounts that the customer can select for the payment method. + This hash contains details about the Stripe balance payment method. """ - permissions: NotRequired[ - List[ - Literal[ - "balances", "ownership", "payment_method", "transactions" - ] - ] + swish: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataSwish" ] """ - The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ - prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + twint: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataTwint" ] """ - List of data features that you would like to retrieve upon account creation. + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - return_url: NotRequired[str] + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "sepa_debit", + "shopeepay", + "sofort", + "stripe_balance", + "swish", + "twint", + "us_bank_account", + "wechat_pay", + "zip", + ] """ - For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ - - class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( - TypedDict, - ): - account_subcategories: NotRequired[ - List[Literal["checking", "savings"]] + us_bank_account: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataUsBankAccount" ] """ - The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ - - class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( - TypedDict, - ): - collection_method: NotRequired["Literal['']|Literal['paper']"] + wechat_pay: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataWechatPay" + ] """ - The method used to collect offline mandate customer acceptance. + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ - - class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + zip: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataZip" + ] """ - Triggers validations to run across the selected networks + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ - class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired[str] + class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + Customer's bank account number. """ - client: NotRequired[Literal["android", "ios", "web"]] + institution_number: str """ - The client type that the end customer will pay from + Institution number of the customer's bank. """ - setup_future_usage: NotRequired[Literal["none"]] + transit_number: str """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Transit number of the customer's bank. """ - class ConfirmParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] - """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. + class ConfirmParamsPaymentMethodDataAffirm(TypedDict): + pass - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class ConfirmParamsPaymentMethodDataAlipay(TypedDict): + pass - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class ConfirmParamsPaymentMethodDataAlma(TypedDict): + pass - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. - """ + class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): + pass - class ConfirmParamsRadarOptions(TypedDict): - session: NotRequired[str] - """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str """ - - class ConfirmParamsShipping(TypedDict): - address: "PaymentIntentService.ConfirmParamsShippingAddress" + The account number for the bank account. """ - Shipping address. + bsb_number: str """ - carrier: NotRequired[str] + Bank-State-Branch number of the bank account. """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + + class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired[str] """ - name: str + Account number of the bank account that the funds will be debited from. """ - Recipient name. + sort_code: NotRequired[str] """ - phone: NotRequired[str] + Sort code of the bank account. (e.g., `10-20-30`) """ - Recipient phone (including extension). + + class ConfirmParamsPaymentMethodDataBancontact(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBillie(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" + ] """ - tracking_number: NotRequired[str] + Billing address. """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + email: NotRequired["Literal['']|str"] + """ + Email address. + """ + name: NotRequired["Literal['']|str"] + """ + Full name. + """ + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + tax_id: NotRequired[str] + """ + Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. """ - class ConfirmParamsShippingAddress(TypedDict): + class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. @@ -2749,1295 +2234,1341 @@ class ConfirmParamsShippingAddress(TypedDict): State, county, province, or region. """ - class CreateParams(TypedDict): - amount: int - """ - Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - """ - application_fee_amount: NotRequired[int] - """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - """ - automatic_payment_methods: NotRequired[ - "PaymentIntentService.CreateParamsAutomaticPaymentMethods" - ] + class ConfirmParamsPaymentMethodDataBlik(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str """ - When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + + class ConfirmParamsPaymentMethodDataCashapp(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] ] """ - Controls when the funds will be captured from the customer's account. - """ - confirm: NotRequired[bool] + The customer's bank. """ - Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + + class ConfirmParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] """ - confirmation_method: NotRequired[Literal["automatic", "manual"]] + Account holder type for FPX transaction """ - Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] """ - confirmation_token: NotRequired[str] + The customer's bank. """ - ID of the ConfirmationToken used to confirm this PaymentIntent. - If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + class ConfirmParamsPaymentMethodDataGiropay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataGopay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] """ - currency: str + Bank where the account is held. """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] """ - customer: NotRequired[str] + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. """ - ID of the Customer this PaymentIntent belongs to, if one exists. - Payment methods attached to other Customers cannot be used with this PaymentIntent. + class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): + pass - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. - """ - description: NotRequired[str] - """ - An arbitrary string attached to the object. Often useful for displaying to users. - """ - error_on_requires_action: NotRequired[bool] + class ConfirmParamsPaymentMethodDataKakaoPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" + ] """ - Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + Customer's date of birth """ - expand: NotRequired[List[str]] + + class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int """ - Specifies which fields in the response should be expanded. + The day of birth, between 1 and 31. """ - mandate: NotRequired[str] + month: int """ - ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + The month of birth, between 1 and 12. """ - mandate_data: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsMandateData" - ] + year: int """ - This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + The four-digit year of birth. """ - metadata: NotRequired[Dict[str, str]] + + class ConfirmParamsPaymentMethodDataKonbini(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataKrCard(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataLink(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMbWay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ - off_session: NotRequired["bool|Literal['one_off', 'recurring']"] + + class ConfirmParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] """ - Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. """ - on_behalf_of: NotRequired[str] + account_number: str """ - The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The account number for the bank account. """ - payment_method: NotRequired[str] + bank_code: str """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. - - If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. - If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent. - end + The numeric code for the bank account's bank. """ - payment_method_configuration: NotRequired[str] + branch_code: str """ - The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + The numeric code for the bank account's bank branch. """ - payment_method_data: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodData" - ] + reference: NotRequired[str] + suffix: str """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + The suffix of the bank account number. """ - payment_method_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptions" + + class ConfirmParamsPaymentMethodDataOxxo(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] ] """ - Payment method-specific configuration for this PaymentIntent. - """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - """ - radar_options: NotRequired[ - "PaymentIntentService.CreateParamsRadarOptions" - ] + The customer's bank. """ - Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPayco(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPaynow(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPaypal(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] """ - receipt_email: NotRequired[str] + The account number for the bank account. """ - Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + bsb_number: NotRequired[str] """ - return_url: NotRequired[str] + Bank-State-Branch number of the bank account. """ - The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + pay_id: NotRequired[str] """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + The PayID alias for the bank account. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class ConfirmParamsPaymentMethodDataPix(TypedDict): + pass - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): + pass - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class ConfirmParamsPaymentMethodDataQris(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired[str] """ - shipping: NotRequired["PaymentIntentService.CreateParamsShipping"] + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ - Shipping information for this PaymentIntent. + + class ConfirmParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntentService.ConfirmParamsPaymentMethodDataRechnungDob" """ - statement_descriptor: NotRequired[str] + Customer's date of birth """ - Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. - """ - statement_descriptor_suffix: NotRequired[str] + class ConfirmParamsPaymentMethodDataRechnungDob(TypedDict): + day: int """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + The day of birth, between 1 and 31. """ - transfer_data: NotRequired[ - "PaymentIntentService.CreateParamsTransferData" - ] + month: int """ - The parameters that you can use to automatically create a Transfer. - Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The month of birth, between 1 and 12. """ - transfer_group: NotRequired[str] + year: int """ - A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + The four-digit year of birth. """ - use_stripe_sdk: NotRequired[bool] + + class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSamsungPay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSatispay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str """ - Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + IBAN of the bank account. """ - class CreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired[Literal["always", "never"]] + class ConfirmParamsPaymentMethodDataShopeepay(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + """ + Two-letter ISO code representing the country the bank account is located in. """ - Controls whether this PaymentIntent will accept redirect-based payment methods. - Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + class ConfirmParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] """ - enabled: bool + The connected account ID whose Stripe balance to use as the source of payment """ - Whether this feature is enabled. + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance """ - class CreateParamsMandateData(TypedDict): - customer_acceptance: ( - "PaymentIntentService.CreateParamsMandateDataCustomerAcceptance" - ) + class ConfirmParamsPaymentMethodDataSwish(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataTwint(TypedDict): + pass + + class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] """ - This hash contains details about the customer acceptance of the Mandate. + Account holder type: individual or company. """ - - class CreateParamsMandateDataCustomerAcceptance(TypedDict): - accepted_at: NotRequired[int] + account_number: NotRequired[str] """ - The time at which the customer accepted the Mandate. + Account number of the bank account. """ - offline: NotRequired[ - "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOffline" - ] + account_type: NotRequired[Literal["checking", "savings"]] """ - If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + Account type: checkings or savings. Defaults to checking if omitted. """ - online: NotRequired[ - "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOnline" - ] + financial_connections_account: NotRequired[str] """ - If this is a Mandate accepted online, this hash contains details about the online acceptance. + The ID of a Financial Connections Account to use as a payment method. """ - type: Literal["offline", "online"] + routing_number: NotRequired[str] """ - The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + Routing number of the bank account. """ - class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): + class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): pass - class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): - ip_address: str - """ - The IP address from which the Mandate was accepted by the customer. - """ - user_agent: str - """ - The user agent of the browser from which the Mandate was accepted by the customer. - """ + class ConfirmParamsPaymentMethodDataZip(TypedDict): + pass - class CreateParamsPaymentMethodData(TypedDict): + class ConfirmParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAcssDebit" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebit" ] """ - If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAffirm" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAffirm" ] """ - If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAfterpayClearpay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" ] """ - If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAlipay" - ] - """ - If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - """ - allow_redisplay: NotRequired[ - Literal["always", "limited", "unspecified"] + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlipay" ] """ - This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ alma: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAlma" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlma" ] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. """ amazon_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataAuBecsDebit" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAuBecsDebit" ] """ - If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBacsDebit" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebit" ] """ - If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBancontact" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBancontact" ] """ - If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ billie: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBillie" - ] - """ - If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. - """ - billing_details: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBillingDetails" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBillie" ] """ - Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. """ blik: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBlik" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBlik" ] """ - If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataBoleto" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBoleto" ] """ - If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ - cashapp: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataCashapp" + card: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCard" ] """ - If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + Configuration for any card payments attempted on this PaymentIntent. """ - customer_balance: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataCustomerBalance" + card_present: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresent" ] """ - If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ - eps: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataEps" - ] + cashapp: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCashapp" + ] """ - If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + """ + customer_balance: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalance" + ] + """ + If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + """ + eps: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsEps" + ] + """ + If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataFpx" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsFpx" ] """ - If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataGiropay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGiropay" ] """ - If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + """ + gopay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGopay" + ] + """ + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. """ grabpay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataGrabpay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGrabpay" ] """ - If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. """ ideal: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataIdeal" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdeal" ] """ - If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataInteracPresent" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsInteracPresent" ] """ - If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ kakao_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataKakaoPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKakaoPay" ] """ - If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. """ klarna: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataKlarna" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarna" ] """ - If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataKonbini" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKonbini" ] """ - If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ kr_card: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataKrCard" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKrCard" ] """ - If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. """ link: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataLink" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsLink" ] """ - If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ - metadata: NotRequired[Dict[str, str]] + mb_way: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMbWay" + ] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. """ mobilepay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataMobilepay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMobilepay" ] """ - If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataMultibanco" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMultibanco" ] """ - If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ naver_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataNaverPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNaverPay" ] """ - If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. """ nz_bank_account: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataNzBankAccount" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsNzBankAccount" ] """ - If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. """ oxxo: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] """ - If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataP24" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsP24" ] """ - If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ pay_by_bank: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPayByBank" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayByBank" ] """ - If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. """ payco: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPayco" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayco" ] """ - If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. """ paynow: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPaynow" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaynow" ] """ - If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPaypal" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaypal" ] """ - If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + """ + payto: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. """ pix: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPix" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPix" ] """ - If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataPromptpay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPromptpay" ] """ - If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ - radar_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataRadarOptions" + qris: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsQris" ] """ - Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. + """ + rechnung: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. """ revolut_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataRevolutPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsRevolutPay" ] """ - If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ samsung_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataSamsungPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSamsungPay" ] """ - If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. """ satispay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataSatispay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSatispay" ] """ - If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. """ sepa_debit: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataSepaDebit" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" ] """ - If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + """ + shopeepay: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsShopeepay" + ] + """ + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. """ sofort: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataSofort" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSofort" ] """ - If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ - swish: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataSwish" + stripe_balance: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsStripeBalance" ] """ - If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ - twint: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataTwint" + swish: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSwish" ] """ - If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "blik", - "boleto", - "cashapp", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "sepa_debit", - "sofort", - "swish", - "twint", - "us_bank_account", - "wechat_pay", - "zip", + twint: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsTwint" ] """ - The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataUsBankAccount" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] """ - If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataWechatPay" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsWechatPay" ] """ - If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataZip" + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsZip" ] """ - If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ - class CreateParamsPaymentMethodDataAcssDebit(TypedDict): - account_number: str - """ - Customer's bank account number. - """ - institution_number: str - """ - Institution number of the customer's bank. + class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" + ] """ - transit_number: str + Additional fields for Mandate creation """ - Transit number of the customer's bank. + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataAffirm(TypedDict): - pass - - class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): - pass - - class CreateParamsPaymentMethodDataAlipay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataAlma(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataAmazonPay(TypedDict): - pass + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): - account_number: str + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - The account number for the bank account. - """ - bsb_number: str - """ - Bank-State-Branch number of the bank account. - """ - - class CreateParamsPaymentMethodDataBacsDebit(TypedDict): - account_number: NotRequired[str] - """ - Account number of the bank account that the funds will be debited from. - """ - sort_code: NotRequired[str] + target_date: NotRequired[str] """ - Sort code of the bank account. (e.g., `10-20-30`) + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - - class CreateParamsPaymentMethodDataBancontact(TypedDict): - pass - - class CreateParamsPaymentMethodDataBillie(TypedDict): - pass - - class CreateParamsPaymentMethodDataBillingDetails(TypedDict): - address: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] ] """ - Billing address. + Bank account verification method. """ - email: NotRequired["Literal['']|str"] + + class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): + custom_mandate_url: NotRequired["Literal['']|str"] """ - Email address. + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - name: NotRequired["Literal['']|str"] + interval_description: NotRequired[str] """ - Full name. + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - phone: NotRequired["Literal['']|str"] + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] """ - Billing phone number (including extension). + Payment schedule for the mandate. """ - tax_id: NotRequired[str] + transaction_type: NotRequired[Literal["business", "personal"]] """ - Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + Transaction type of the mandate. """ - class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): - city: NotRequired[str] - """ - City, district, suburb, town, or village. + class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - country: NotRequired[str] + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + preferred_locale: NotRequired[str] """ - line1: NotRequired[str] + Preferred language of the Affirm authorization page that the customer is redirected to. """ - Address line 1 (e.g., street, PO Box, or company name). + setup_future_usage: NotRequired[Literal["none"]] """ - line2: NotRequired[str] + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - Address line 2 (e.g., apartment, suite, unit, or building). + + class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - postal_code: NotRequired[str] + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - ZIP or postal code. + reference: NotRequired[str] """ - state: NotRequired[str] + An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + This field differs from the statement descriptor and item name. """ - State, county, province, or region. + setup_future_usage: NotRequired[Literal["none"]] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataBlik(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataBoleto(TypedDict): - tax_id: str + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + + class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataCashapp(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataEps(TypedDict): - bank: NotRequired[ - Literal[ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau", - ] - ] + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - The customer's bank. + + class ConfirmParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ + Controls when the funds are captured from the customer's account. - class CreateParamsPaymentMethodDataFpx(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - Account holder type for FPX transaction + + class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - bank: Literal[ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob", - ] + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - The customer's bank. + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataGiropay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataGrabpay(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataIdeal(TypedDict): - bank: NotRequired[ - Literal[ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "n26", - "nn", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot", - "yoursafe", - ] - ] + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + + class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataInteracPresent(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataKakaoPay(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataKlarna(TypedDict): - dob: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodDataKlarnaDob" - ] + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - Customer's date of birth + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): - day: int - """ - The day of birth, between 1 and 31. - """ - month: int - """ - The month of birth, between 1 and 12. + class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] """ - year: int + Additional fields for Mandate creation """ - The four-digit year of birth. + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataKonbini(TypedDict): - pass - - class CreateParamsPaymentMethodDataKrCard(TypedDict): - pass - - class CreateParamsPaymentMethodDataLink(TypedDict): - pass - - class CreateParamsPaymentMethodDataMobilepay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataMultibanco(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] - """ - Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. - """ + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): - account_holder_name: NotRequired[str] - """ - The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. - """ - account_number: str - """ - The account number for the bank account. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - bank_code: str + target_date: NotRequired[str] """ - The numeric code for the bank account's bank. + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - branch_code: str + + class ConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] """ - The numeric code for the bank account's bank branch. + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. """ - reference: NotRequired[str] - suffix: str + + class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ - The suffix of the bank account number. + Preferred language of the Bancontact authorization page that the customer is redirected to. """ - - class CreateParamsPaymentMethodDataOxxo(TypedDict): - pass - - class CreateParamsPaymentMethodDataP24(TypedDict): - bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - The customer's bank. - """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataPayByBank(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataPayco(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataPaynow(TypedDict): - pass + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataPaypal(TypedDict): - pass + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ - class CreateParamsPaymentMethodDataPix(TypedDict): - pass + class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. - class CreateParamsPaymentMethodDataPromptpay(TypedDict): - pass + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - class CreateParamsPaymentMethodDataRadarOptions(TypedDict): - session: NotRequired[str] + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + + class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataRevolutPay(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataSamsungPay(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataSatispay(TypedDict): - pass + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - class CreateParamsPaymentMethodDataSepaDebit(TypedDict): - iban: str - """ - IBAN of the bank account. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): + expires_after_days: NotRequired[int] """ - Two-letter ISO code representing the country the bank account is located in. + The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodDataSwish(TypedDict): - pass + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodDataTwint(TypedDict): - pass + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] - """ - Account holder type: individual or company. + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - account_number: NotRequired[str] + + class ConfirmParamsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Account number of the bank account. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - account_type: NotRequired[Literal["checking", "savings"]] + cvc_token: NotRequired[str] """ - Account type: checkings or savings. Defaults to checking if omitted. + A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ - financial_connections_account: NotRequired[str] + installments: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallments" + ] """ - The ID of a Financial Connections Account to use as a payment method. + Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + + For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ - routing_number: NotRequired[str] + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" + ] """ - Routing number of the bank account. + Configuration options for setting up an eMandate for cards issued in India. """ - - class CreateParamsPaymentMethodDataWechatPay(TypedDict): - pass - - class CreateParamsPaymentMethodDataZip(TypedDict): - pass - - class CreateParamsPaymentMethodOptions(TypedDict): - acss_debit: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebit" - ] + moto: NotRequired[bool] """ - If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + When specified, this parameter indicates that a transaction will be marked + as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + parameter can only be provided during confirmation. """ - affirm: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAffirm" + network: NotRequired[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "girocard", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ - If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ - afterpay_clearpay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAfterpayClearpay" + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. """ - alipay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlipay" + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ - alma: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlma" + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ - amazon_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAmazonPay" - ] + request_multicapture: NotRequired[Literal["if_available", "never"]] """ - If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ - au_becs_debit: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAuBecsDebit" - ] + request_overcapture: NotRequired[Literal["if_available", "never"]] """ - If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ - bacs_debit: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebit" + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] ] """ - If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + Request partial authorization on this PaymentIntent. """ - bancontact: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBancontact" + request_three_d_secure: NotRequired[ + Literal["any", "automatic", "challenge"] ] """ - If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ - billie: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBillie" - ] + require_cvc_recollection: NotRequired[bool] """ - If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ - blik: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBlik" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ - If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - boleto: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBoleto" - ] + statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ - If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ - card: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCard" - ] + statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ - Configuration for any card payments attempted on this PaymentIntent. + Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ - card_present: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresent" + statement_details: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardStatementDetails" ] """ - If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ - cashapp: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCashapp" + three_d_secure: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] """ - If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. """ - customer_balance: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalance" - ] + + class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): + enabled: NotRequired[bool] """ - If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + Setting to true enables installments for this PaymentIntent. + This will cause the response to contain a list of available installment plans. + Setting to false will prevent any selected plan from applying to a charge. """ - eps: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsEps" + plan: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ - If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. """ - fpx: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsFpx" - ] + + class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] """ - If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. """ - giropay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGiropay" - ] + interval: NotRequired[Literal["month"]] """ - If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + One of `month`. """ - grabpay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGrabpay" - ] + type: Literal["fixed_count"] """ - If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + Type of installment plan, one of `fixed_count`. """ - ideal: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdeal" - ] + + class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): + amount: int """ - If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + Amount to be charged for future payments. """ - interac_present: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsInteracPresent" - ] + amount_type: Literal["fixed", "maximum"] """ - If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ - kakao_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKakaoPay" - ] + description: NotRequired[str] """ - If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + A description of the mandate or subscription that is meant to be displayed to the customer. """ - klarna: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKlarna" - ] + end_date: NotRequired[int] """ - If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ - konbini: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKonbini" - ] + interval: Literal["day", "month", "sporadic", "week", "year"] """ - If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ - kr_card: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKrCard" - ] + interval_count: NotRequired[int] """ - If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ - link: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsLink" - ] + reference: str """ - If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + Unique identifier for the mandate or subscription. """ - mobilepay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMobilepay" - ] + start_date: int """ - If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ - multibanco: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMultibanco" - ] + supported_types: NotRequired[List[Literal["india"]]] """ - If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + Specifies the type of mandates supported. Possible values are `india`. """ - naver_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNaverPay" - ] + + class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): + request_extended_authorization: NotRequired[bool] """ - If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ - nz_bank_account: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNzBankAccount" - ] + request_incremental_authorization_support: NotRequired[bool] """ - If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ - oxxo: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" + routing: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresentRouting" ] """ - If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ - p24: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsP24" - ] + + class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] """ - If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + Routing requested priority """ - pay_by_bank: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayByBank" + + class ConfirmParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardStatementDetailsAddress" ] """ - If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + Please pass in an address that is within your Stripe user account country """ - payco: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayco" - ] + phone: NotRequired[str] """ - If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + Phone number (e.g., a toll-free number that customers can call) """ - paynow: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaynow" - ] + + class ConfirmParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] """ - If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + City, district, suburb, town, or village. """ - paypal: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaypal" - ] + country: NotRequired[str] """ - If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - pix: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPix" - ] + line1: NotRequired[str] """ - If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + Address line 1 (e.g., street, PO Box, or company name). """ - promptpay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPromptpay" - ] + line2: NotRequired[str] """ - If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + Address line 2 (e.g., apartment, suite, unit, or building). """ - revolut_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsRevolutPay" - ] + postal_code: NotRequired[str] """ - If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + ZIP or postal code. """ - samsung_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSamsungPay" - ] + state: NotRequired[str] """ - If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + State, county, province, or region. """ - satispay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSatispay" + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ - If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + The `transStatus` returned from the card Issuer's ACS in the ARes. """ - sepa_debit: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebit" - ] + cryptogram: str """ - If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) """ - sofort: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSofort" - ] + electronic_commerce_indicator: NotRequired[ + Literal["01", "02", "05", "06", "07"] + ] """ - If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. """ - swish: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSwish" - ] + exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ - If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + The exemption requested via 3DS and accepted by the issuer at authentication time. """ - twint: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsTwint" + network_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ - If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly """ - us_bank_account: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" - ] + requestor_challenge_indicator: NotRequired[str] """ - If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ - wechat_pay: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsWechatPay" - ] + transaction_id: str """ - If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). """ - zip: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsZip" - ] + version: Literal["1.0.2", "2.1.0", "2.2.0"] """ - If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + The version of 3D Secure that was performed. """ - class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ - Additional fields for Mandate creation + Cartes Bancaires-specific 3DS fields. + """ + + class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired[str] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired[int] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ + + class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" @@ -4053,51 +3584,17 @@ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] - """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. - """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] - """ - Bank account verification method. - """ - class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): - custom_mandate_url: NotRequired["Literal['']|str"] - """ - A URL for custom mandate text to render during confirmation step. - The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - """ - interval_description: NotRequired[str] - """ - Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - """ - payment_schedule: NotRequired[ - Literal["combined", "interval", "sporadic"] + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): + bank_transfer: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ - Payment schedule for the mandate. - """ - transaction_type: NotRequired[Literal["business", "personal"]] - """ - Transaction type of the mandate. - """ - - class CreateParamsPaymentMethodOptionsAffirm(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - preferred_locale: NotRequired[str] + funding_type: NotRequired[Literal["bank_transfer"]] """ - Preferred language of the Affirm authorization page that the customer is redirected to. + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -4112,20 +3609,53 @@ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - reference: NotRequired[str] + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] """ - An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. - This field differs from the statement descriptor and item name. + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + + class ConfirmParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4139,10 +3669,8 @@ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4155,28 +3683,22 @@ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAlma(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + Indicates that you intend to make future payments with this PaymentIntent's payment method. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. - """ + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + + class ConfirmParamsPaymentMethodOptionsGopay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4185,12 +3707,12 @@ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4202,21 +3724,17 @@ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] + + class ConfirmParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. """ - - class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" - ] + expires_at: NotRequired[int] """ - Additional fields for Mandate creation + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4228,22 +3746,8 @@ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - target_date: NotRequired[str] - """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. - """ - - class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] - """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. - """ - class CreateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] - """ - Preferred language of the Bancontact authorization page that the customer is redirected to. - """ + class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] @@ -4259,7 +3763,10 @@ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsBillie(TypedDict): + class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -4268,13 +3775,82 @@ class CreateParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - - class CreateParamsPaymentMethodOptionsBlik(TypedDict): - code: NotRequired[str] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ - The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4287,14 +3863,24 @@ class CreateParamsPaymentMethodOptionsBlik(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsBoleto(TypedDict): - expires_after_days: NotRequired[int] + class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): + confirmation_number: NotRequired["Literal['']|str"] """ - The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + expires_after_days: NotRequired["Literal['']|int"] + """ + The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + """ + expires_at: NotRequired["Literal['']|int"] + """ + The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + """ + product_description: NotRequired["Literal['']|str"] + """ + A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + """ + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4307,7 +3893,7 @@ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCard(TypedDict): + class ConfirmParamsPaymentMethodOptionsKrCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. @@ -4316,80 +3902,120 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - cvc_token: NotRequired[str] - """ - A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. - """ - installments: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallments" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + Indicates that you intend to make future payments with this PaymentIntent's payment method. - For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - mandate_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" - ] + + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Configuration options for setting up an eMandate for cards issued in India. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - moto: NotRequired[bool] + persistent_token: NotRequired[str] """ - When specified, this parameter indicates that a transaction will be marked - as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - parameter can only be provided during confirmation. + [Deprecated] This is a legacy parameter that no longer has any function. """ - network: NotRequired[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "girocard", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", - ] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - request_extended_authorization: NotRequired[ - Literal["if_available", "never"] - ] + + class ConfirmParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] - ] + + class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + setup_future_usage: NotRequired[Literal["none"]] """ - Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + + class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] - ] + + class ConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - require_cvc_recollection: NotRequired[bool] + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ - When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + + class ConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] @@ -4404,203 +4030,203 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] + target_date: NotRequired[str] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + + class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] """ - Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ - three_d_secure: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecure" - ] - """ - If 3D Secure authentication was performed with a third-party provider, - the authentication details to use for this payment. + setup_future_usage: NotRequired[Literal["none"]] """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): - enabled: NotRequired[bool] - """ - Setting to true enables installments for this PaymentIntent. - This will cause the response to contain a list of available installment plans. - Setting to false will prevent any selected plan from applying to a charge. - """ - plan: NotRequired[ - "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" - ] - """ - The selected installment plan to use for this payment attempt. - This parameter can only be provided during confirmation. - """ + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): - count: NotRequired[int] - """ - For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. - """ - interval: NotRequired[Literal["month"]] - """ - For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. - One of `month`. - """ - type: Literal["fixed_count"] - """ - Type of installment plan, one of `fixed_count`. - """ + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): - amount: int - """ - Amount to be charged for future payments. + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - amount_type: Literal["fixed", "maximum"] + + class ConfirmParamsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - description: NotRequired[str] + tos_shown_and_accepted: NotRequired[bool] """ - A description of the mandate or subscription that is meant to be displayed to the customer. + Confirm that the payer has accepted the P24 terms and conditions. """ - end_date: NotRequired[int] + + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - interval: Literal["day", "month", "sporadic", "week", "year"] + + class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - interval_count: NotRequired[int] + + class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + Controls when the funds will be captured from the customer's account. """ - reference: str + line_items: NotRequired[ + List[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaypalLineItem" + ] + ] """ - Unique identifier for the mandate or subscription. + The line items purchased by the customer. """ - start_date: int + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-DE", + "de-LU", + "el-GR", + "en-GB", + "en-US", + "es-ES", + "fi-FI", + "fr-BE", + "fr-FR", + "fr-LU", + "hu-HU", + "it-IT", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "sk-SK", + "sv-SE", + ] + ] """ - Start date of the mandate or subscription. Start date should not be lesser than yesterday. + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ - supported_types: NotRequired[List[Literal["india"]]] + reference: NotRequired[str] """ - Specifies the type of mandates supported. Possible values are `india`. + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - - class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): - request_extended_authorization: NotRequired[bool] + reference_id: NotRequired[str] """ - Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - request_incremental_authorization_support: NotRequired[bool] + risk_correlation_id: NotRequired[str] """ - Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + The risk correlation ID for an on-session payment using a saved PayPal payment method. """ - routing: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresentRouting" + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. - """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. - class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): - requested_priority: NotRequired[Literal["domestic", "international"]] - """ - Routing requested priority - """ + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[ - Literal["A", "C", "I", "N", "R", "U", "Y"] - ] - """ - The `transStatus` returned from the card Issuer's ACS in the ARes. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - cryptogram: str + subsellers: NotRequired[List[str]] """ - The cryptogram, also known as the "authentication value" (AAV, CAVV or - AEVV). This value is 20 bytes, base64-encoded into a 28-character string. - (Most 3D Secure providers will return the base64-encoded version, which - is what you should specify here.) + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. """ - electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + + class ConfirmParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] ] """ - The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - provider and indicates what degree of authentication was performed. + Type of the line item. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + description: NotRequired[str] """ - The exemption requested via 3DS and accepted by the issuer at authentication time. + Description of the line item. """ - network_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" - ] + name: str """ - Network specific 3DS fields. Network specific arguments require an - explicit card brand choice. The parameter `payment_method_options.card.network`` - must be populated accordingly + Descriptive name of the line item. """ - requestor_challenge_indicator: NotRequired[str] + quantity: int """ - The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + Quantity of the line item. Must be a positive number. """ - transaction_id: str + sku: NotRequired[str] """ - For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server - Transaction ID (dsTransID). + Client facing stock keeping unit, article number or similar. """ - version: Literal["1.0.2", "2.1.0", "2.2.0"] + sold_by: NotRequired[str] """ - The version of 3D Secure that was performed. + The Stripe account ID of the connected account that sells the item. """ - - class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( - TypedDict, - ): - cartes_bancaires: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + tax: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaypalLineItemTax" ] """ - Cartes Bancaires-specific 3DS fields. + The tax information for the line item. """ - - class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( - TypedDict, - ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + unit_amount: int """ - The cryptogram calculation algorithm used by the card Issuer's ACS - to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. - messageExtension: CB-AVALGO + Price for a single unit of the line item in minor units. Cannot be a negative number. """ - cb_exemption: NotRequired[str] + + class ConfirmParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int """ - The exemption indicator returned from Cartes Bancaires in the ARes. - message extension: CB-EXEMPTION; string (4 characters) - This is a 3 byte bitmap (low significant byte first and most significant - bit first) that has been Base64 encoded + The tax for a single unit of the line item in minor units. Cannot be a negative number. """ - cb_score: NotRequired[int] + behavior: Literal["exclusive", "inclusive"] """ - The risk score returned from Cartes Bancaires in the ARes. - message extension: CB-SCORE; numeric value 0-99 + The tax behavior for the line item. """ - class CreateParamsPaymentMethodOptionsCashapp(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4614,16 +4240,65 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): - bank_transfer: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" + class ConfirmParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] ] """ - Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + The periodicity at which payments will be collected. """ - funding_type: NotRequired[Literal["bank_transfer"]] + payments_per_period: NotRequired[int] """ - The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + + class ConfirmParamsPaymentMethodOptionsPix(TypedDict): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ + expires_at: NotRequired[int] + """ + The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ @@ -4638,54 +4313,89 @@ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( - TypedDict, - ): - eu_bank_transfer: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" - ] + class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Configuration for the eu_bank_transfer funding type. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - requested_address_types: NotRequired[ - List[ - Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", - ] - ] - ] + + class ConfirmParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + Indicates that you intend to make future payments with this PaymentIntent's payment method. - Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + + class ConfirmParamsPaymentMethodOptionsRechnung(TypedDict): + pass + + class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" ] """ - The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( - TypedDict, - ): - country: str + class ConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] """ - The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ - class CreateParamsPaymentMethodOptionsEps(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ConfirmParamsPaymentMethodOptionsSatispay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4697,8 +4407,18 @@ class CreateParamsPaymentMethodOptionsEps(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ - class CreateParamsPaymentMethodOptionsFpx(TypedDict): + class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class ConfirmParamsPaymentMethodOptionsShopeepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4712,8 +4432,16 @@ class CreateParamsPaymentMethodOptionsFpx(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsGiropay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4726,8 +4454,10 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class ConfirmParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4740,10 +4470,12 @@ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsIdeal(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + A reference for this payment to be displayed in the Swish app. + """ + setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4756,20 +4488,47 @@ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): - pass - - class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] """ - Controls when the funds are captured from the customer's account. + Indicates that you intend to make future payments with this PaymentIntent's payment method. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): + financial_connections: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" + ] + """ + Additional fields for Financial Connections Session creation + """ + mandate_options: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + networks: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" + ] + """ + Additional fields for network related functions + """ + preferred_settlement_speed: NotRequired[ + "Literal['']|Literal['fastest', 'standard']" + ] + """ + Preferred transaction settlement speed """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4779,150 +4538,4530 @@ class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. """ - class CreateParamsPaymentMethodOptionsKlarna(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( + TypedDict, + ): + filters: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ + manual_entry: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ + permissions: NotRequired[ + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] + ] + """ + The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + """ + prefetch: NotRequired[ + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] + ] + """ + List of data features that you would like to retrieve upon account creation. + """ + return_url: NotRequired[str] + """ + For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ - Controls when the funds are captured from the customer's account. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", + Settings for configuring manual entry of account details. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( + TypedDict, + ): + collection_method: NotRequired["Literal['']|Literal['paper']"] + """ + The method used to collect offline mandate customer acceptance. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + """ + Triggers validations to run across the selected networks + """ + + class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsPaymentMethodOptionsZip(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class ConfirmParamsRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class ConfirmParamsShipping(TypedDict): + address: "PaymentIntentService.ConfirmParamsShippingAddress" + """ + Shipping address. + """ + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + + class ConfirmParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParams(TypedDict): + amount: int + """ + Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + automatic_payment_methods: NotRequired[ + "PaymentIntentService.CreateParamsAutomaticPaymentMethods" + ] + """ + When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + """ + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. + """ + confirm: NotRequired[bool] + """ + Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + """ + confirmation_method: NotRequired[Literal["automatic", "manual"]] + """ + Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + """ + confirmation_token: NotRequired[str] + """ + ID of the ConfirmationToken used to confirm this PaymentIntent. + + If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + ID of the Customer this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Customers cannot be used with this PaymentIntent. + + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + """ + customer_account: NotRequired[str] + """ + ID of the Account this PaymentIntent belongs to, if one exists. + + Payment methods attached to other Accounts cannot be used with this PaymentIntent. + + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + error_on_requires_action: NotRequired[bool] + """ + Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fx_quote: NotRequired[str] + """ + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. + """ + hooks: NotRequired["PaymentIntentService.CreateParamsHooks"] + """ + Automations to be run during the PaymentIntent lifecycle + """ + mandate: NotRequired[str] + """ + ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + mandate_data: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsMandateData" + ] + """ + This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + off_session: NotRequired["bool|Literal['one_off', 'recurring']"] + """ + Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + on_behalf_of: NotRequired[str] + """ + The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + payment_details: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ + payment_method: NotRequired[str] + """ + ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. + + If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. + If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://stripe.com/docs/api#create_payment_intent-customer) parameter of this PaymentIntent. + end + """ + payment_method_configuration: NotRequired[str] + """ + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + """ + payment_method_data: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodData" + ] + """ + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. + """ + payment_method_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptions" + ] + """ + Payment method-specific configuration for this PaymentIntent. + """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + """ + radar_options: NotRequired[ + "PaymentIntentService.CreateParamsRadarOptions" + ] + """ + Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + """ + receipt_email: NotRequired[str] + """ + Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + """ + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + """ + secret_key_confirmation: NotRequired[Literal["optional", "required"]] + """ + Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + """ + setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + shipping: NotRequired["PaymentIntentService.CreateParamsShipping"] + """ + Shipping information for this PaymentIntent. + """ + statement_descriptor: NotRequired[str] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + """ + transfer_data: NotRequired[ + "PaymentIntentService.CreateParamsTransferData" + ] + """ + The parameters that you can use to automatically create a Transfer. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + transfer_group: NotRequired[str] + """ + A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + """ + use_stripe_sdk: NotRequired[bool] + """ + Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + """ + + class CreateParamsAutomaticPaymentMethods(TypedDict): + allow_redirects: NotRequired[Literal["always", "never"]] + """ + Controls whether this PaymentIntent will accept redirect-based payment methods. + + Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + """ + enabled: bool + """ + Whether this feature is enabled. + """ + + class CreateParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntentService.CreateParamsHooksInputs"] + """ + Arguments passed in automations + """ + + class CreateParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntentService.CreateParamsHooksInputsTax"] + """ + Tax arguments for automations + """ + + class CreateParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ + + class CreateParamsMandateData(TypedDict): + customer_acceptance: ( + "PaymentIntentService.CreateParamsMandateDataCustomerAcceptance" + ) + """ + This hash contains details about the customer acceptance of the Mandate. + """ + + class CreateParamsMandateDataCustomerAcceptance(TypedDict): + accepted_at: NotRequired[int] + """ + The time at which the customer accepted the Mandate. + """ + offline: NotRequired[ + "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOffline" + ] + """ + If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + """ + online: NotRequired[ + "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOnline" + ] + """ + If this is a Mandate accepted online, this hash contains details about the online acceptance. + """ + type: Literal["offline", "online"] + """ + The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + """ + + class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): + pass + + class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: str + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: str + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ + + class CreateParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRental" + ] + """ + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsEventDetails" + ] + """ + Event details for this PaymentIntent + """ + flight: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsFlight" + ] + """ + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsLodging" + ] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent + """ + + class CreateParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalDriver" + ] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalPickupAddress" + ] + """ + Car pick-up address. + """ + pickup_at: int + """ + Car pick-up time. Measured in seconds since the Unix epoch. + """ + pickup_location_name: NotRequired[str] + """ + Name of the pickup location. + """ + rate_amount: NotRequired[int] + """ + Rental rate. + """ + rate_interval: NotRequired[Literal["day", "month", "week"]] + """ + The frequency at which the rate amount is applied. One of `day`, `week` or `month` + """ + renter_name: NotRequired[str] + """ + The name of the person or entity renting the car. + """ + return_address: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalReturnAddress" + ] + """ + Car return address. + """ + return_at: int + """ + Car return time. Measured in seconds since the Unix epoch. + """ + return_location_name: NotRequired[str] + """ + Name of the return location. + """ + tax_exempt: NotRequired[bool] + """ + Indicates whether the goods or services are tax-exempt or tax is not collected. + """ + vehicle_identification_number: NotRequired[str] + """ + The vehicle identification number. + """ + + class CreateParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsCarRentalDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] + """ + Distance traveled. + """ + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. + """ + + class CreateParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] + """ + Driver's identification number. + """ + driver_tax_number: NotRequired[str] + """ + Driver's tax number. + """ + name: str + """ + Full name of the person or entity on the car reservation. + """ + + class CreateParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] + """ + Indicates if the tickets are digitally checked when entering the venue. + """ + address: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsEventDetailsAddress" + ] + """ + The event location's address. + """ + affiliate: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsEventDetailsAffiliate" + ] + """ + Affiliate details for this purchase. + """ + company: NotRequired[str] + """ + The name of the company + """ + delivery: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsEventDetailsDelivery" + ] + """ + Delivery details for this purchase. + """ + ends_at: NotRequired[int] + """ + Event end time. Measured in seconds since the Unix epoch. + """ + genre: NotRequired[str] + """ + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. + """ + + class CreateParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsFlightAffiliate" + ] + """ + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. + """ + delivery: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsFlightDelivery" + ] + """ + Delivery details for this purchase. + """ + passenger_name: NotRequired[str] + """ + The name of the person or entity on the reservation. + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.CreateParamsPaymentDetailsFlightPassenger" + ] + ] + """ + The details of the passengers in the travel reservation. + """ + segments: List[ + "PaymentIntentService.CreateParamsPaymentDetailsFlightSegment" + ] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. + """ + + class CreateParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsFlightDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsFlightPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the flight reservation. + """ + + class CreateParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] + """ + The flight segment amount. + """ + arrival_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the arrival airport. + """ + arrives_at: NotRequired[int] + """ + The arrival time for the flight segment. Measured in seconds since the Unix epoch. + """ + carrier: NotRequired[str] + """ + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. + """ + departs_at: int + """ + The departure time for the flight segment. Measured in seconds since the Unix epoch. + """ + departure_airport: NotRequired[str] + """ + The International Air Transport Association (IATA) airport code for the departure airport. + """ + flight_number: NotRequired[str] + """ + The flight number associated with the segment + """ + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] + ] + """ + The fare class for the segment. + """ + + class CreateParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsLodgingAddress" + ] + """ + The lodging location's address. + """ + adults: NotRequired[int] + """ + The number of adults on the booking + """ + affiliate: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsLodgingAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: NotRequired[str] + """ + The booking number associated with the lodging reservation. + """ + category: NotRequired[Literal["hotel", "vacation_rental"]] + """ + The lodging category + """ + checkin_at: int + """ + Lodging check-in time. Measured in seconds since the Unix epoch. + """ + checkout_at: int + """ + Lodging check-out time. Measured in seconds since the Unix epoch. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the lodging company. + """ + daily_room_rate_amount: NotRequired[int] + """ + The daily lodging room rate. + """ + delivery: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsLodgingDelivery" + ] + """ + Delivery details for this purchase. + """ + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] + """ + List of additional charges being billed. + """ + fire_safety_act_compliance: NotRequired[bool] + """ + Indicates whether the lodging location is compliant with the Fire Safety Act. + """ + name: NotRequired[str] + """ + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.CreateParamsPaymentDetailsLodgingPassenger" + ] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. + """ + room_class: NotRequired[str] + """ + The room class for this purchase. + """ + room_nights: NotRequired[int] + """ + The number of room nights + """ + total_room_tax_amount: NotRequired[int] + """ + The total tax amount associating with the room reservation. + """ + total_tax_amount: NotRequired[int] + """ + The total tax amount + """ + + class CreateParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] + """ + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsLodgingDeliveryRecipient" + ] + """ + Details of the recipient. + """ + + class CreateParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] + """ + The email of the recipient the ticket is delivered to. + """ + name: NotRequired[str] + """ + The name of the recipient the ticket is delivered to. + """ + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. + """ + + class CreateParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str + """ + Full name of the person or entity on the lodging reservation. + """ + + class CreateParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsSubscriptionAffiliate" + ] + """ + Affiliate details for this purchase. + """ + auto_renewal: NotRequired[bool] + """ + Info whether the subscription will be auto renewed upon expiry. + """ + billing_interval: NotRequired[ + "PaymentIntentService.CreateParamsPaymentDetailsSubscriptionBillingInterval" + ] + """ + Subscription billing details for this purchase. + """ + ends_at: NotRequired[int] + """ + Subscription end time. Measured in seconds since the Unix epoch. + """ + name: str + """ + Name of the product on subscription. e.g. Apple Music Subscription + """ + starts_at: NotRequired[int] + """ + Subscription start time. Measured in seconds since the Unix epoch. + """ + + class CreateParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str + """ + The name of the affiliate that originated the purchase. + """ + + class CreateParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + + class CreateParamsPaymentMethodData(TypedDict): + acss_debit: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAcssDebit" + ] + """ + If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + """ + affirm: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + """ + afterpay_clearpay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAfterpayClearpay" + ] + """ + If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + """ + alipay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAlipay" + ] + """ + If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + """ + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + """ + alma: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAlma" + ] + """ + If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + """ + amazon_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" + ] + """ + If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + """ + au_becs_debit: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataAuBecsDebit" + ] + """ + If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + """ + bacs_debit: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + """ + bancontact: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + """ + billie: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBillie" + ] + """ + If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method. + """ + billing_details: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + blik: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBlik" + ] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ + boleto: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + """ + cashapp: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + """ + customer_balance: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataCustomerBalance" + ] + """ + If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + """ + eps: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataEps" + ] + """ + If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + """ + fpx: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataFpx" + ] + """ + If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + """ + giropay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + """ + gopay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ + grabpay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + """ + id_bank_transfer: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ + ideal: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataIdeal" + ] + """ + If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + """ + interac_present: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataInteracPresent" + ] + """ + If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + """ + kakao_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this hash contains details about the Kakao Pay payment method. + """ + klarna: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + """ + konbini: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + """ + kr_card: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this hash contains details about the Korean Card payment method. + """ + link: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataLink" + ] + """ + If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + """ + mb_way: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + mobilepay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataMobilepay" + ] + """ + If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. + """ + multibanco: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. + """ + naver_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. + """ + nz_bank_account: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataNzBankAccount" + ] + """ + If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method. + """ + oxxo: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" + ] + """ + If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + """ + p24: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataP24" + ] + """ + If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + """ + pay_by_bank: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ + payco: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayco" + ] + """ + If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. + """ + paynow: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + """ + paypal: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + """ + payto: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ + pix: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPix" + ] + """ + If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + """ + promptpay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + """ + qris: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ + radar_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataRadarOptions" + ] + """ + Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + """ + rechnung: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ + revolut_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataRevolutPay" + ] + """ + If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + """ + samsung_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method. + """ + satispay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method. + """ + sepa_debit: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + """ + shopeepay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ + sofort: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSofort" + ] + """ + If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + """ + stripe_balance: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ + swish: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataSwish" + ] + """ + If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + """ + twint: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataTwint" + ] + """ + If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. + """ + type: Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "blik", + "boleto", + "cashapp", + "customer_balance", + "eps", + "fpx", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "sepa_debit", + "shopeepay", + "sofort", + "stripe_balance", + "swish", + "twint", + "us_bank_account", + "wechat_pay", + "zip", + ] + """ + The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + """ + us_bank_account: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataUsBankAccount" + ] + """ + If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + """ + wechat_pay: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataWechatPay" + ] + """ + If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + """ + zip: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataZip" + ] + """ + If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + """ + + class CreateParamsPaymentMethodDataAcssDebit(TypedDict): + account_number: str + """ + Customer's bank account number. + """ + institution_number: str + """ + Institution number of the customer's bank. + """ + transit_number: str + """ + Transit number of the customer's bank. + """ + + class CreateParamsPaymentMethodDataAffirm(TypedDict): + pass + + class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAlipay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAlma(TypedDict): + pass + + class CreateParamsPaymentMethodDataAmazonPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): + account_number: str + """ + The account number for the bank account. + """ + bsb_number: str + """ + Bank-State-Branch number of the bank account. + """ + + class CreateParamsPaymentMethodDataBacsDebit(TypedDict): + account_number: NotRequired[str] + """ + Account number of the bank account that the funds will be debited from. + """ + sort_code: NotRequired[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class CreateParamsPaymentMethodDataBancontact(TypedDict): + pass + + class CreateParamsPaymentMethodDataBillie(TypedDict): + pass + + class CreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired["Literal['']|str"] + """ + Email address. + """ + name: NotRequired["Literal['']|str"] + """ + Full name. + """ + phone: NotRequired["Literal['']|str"] + """ + Billing phone number (including extension). + """ + tax_id: NotRequired[str] + """ + Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers. + """ + + class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentMethodDataBlik(TypedDict): + pass + + class CreateParamsPaymentMethodDataBoleto(TypedDict): + tax_id: str + """ + The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + """ + + class CreateParamsPaymentMethodDataCashapp(TypedDict): + pass + + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): + pass + + class CreateParamsPaymentMethodDataEps(TypedDict): + bank: NotRequired[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataFpx(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] + """ + Account holder type for FPX transaction + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataGiropay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + + class CreateParamsPaymentMethodDataGrabpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + + class CreateParamsPaymentMethodDataIdeal(TypedDict): + bank: NotRequired[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] + """ + The customer's bank. Only use this parameter for existing customers. Don't use it for new customers. + """ + + class CreateParamsPaymentMethodDataInteracPresent(TypedDict): + pass + + class CreateParamsPaymentMethodDataKakaoPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataKlarna(TypedDict): + dob: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataKlarnaDob" + ] + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class CreateParamsPaymentMethodDataKonbini(TypedDict): + pass + + class CreateParamsPaymentMethodDataKrCard(TypedDict): + pass + + class CreateParamsPaymentMethodDataLink(TypedDict): + pass + + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass + + class CreateParamsPaymentMethodDataMobilepay(TypedDict): + pass + + class CreateParamsPaymentMethodDataMultibanco(TypedDict): + pass + + class CreateParamsPaymentMethodDataNaverPay(TypedDict): + funding: NotRequired[Literal["card", "points"]] + """ + Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. + """ + + class CreateParamsPaymentMethodDataNzBankAccount(TypedDict): + account_holder_name: NotRequired[str] + """ + The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + account_number: str + """ + The account number for the bank account. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + reference: NotRequired[str] + suffix: str + """ + The suffix of the bank account number. + """ + + class CreateParamsPaymentMethodDataOxxo(TypedDict): + pass + + class CreateParamsPaymentMethodDataP24(TypedDict): + bank: NotRequired[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] + """ + The customer's bank. + """ + + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + + class CreateParamsPaymentMethodDataPayco(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaynow(TypedDict): + pass + + class CreateParamsPaymentMethodDataPaypal(TypedDict): + pass + + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + + class CreateParamsPaymentMethodDataPix(TypedDict): + pass + + class CreateParamsPaymentMethodDataPromptpay(TypedDict): + pass + + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntentService.CreateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSamsungPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSatispay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSepaDebit(TypedDict): + iban: str + """ + IBAN of the bank account. + """ + + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + + class CreateParamsPaymentMethodDataSofort(TypedDict): + country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + + class CreateParamsPaymentMethodDataSwish(TypedDict): + pass + + class CreateParamsPaymentMethodDataTwint(TypedDict): + pass + + class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): + account_holder_type: NotRequired[Literal["company", "individual"]] + """ + Account holder type: individual or company. + """ + account_number: NotRequired[str] + """ + Account number of the bank account. + """ + account_type: NotRequired[Literal["checking", "savings"]] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + financial_connections_account: NotRequired[str] + """ + The ID of a Financial Connections Account to use as a payment method. + """ + routing_number: NotRequired[str] + """ + Routing number of the bank account. + """ + + class CreateParamsPaymentMethodDataWechatPay(TypedDict): + pass + + class CreateParamsPaymentMethodDataZip(TypedDict): + pass + + class CreateParamsPaymentMethodOptions(TypedDict): + acss_debit: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebit" + ] + """ + If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + """ + affirm: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAffirm" + ] + """ + If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + """ + afterpay_clearpay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAfterpayClearpay" + ] + """ + If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + """ + alipay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlipay" + ] + """ + If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + """ + alma: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlma" + ] + """ + If this is a `alma` PaymentMethod, this sub-hash contains details about the Alma payment method options. + """ + amazon_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAmazonPay" + ] + """ + If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. + """ + au_becs_debit: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAuBecsDebit" + ] + """ + If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + """ + bacs_debit: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebit" + ] + """ + If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + """ + bancontact: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBancontact" + ] + """ + If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + """ + billie: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ + blik: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBlik" + ] + """ + If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + """ + boleto: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBoleto" + ] + """ + If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + """ + card: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCard" + ] + """ + Configuration for any card payments attempted on this PaymentIntent. + """ + card_present: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresent" + ] + """ + If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + """ + cashapp: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCashapp" + ] + """ + If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + """ + customer_balance: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalance" + ] + """ + If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + """ + eps: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsEps" + ] + """ + If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + """ + fpx: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsFpx" + ] + """ + If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + """ + giropay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGiropay" + ] + """ + If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + """ + gopay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGopay" + ] + """ + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. + """ + grabpay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGrabpay" + ] + """ + If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ + ideal: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdeal" + ] + """ + If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + """ + interac_present: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsInteracPresent" + ] + """ + If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + """ + kakao_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKakaoPay" + ] + """ + If this is a `kakao_pay` PaymentMethod, this sub-hash contains details about the Kakao Pay payment method options. + """ + klarna: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + """ + konbini: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKonbini" + ] + """ + If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + """ + kr_card: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKrCard" + ] + """ + If this is a `kr_card` PaymentMethod, this sub-hash contains details about the KR Card payment method options. + """ + link: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsLink" + ] + """ + If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + """ + mb_way: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMbWay" + ] + """ + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. + """ + mobilepay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMobilepay" + ] + """ + If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. + """ + multibanco: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMultibanco" + ] + """ + If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. + """ + naver_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNaverPay" + ] + """ + If this is a `naver_pay` PaymentMethod, this sub-hash contains details about the Naver Pay payment method options. + """ + nz_bank_account: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsNzBankAccount" + ] + """ + If this is a `nz_bank_account` PaymentMethod, this sub-hash contains details about the NZ BECS Direct Debit payment method options. + """ + oxxo: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" + ] + """ + If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + """ + p24: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsP24" + ] + """ + If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ + payco: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayco" + ] + """ + If this is a `payco` PaymentMethod, this sub-hash contains details about the PAYCO payment method options. + """ + paynow: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaynow" + ] + """ + If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + """ + paypal: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaypal" + ] + """ + If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + """ + payto: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. + """ + pix: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPix" + ] + """ + If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + """ + promptpay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPromptpay" + ] + """ + If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + """ + qris: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsQris" + ] + """ + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. + """ + rechnung: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. + """ + revolut_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsRevolutPay" + ] + """ + If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + """ + samsung_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSamsungPay" + ] + """ + If this is a `samsung_pay` PaymentMethod, this sub-hash contains details about the Samsung Pay payment method options. + """ + satispay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSatispay" + ] + """ + If this is a `satispay` PaymentMethod, this sub-hash contains details about the Satispay payment method options. + """ + sepa_debit: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebit" + ] + """ + If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + """ + shopeepay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsShopeepay" + ] + """ + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. + """ + sofort: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSofort" + ] + """ + If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + """ + stripe_balance: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsStripeBalance" + ] + """ + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. + """ + swish: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSwish" + ] + """ + If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + """ + twint: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsTwint" + ] + """ + If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. + """ + us_bank_account: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" + ] + """ + If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + """ + wechat_pay: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsWechatPay" + ] + """ + If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + """ + zip: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsZip" + ] + """ + If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + """ + + class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): + custom_mandate_url: NotRequired["Literal['']|str"] + """ + A URL for custom mandate text to render during confirmation step. + The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + """ + interval_description: NotRequired[str] + """ + Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + """ + payment_schedule: NotRequired[ + Literal["combined", "interval", "sporadic"] + ] + """ + Payment schedule for the mandate. + """ + transaction_type: NotRequired[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + class CreateParamsPaymentMethodOptionsAffirm(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[str] + """ + Preferred language of the Affirm authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + reference: NotRequired[str] + """ + An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + This field differs from the statement descriptor and item name. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsAlipay(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsAlma(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentMethodOptionsBacsDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'. + """ + + class CreateParamsPaymentMethodOptionsBancontact(TypedDict): + preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class CreateParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + setup_future_usage: NotRequired["Literal['']|Literal['none']"] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsBoleto(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + cvc_token: NotRequired[str] + """ + A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + """ + installments: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallments" + ] + """ + Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + + For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + """ + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" + ] + """ + Configuration options for setting up an eMandate for cards issued in India. + """ + moto: NotRequired[bool] + """ + When specified, this parameter indicates that a transaction will be marked + as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + parameter can only be provided during confirmation. + """ + network: NotRequired[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "girocard", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + ] + """ + Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + """ + request_extended_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + """ + request_incremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + """ + request_multicapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + """ + request_overcapture: NotRequired[Literal["if_available", "never"]] + """ + Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + """ + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ + request_three_d_secure: NotRequired[ + Literal["any", "automatic", "challenge"] + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ + require_cvc_recollection: NotRequired[bool] + """ + When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + """ + statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] + """ + Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + """ + statement_details: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardStatementDetails" + ] + """ + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. + """ + three_d_secure: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecure" + ] + """ + If 3D Secure authentication was performed with a third-party provider, + the authentication details to use for this payment. + """ + + class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): + enabled: NotRequired[bool] + """ + Setting to true enables installments for this PaymentIntent. + This will cause the response to contain a list of available installment plans. + Setting to false will prevent any selected plan from applying to a charge. + """ + plan: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" + ] + """ + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. + """ + + class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] + """ + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + """ + interval: NotRequired[Literal["month"]] + """ + For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + One of `month`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + + class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): + amount: int + """ + Amount to be charged for future payments. + """ + amount_type: Literal["fixed", "maximum"] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + """ + interval: Literal["day", "month", "sporadic", "week", "year"] + """ + Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + """ + reference: str + """ + Unique identifier for the mandate or subscription. + """ + start_date: int + """ + Start date of the mandate or subscription. Start date should not be lesser than yesterday. + """ + supported_types: NotRequired[List[Literal["india"]]] + """ + Specifies the type of mandates supported. Possible values are `india`. + """ + + class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): + request_extended_authorization: NotRequired[bool] + """ + Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + """ + request_incremental_authorization_support: NotRequired[bool] + """ + Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + """ + routing: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresentRouting" + ] + """ + Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. + """ + + class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): + requested_priority: NotRequired[Literal["domestic", "international"]] + """ + Routing requested priority + """ + + class CreateParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardStatementDetailsAddress" + ] + """ + Please pass in an address that is within your Stripe user account country + """ + phone: NotRequired[str] + """ + Phone number (e.g., a toll-free number that customers can call) + """ + + class CreateParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): + ares_trans_status: NotRequired[ + Literal["A", "C", "I", "N", "R", "U", "Y"] + ] + """ + The `transStatus` returned from the card Issuer's ACS in the ARes. + """ + cryptogram: str + """ + The cryptogram, also known as the "authentication value" (AAV, CAVV or + AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + (Most 3D Secure providers will return the base64-encoded version, which + is what you should specify here.) + """ + electronic_commerce_indicator: NotRequired[ + Literal["01", "02", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + provider and indicates what degree of authentication was performed. + """ + exemption_indicator: NotRequired[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + network_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" + ] + """ + Network specific 3DS fields. Network specific arguments require an + explicit card brand choice. The parameter `payment_method_options.card.network`` + must be populated accordingly + """ + requestor_challenge_indicator: NotRequired[str] + """ + The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + """ + transaction_id: str + """ + For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + Transaction ID (dsTransID). + """ + version: Literal["1.0.2", "2.1.0", "2.2.0"] + """ + The version of 3D Secure that was performed. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( + TypedDict, + ): + cartes_bancaires: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" + ] + """ + Cartes Bancaires-specific 3DS fields. + """ + + class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( + TypedDict, + ): + cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + """ + The cryptogram calculation algorithm used by the card Issuer's ACS + to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + messageExtension: CB-AVALGO + """ + cb_exemption: NotRequired[str] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. + message extension: CB-EXEMPTION; string (4 characters) + This is a 3 byte bitmap (low significant byte first and most significant + bit first) that has been Base64 encoded + """ + cb_score: NotRequired[int] + """ + The risk score returned from Cartes Bancaires in the ARes. + message extension: CB-SCORE; numeric value 0-99 + """ + + class CreateParamsPaymentMethodOptionsCashapp(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): + bank_transfer: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" + ] + """ + Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + """ + funding_type: NotRequired[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( + TypedDict, + ): + eu_bank_transfer: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" + ] + """ + Configuration for the eu_bank_transfer funding type. + """ + requested_address_types: NotRequired[ + List[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ] + ] + ] + """ + List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + + Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + """ + type: Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ] + """ + The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + + class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( + TypedDict, + ): + country: str + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + class CreateParamsPaymentMethodOptionsEps(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsFpx(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsGiropay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsGopay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsIdeal(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsKakaoPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsKonbini(TypedDict): + confirmation_number: NotRequired["Literal['']|str"] + """ + An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + """ + expires_after_days: NotRequired["Literal['']|int"] + """ + The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + """ + expires_at: NotRequired["Literal['']|int"] + """ + The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + """ + product_description: NotRequired["Literal['']|str"] + """ + A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsKrCard(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsLink(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + persistent_token: NotRequired[str] + """ + [Deprecated] This is a legacy parameter that no longer has any function. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentMethodOptionsOxxo(TypedDict): + expires_after_days: NotRequired[int] + """ + The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsP24(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + tos_shown_and_accepted: NotRequired[bool] + """ + Confirm that the payer has accepted the P24 terms and conditions. + """ + + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsPayco(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class CreateParamsPaymentMethodOptionsPaynow(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsPaypal(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds will be captured from the customer's account. + """ + line_items: NotRequired[ + List[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", "de-AT", - "de-CH", "de-DE", + "de-LU", "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", "en-US", "es-ES", - "es-US", "fi-FI", "fr-BE", - "fr-CA", - "fr-CH", "fr-FR", - "it-CH", + "fr-LU", + "hu-HU", "it-IT", - "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", - "ro-RO", - "sv-FI", + "sk-SK", "sv-SE", ] ] """ - Preferred language of the Klarna authorization page that the customer is redirected to + [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + """ + reference: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ + risk_correlation_id: NotRequired[str] + """ + The risk correlation ID for an on-session payment using a saved PayPal payment method. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class CreateParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + + class CreateParamsPaymentMethodOptionsPix(TypedDict): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ + expires_at: NotRequired[int] + """ + The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsRechnung(TypedDict): + pass + + class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class CreateParamsPaymentMethodOptionsSatispay(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + + class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + + class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): + reference_prefix: NotRequired["Literal['']|str"] + """ + Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + """ + + class CreateParamsPaymentMethodOptionsShopeepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsSofort(TypedDict): + preferred_language: NotRequired[ + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + ] + """ + Language shown to the payer on redirect. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsSwish(TypedDict): + reference: NotRequired["Literal['']|str"] + """ + A reference for this payment to be displayed in the Swish app. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsTwint(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): + financial_connections: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" + ] + """ + Additional fields for Financial Connections Session creation + """ + mandate_options: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + networks: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" + ] + """ + Additional fields for network related functions + """ + preferred_settlement_speed: NotRequired[ + "Literal['']|Literal['fastest', 'standard']" + ] + """ + Preferred transaction settlement speed + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + target_date: NotRequired[str] + """ + Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + """ + verification_method: NotRequired[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( + TypedDict, + ): + filters: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" + ] + """ + Provide filters for the linked accounts that the customer can select for the payment method. + """ + manual_entry: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ + permissions: NotRequired[ + List[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ] + ] + ] + """ + The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + """ + prefetch: NotRequired[ + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] + ] + """ + List of data features that you would like to retrieve upon account creation. + """ + return_url: NotRequired[str] + """ + For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( + TypedDict, + ): + account_subcategories: NotRequired[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( + TypedDict, + ): + collection_method: NotRequired["Literal['']|Literal['paper']"] + """ + The method used to collect offline mandate customer acceptance. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): + requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + """ + Triggers validations to run across the selected networks + """ + + class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): + app_id: NotRequired[str] + """ + The app ID registered with WeChat Pay. Only required when client is ios or android. + """ + client: NotRequired[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsPaymentMethodOptionsZip(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class CreateParamsRadarOptions(TypedDict): + session: NotRequired[str] + """ + A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CreateParamsShipping(TypedDict): + address: "PaymentIntentService.CreateParamsShippingAddress" + """ + Shipping address. + """ + carrier: NotRequired[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: str + """ + Recipient name. + """ + phone: NotRequired[str] + """ + Recipient phone (including extension). + """ + tracking_number: NotRequired[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + + class CreateParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when a charge succeeds. + The amount is capped at the total transaction amount and if no amount is set, + the full amount is transferred. + + If you intend to collect a fee and you need a more robust reporting experience, using + [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) + might be a better fit for your integration. + """ + destination: str + """ + If specified, successful charges will be attributed to the destination + account for tax reporting, and the funds from charges will be transferred + to the destination account. The ID of the resulting transfer will be + returned on the successful charge's `transfer` field. + """ + + class DecrementAuthorizationParams(TypedDict): + amount: int + """ + The updated total amount that you intend to collect from the cardholder. This amount must be smaller than the currently authorized amount and greater than the already captured amount. + """ + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + hooks: NotRequired[ + "PaymentIntentService.DecrementAuthorizationParamsHooks" + ] + """ + Automations to be run during the PaymentIntent lifecycle + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + transfer_data: NotRequired[ + "PaymentIntentService.DecrementAuthorizationParamsTransferData" + ] + """ + The parameters used to automatically create a transfer after the payment is captured. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + + class DecrementAuthorizationParamsHooks(TypedDict): + inputs: NotRequired[ + "PaymentIntentService.DecrementAuthorizationParamsHooksInputs" + ] + """ + Arguments passed in automations + """ + + class DecrementAuthorizationParamsHooksInputs(TypedDict): + tax: NotRequired[ + "PaymentIntentService.DecrementAuthorizationParamsHooksInputsTax" + ] + """ + Tax arguments for automations + """ + + class DecrementAuthorizationParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ + + class DecrementAuthorizationParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when a charge succeeds. + """ + + class IncrementAuthorizationParams(TypedDict): + amount: int + """ + The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. + """ + application_fee_amount: NotRequired[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + hooks: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsHooks" + ] + """ + Automations to be run during the PaymentIntent lifecycle + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_method_options: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsPaymentMethodOptions" + ] + """ + Payment method-specific configuration for this PaymentIntent. + """ + statement_descriptor: NotRequired[str] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + """ + transfer_data: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsTransferData" + ] + """ + The parameters used to automatically create a transfer after the payment is captured. + Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + + class IncrementAuthorizationParamsHooks(TypedDict): + inputs: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsHooksInputs" + ] + """ + Arguments passed in automations + """ + + class IncrementAuthorizationParamsHooksInputs(TypedDict): + tax: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsHooksInputsTax" + ] + """ + Tax arguments for automations + """ + + class IncrementAuthorizationParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ + + class IncrementAuthorizationParamsPaymentMethodOptions(TypedDict): + card: NotRequired[ + "PaymentIntentService.IncrementAuthorizationParamsPaymentMethodOptionsCard" + ] + """ + Configuration for any card payments attempted on this PaymentIntent. + """ + + class IncrementAuthorizationParamsPaymentMethodOptionsCard(TypedDict): + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ + + class IncrementAuthorizationParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when a charge succeeds. + """ + + class ListParams(TypedDict): + created: NotRequired["PaymentIntentService.ListParamsCreated|int"] + """ + A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + """ + customer: NotRequired[str] + """ + Only return PaymentIntents for the customer that this customer ID specifies. + """ + customer_account: NotRequired[str] + """ + Only return PaymentIntents for the account that this ID specifies. + """ + 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. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class RetrieveParams(TypedDict): + client_secret: NotRequired[str] + """ + The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class SearchParams(TypedDict): + 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. + """ + page: NotRequired[str] + """ + A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + """ + query: str + """ + The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). + """ + + class TriggerActionParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + scan_qr_code: NotRequired[ + "PaymentIntentService.TriggerActionParamsScanQrCode" + ] + """ + True to simulate success, false to simulate failure. + """ + type: Literal["expire", "fund"] + """ + The type of action to be simulated. + """ + + class TriggerActionParamsScanQrCode(TypedDict): + result: NotRequired[Literal["failure", "success"]] + """ + Whether the QR Code scan's payment should succeed or fail. + """ + + class UpdateParams(TypedDict): + amount: NotRequired[int] + """ + Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + capture_method: NotRequired[ + Literal["automatic", "automatic_async", "manual"] + ] + """ + Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none"]] + currency: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: NotRequired[str] + """ + ID of the Customer this PaymentIntent belongs to, if one exists. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + Payment methods attached to other Customers cannot be used with this PaymentIntent. - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + """ + customer_account: NotRequired[str] + """ + ID of the Account this PaymentIntent belongs to, if one exists. - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ - - class CreateParamsPaymentMethodOptionsKonbini(TypedDict): - confirmation_number: NotRequired["Literal['']|str"] + description: NotRequired[str] """ - An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + An arbitrary string attached to the object. Often useful for displaying to users. """ - expires_after_days: NotRequired["Literal['']|int"] + expand: NotRequired[List[str]] """ - The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + Specifies which fields in the response should be expanded. """ - expires_at: NotRequired["Literal['']|int"] + fx_quote: NotRequired[str] """ - The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount. """ - product_description: NotRequired["Literal['']|str"] + hooks: NotRequired["PaymentIntentService.UpdateParamsHooks"] """ - A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + Automations to be run during the PaymentIntent lifecycle """ - setup_future_usage: NotRequired[Literal["none"]] + mandate_data: NotRequired[ + "PaymentIntentService.UpdateParamsMandateData" + ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + This hash contains details about the Mandate to create. """ - - class CreateParamsPaymentMethodOptionsKrCard(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + metadata: NotRequired["Literal['']|Dict[str, str]"] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + payment_details: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentDetails" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Provides industry-specific information about the charge. """ - - class CreateParamsPaymentMethodOptionsLink(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + payment_method: NotRequired[str] + payment_method_configuration: NotRequired[str] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. """ - persistent_token: NotRequired[str] + payment_method_data: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodData" + ] """ - [Deprecated] This is a legacy parameter that no longer has any function. + If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + property on the PaymentIntent. + """ + payment_method_options: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptions" + ] + """ + Payment-method-specific configuration for this PaymentIntent. + """ + payment_method_types: NotRequired[List[str]] + """ + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + """ + receipt_email: NotRequired["Literal['']|str"] + """ + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4935,800 +9074,784 @@ class CreateParamsPaymentMethodOptionsLink(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - - class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + shipping: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsShipping" + ] """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + Shipping information for this PaymentIntent. """ - setup_future_usage: NotRequired[Literal["none"]] + statement_descriptor: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. """ - - class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + statement_descriptor_suffix: NotRequired[str] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + """ + transfer_data: NotRequired[ + "PaymentIntentService.UpdateParamsTransferData" + ] + """ + Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + """ + transfer_group: NotRequired[str] + """ + A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + class UpdateParamsHooks(TypedDict): + inputs: NotRequired["PaymentIntentService.UpdateParamsHooksInputs"] + """ + Arguments passed in automations + """ - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + class UpdateParamsHooksInputs(TypedDict): + tax: NotRequired["PaymentIntentService.UpdateParamsHooksInputsTax"] + """ + Tax arguments for automations + """ - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + class UpdateParamsHooksInputsTax(TypedDict): + calculation: Union[Literal[""], str] + """ + The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class UpdateParamsMandateData(TypedDict): + customer_acceptance: ( + "PaymentIntentService.UpdateParamsMandateDataCustomerAcceptance" + ) + """ + This hash contains details about the customer acceptance of the Mandate. """ - class CreateParamsPaymentMethodOptionsNaverPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + class UpdateParamsMandateDataCustomerAcceptance(TypedDict): + online: "PaymentIntentService.UpdateParamsMandateDataCustomerAcceptanceOnline" + """ + If this is a Mandate accepted online, this hash contains details about the online acceptance. + """ + type: Literal["online"] + """ + The type of customer acceptance information included with the Mandate. """ - Controls when the funds are captured from the customer's account. - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + class UpdateParamsMandateDataCustomerAcceptanceOnline(TypedDict): + ip_address: NotRequired[str] + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class UpdateParamsPaymentDetails(TypedDict): + car_rental: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRental" + ] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + Car rental details for this PaymentIntent. + """ + customer_reference: NotRequired["Literal['']|str"] + """ + Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field. + """ + event_details: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsEventDetails" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Event details for this PaymentIntent """ - - class CreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + flight: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlight" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + Flight reservation details for this PaymentIntent + """ + lodging: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodging" + ] + """ + Lodging reservation details for this PaymentIntent + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. + """ + subscription: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsSubscription" + ] + """ + Subscription details for this PaymentIntent + """ - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class UpdateParamsPaymentDetailsCarRental(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalAffiliate" + ] + """ + Affiliate details for this purchase. + """ + booking_number: str + """ + The booking number associated with the car rental. + """ + car_class_code: NotRequired[str] + """ + Class code of the car. + """ + car_make: NotRequired[str] + """ + Make of the car. + """ + car_model: NotRequired[str] + """ + Model of the car. + """ + company: NotRequired[str] + """ + The name of the rental car company. + """ + customer_service_phone_number: NotRequired[str] + """ + The customer service phone number of the car rental company. + """ + days_rented: int + """ + Number of days the car is being rented. + """ + delivery: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalDelivery" + ] + """ + Delivery details for this purchase. + """ + distance: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalDistance" + ] + """ + The details of the distance traveled during the rental period. + """ + drivers: NotRequired[ + List[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalDriver" + ] + ] + """ + The details of the passengers in the travel reservation + """ + extra_charges: NotRequired[ + List[ + Literal[ + "extra_mileage", + "gas", + "late_return", + "one_way_service", + "parking_violation", + ] + ] + ] + """ + List of additional charges being billed. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep nor cancel their booking. + """ + pickup_address: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalPickupAddress" + ] + """ + Car pick-up address. + """ + pickup_at: int """ - target_date: NotRequired[str] + Car pick-up time. Measured in seconds since the Unix epoch. """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + pickup_location_name: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsOxxo(TypedDict): - expires_after_days: NotRequired[int] + Name of the pickup location. """ - The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + rate_amount: NotRequired[int] """ - setup_future_usage: NotRequired[Literal["none"]] + Rental rate. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + rate_interval: NotRequired[Literal["day", "month", "week"]] """ - - class CreateParamsPaymentMethodOptionsP24(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + The frequency at which the rate amount is applied. One of `day`, `week` or `month` """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + renter_name: NotRequired[str] """ - tos_shown_and_accepted: NotRequired[bool] + The name of the person or entity renting the car. """ - Confirm that the payer has accepted the P24 terms and conditions. + return_address: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalReturnAddress" + ] """ - - class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): - pass - - class CreateParamsPaymentMethodOptionsPayco(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Car return address. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + return_at: int """ - - class CreateParamsPaymentMethodOptionsPaynow(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + Car return time. Measured in seconds since the Unix epoch. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + return_location_name: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsPaypal(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Name of the return location. """ - Controls when the funds will be captured from the customer's account. + tax_exempt: NotRequired[bool] """ - preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] - ] + Indicates whether the goods or services are tax-exempt or tax is not collected. """ - [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + vehicle_identification_number: NotRequired[str] """ - reference: NotRequired[str] + The vehicle identification number. """ - A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + + class UpdateParamsPaymentDetailsCarRentalAffiliate(TypedDict): + name: str """ - risk_correlation_id: NotRequired[str] + The name of the affiliate that originated the purchase. """ - The risk correlation ID for an on-session payment using a saved PayPal payment method. + + class UpdateParamsPaymentDetailsCarRentalDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + The delivery method for the payment + """ + recipient: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsCarRentalDeliveryRecipient" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Details of the recipient. """ - class CreateParamsPaymentMethodOptionsPix(TypedDict): - expires_after_seconds: NotRequired[int] + class UpdateParamsPaymentDetailsCarRentalDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + The email of the recipient the ticket is delivered to. """ - expires_at: NotRequired[int] + name: NotRequired[str] """ - The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + The name of the recipient the ticket is delivered to. """ - setup_future_usage: NotRequired[Literal["none"]] + phone: NotRequired[str] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + The phone number of the recipient the ticket is delivered to. """ - class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + class UpdateParamsPaymentDetailsCarRentalDistance(TypedDict): + amount: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Distance traveled. """ - - class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + unit: NotRequired[Literal["kilometers", "miles"]] + """ + Unit of measurement for the distance traveled. One of `miles` or `kilometers`. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class UpdateParamsPaymentDetailsCarRentalDriver(TypedDict): + driver_identification_number: NotRequired[str] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + Driver's identification number. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + driver_tax_number: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSamsungPay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Driver's tax number. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + name: str """ - - class CreateParamsPaymentMethodOptionsSatispay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] + Full name of the person or entity on the car reservation. """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + class UpdateParamsPaymentDetailsCarRentalPickupAddress(TypedDict): + city: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): - mandate_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" - ] + City, district, suburb, town, or village. """ - Additional fields for Mandate creation + country: NotRequired[str] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" - ] + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + line1: NotRequired[str] """ - target_date: NotRequired[str] + Address line 1 (e.g., street, PO Box, or company name). """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + line2: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): - reference_prefix: NotRequired["Literal['']|str"] + Address line 2 (e.g., apartment, suite, unit, or building). """ - Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. + postal_code: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSofort(TypedDict): - preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" - ] + ZIP or postal code. """ - Language shown to the payer on redirect. + state: NotRequired[str] """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" - ] + State, county, province, or region. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class UpdateParamsPaymentDetailsCarRentalReturnAddress(TypedDict): + city: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsSwish(TypedDict): - reference: NotRequired["Literal['']|str"] + City, district, suburb, town, or village. """ - A reference for this payment to be displayed in the Swish app. + country: NotRequired[str] """ - setup_future_usage: NotRequired[Literal["none"]] + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + line1: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + Address line 1 (e.g., street, PO Box, or company name). """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): - financial_connections: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" - ] + class UpdateParamsPaymentDetailsEventDetails(TypedDict): + access_controlled_venue: NotRequired[bool] """ - Additional fields for Financial Connections Session creation + Indicates if the tickets are digitally checked when entering the venue. """ - mandate_options: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" + address: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsEventDetailsAddress" ] """ - Additional fields for Mandate creation + The event location's address. """ - networks: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" + affiliate: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsEventDetailsAffiliate" ] """ - Additional fields for network related functions + Affiliate details for this purchase. """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] + company: NotRequired[str] """ - Preferred transaction settlement speed + The name of the company """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + delivery: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsEventDetailsDelivery" ] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Delivery details for this purchase. """ - target_date: NotRequired[str] + ends_at: NotRequired[int] """ - Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. + Event end time. Measured in seconds since the Unix epoch. """ - verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] - ] + genre: NotRequired[str] """ - Bank account verification method. + Type of the event entertainment (concert, sports event etc) + """ + name: str + """ + The name of the event. + """ + starts_at: NotRequired[int] + """ + Event start time. Measured in seconds since the Unix epoch. """ - class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( - TypedDict, - ): - filters: NotRequired[ - "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" - ] + class UpdateParamsPaymentDetailsEventDetailsAddress(TypedDict): + city: NotRequired[str] """ - Provide filters for the linked accounts that the customer can select for the payment method. + City, district, suburb, town, or village. """ - permissions: NotRequired[ - List[ - Literal[ - "balances", "ownership", "payment_method", "transactions" - ] - ] - ] + country: NotRequired[str] """ - The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] - ] + line1: NotRequired[str] """ - List of data features that you would like to retrieve upon account creation. + Address line 1 (e.g., street, PO Box, or company name). """ - return_url: NotRequired[str] + line2: NotRequired[str] """ - For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + Address line 2 (e.g., apartment, suite, unit, or building). """ - - class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( - TypedDict, - ): - account_subcategories: NotRequired[ - List[Literal["checking", "savings"]] - ] + postal_code: NotRequired[str] """ - The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. + ZIP or postal code. """ - - class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( - TypedDict, - ): - collection_method: NotRequired["Literal['']|Literal['paper']"] + state: NotRequired[str] """ - The method used to collect offline mandate customer acceptance. + State, county, province, or region. """ - class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): - requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] + class UpdateParamsPaymentDetailsEventDetailsAffiliate(TypedDict): + name: str """ - Triggers validations to run across the selected networks + The name of the affiliate that originated the purchase. """ - class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): - app_id: NotRequired[str] - """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + class UpdateParamsPaymentDetailsEventDetailsDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - client: NotRequired[Literal["android", "ios", "web"]] + The delivery method for the payment """ - The client type that the end customer will pay from + recipient: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsEventDetailsDeliveryRecipient" + ] """ - setup_future_usage: NotRequired[Literal["none"]] + Details of the recipient. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + class UpdateParamsPaymentDetailsEventDetailsDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - - class CreateParamsPaymentMethodOptionsZip(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + The email of the recipient the ticket is delivered to. """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + name: NotRequired[str] """ - - class CreateParamsRadarOptions(TypedDict): - session: NotRequired[str] + The name of the recipient the ticket is delivered to. """ - A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + phone: NotRequired[str] + """ + The phone number of the recipient the ticket is delivered to. """ - class CreateParamsShipping(TypedDict): - address: "PaymentIntentService.CreateParamsShippingAddress" + class UpdateParamsPaymentDetailsFlight(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlightAffiliate" + ] """ - Shipping address. + Affiliate details for this purchase. + """ + agency_number: NotRequired[str] + """ + The agency number (i.e. International Air Transport Association (IATA) agency number) of the travel agency that made the booking. """ carrier: NotRequired[str] """ - The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + The International Air Transport Association (IATA) carrier code of the carrier that issued the ticket. """ - name: str + delivery: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlightDelivery" + ] """ - Recipient name. + Delivery details for this purchase. """ - phone: NotRequired[str] + passenger_name: NotRequired[str] """ - Recipient phone (including extension). + The name of the person or entity on the reservation. """ - tracking_number: NotRequired[str] + passengers: NotRequired[ + List[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlightPassenger" + ] + ] """ - The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + The details of the passengers in the travel reservation. + """ + segments: List[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlightSegment" + ] + """ + The individual flight segments associated with the trip. + """ + ticket_number: NotRequired[str] + """ + The ticket number associated with the travel reservation. """ - class CreateParamsShippingAddress(TypedDict): - city: NotRequired[str] + class UpdateParamsPaymentDetailsFlightAffiliate(TypedDict): + name: str """ - City, district, suburb, town, or village. + The name of the affiliate that originated the purchase. """ - country: NotRequired[str] + + class UpdateParamsPaymentDetailsFlightDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + The delivery method for the payment """ - line1: NotRequired[str] + recipient: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsFlightDeliveryRecipient" + ] """ - Address line 1 (e.g., street, PO Box, or company name). + Details of the recipient. """ - line2: NotRequired[str] + + class UpdateParamsPaymentDetailsFlightDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - Address line 2 (e.g., apartment, suite, unit, or building). + The email of the recipient the ticket is delivered to. """ - postal_code: NotRequired[str] + name: NotRequired[str] """ - ZIP or postal code. + The name of the recipient the ticket is delivered to. """ - state: NotRequired[str] + phone: NotRequired[str] """ - State, county, province, or region. + The phone number of the recipient the ticket is delivered to. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class UpdateParamsPaymentDetailsFlightPassenger(TypedDict): + name: str """ - The amount that will be transferred automatically when a charge succeeds. - The amount is capped at the total transaction amount and if no amount is set, - the full amount is transferred. - - If you intend to collect a fee and you need a more robust reporting experience, using - [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) - might be a better fit for your integration. + Full name of the person or entity on the flight reservation. """ - destination: str + + class UpdateParamsPaymentDetailsFlightSegment(TypedDict): + amount: NotRequired[int] """ - If specified, successful charges will be attributed to the destination - account for tax reporting, and the funds from charges will be transferred - to the destination account. The ID of the resulting transfer will be - returned on the successful charge's `transfer` field. + The flight segment amount. """ - - class IncrementAuthorizationParams(TypedDict): - amount: int + arrival_airport: NotRequired[str] """ - The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. + The International Air Transport Association (IATA) airport code for the arrival airport. """ - application_fee_amount: NotRequired[int] + arrives_at: NotRequired[int] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The arrival time for the flight segment. Measured in seconds since the Unix epoch. """ - description: NotRequired[str] + carrier: NotRequired[str] """ - An arbitrary string attached to the object. Often useful for displaying to users. + The International Air Transport Association (IATA) carrier code of the carrier operating the flight segment. """ - expand: NotRequired[List[str]] + departs_at: int """ - Specifies which fields in the response should be expanded. + The departure time for the flight segment. Measured in seconds since the Unix epoch. """ - metadata: NotRequired[Dict[str, str]] + departure_airport: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + The International Air Transport Association (IATA) airport code for the departure airport. """ - statement_descriptor: NotRequired[str] + flight_number: NotRequired[str] """ - Text that appears on the customer's statement as the statement descriptor for a non-card or card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + The flight number associated with the segment """ - transfer_data: NotRequired[ - "PaymentIntentService.IncrementAuthorizationParamsTransferData" + service_class: NotRequired[ + Literal["business", "economy", "first", "premium_economy"] ] """ - The parameters used to automatically create a transfer after the payment is captured. - Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The fare class for the segment. """ - class IncrementAuthorizationParamsTransferData(TypedDict): - amount: NotRequired[int] + class UpdateParamsPaymentDetailsLodging(TypedDict): + address: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodgingAddress" + ] """ - The amount that will be transferred automatically when a charge succeeds. + The lodging location's address. """ - - class ListParams(TypedDict): - created: NotRequired["PaymentIntentService.ListParamsCreated|int"] + adults: NotRequired[int] """ - A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + The number of adults on the booking """ - customer: NotRequired[str] + affiliate: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodgingAffiliate" + ] """ - Only return PaymentIntents for the customer that this customer ID specifies. + Affiliate details for this purchase. """ - ending_before: NotRequired[str] + booking_number: 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. + The booking number associated with the lodging reservation. """ - expand: NotRequired[List[str]] + category: NotRequired[Literal["hotel", "vacation_rental"]] """ - Specifies which fields in the response should be expanded. + The lodging category """ - limit: NotRequired[int] + checkin_at: int """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Lodging check-in time. Measured in seconds since the Unix epoch. """ - starting_after: NotRequired[str] + checkout_at: int """ - 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. + Lodging check-out time. Measured in seconds since the Unix epoch. """ - - class ListParamsCreated(TypedDict): - gt: NotRequired[int] + customer_service_phone_number: NotRequired[str] """ - Minimum value to filter by (exclusive) + The customer service phone number of the lodging company. """ - gte: NotRequired[int] + daily_room_rate_amount: NotRequired[int] """ - Minimum value to filter by (inclusive) + The daily lodging room rate. """ - lt: NotRequired[int] + delivery: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodgingDelivery" + ] """ - Maximum value to filter by (exclusive) + Delivery details for this purchase. """ - lte: NotRequired[int] + extra_charges: NotRequired[ + List[ + Literal[ + "gift_shop", + "laundry", + "mini_bar", + "other", + "restaurant", + "telephone", + ] + ] + ] """ - Maximum value to filter by (inclusive) + List of additional charges being billed. """ - - class RetrieveParams(TypedDict): - client_secret: NotRequired[str] + fire_safety_act_compliance: NotRequired[bool] """ - The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. + Indicates whether the lodging location is compliant with the Fire Safety Act. """ - expand: NotRequired[List[str]] + name: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The name of the lodging location. + """ + no_show: NotRequired[bool] + """ + Indicates if the customer did not keep their booking while failing to cancel the reservation. + """ + number_of_rooms: NotRequired[int] + """ + The number of rooms on the booking + """ + passengers: NotRequired[ + List[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodgingPassenger" + ] + ] + """ + The details of the passengers in the travel reservation + """ + property_phone_number: NotRequired[str] + """ + The phone number of the lodging location. """ - - class SearchParams(TypedDict): - expand: NotRequired[List[str]] + room_class: NotRequired[str] """ - Specifies which fields in the response should be expanded. + The room class for this purchase. """ - limit: NotRequired[int] + room_nights: NotRequired[int] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + The number of room nights """ - page: NotRequired[str] + total_room_tax_amount: NotRequired[int] """ - A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + The total tax amount associating with the room reservation. """ - query: str + total_tax_amount: NotRequired[int] """ - The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). + The total tax amount """ - class UpdateParams(TypedDict): - amount: NotRequired[int] + class UpdateParamsPaymentDetailsLodgingAddress(TypedDict): + city: NotRequired[str] """ - Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + City, district, suburb, town, or village. """ - application_fee_amount: NotRequired["Literal['']|int"] + country: NotRequired[str] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ - capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] - ] + line1: NotRequired[str] """ - Controls when the funds will be captured from the customer's account. + Address line 1 (e.g., street, PO Box, or company name). """ - currency: NotRequired[str] + line2: NotRequired[str] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Address line 2 (e.g., apartment, suite, unit, or building). """ - customer: NotRequired[str] + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. """ - ID of the Customer this PaymentIntent belongs to, if one exists. - - Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + class UpdateParamsPaymentDetailsLodgingAffiliate(TypedDict): + name: str """ - description: NotRequired[str] + The name of the affiliate that originated the purchase. """ - An arbitrary string attached to the object. Often useful for displaying to users. + + class UpdateParamsPaymentDetailsLodgingDelivery(TypedDict): + mode: NotRequired[Literal["email", "phone", "pickup", "post"]] """ - expand: NotRequired[List[str]] + The delivery method for the payment """ - Specifies which fields in the response should be expanded. + recipient: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsLodgingDeliveryRecipient" + ] """ - metadata: NotRequired["Literal['']|Dict[str, str]"] + Details of the recipient. """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + + class UpdateParamsPaymentDetailsLodgingDeliveryRecipient(TypedDict): + email: NotRequired[str] """ - payment_method: NotRequired[str] + The email of the recipient the ticket is delivered to. """ - ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. To unset this field to null, pass in an empty string. + name: NotRequired[str] """ - payment_method_configuration: NotRequired[str] + The name of the recipient the ticket is delivered to. """ - The ID of the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) to use with this PaymentIntent. + phone: NotRequired[str] """ - payment_method_data: NotRequired[ - "PaymentIntentService.UpdateParamsPaymentMethodData" - ] + The phone number of the recipient the ticket is delivered to. """ - If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - property on the PaymentIntent. + + class UpdateParamsPaymentDetailsLodgingPassenger(TypedDict): + name: str """ - payment_method_options: NotRequired[ - "PaymentIntentService.UpdateParamsPaymentMethodOptions" + Full name of the person or entity on the lodging reservation. + """ + + class UpdateParamsPaymentDetailsSubscription(TypedDict): + affiliate: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsSubscriptionAffiliate" ] """ - Payment-method-specific configuration for this PaymentIntent. + Affiliate details for this purchase. """ - payment_method_types: NotRequired[List[str]] + auto_renewal: NotRequired[bool] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + Info whether the subscription will be auto renewed upon expiry. """ - receipt_email: NotRequired["Literal['']|str"] + billing_interval: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentDetailsSubscriptionBillingInterval" + ] """ - Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + Subscription billing details for this purchase. """ - setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" - ] + ends_at: NotRequired[int] """ - Indicates that you intend to make future payments with this PaymentIntent's payment method. - - If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. - - If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. - - When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). - - If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + Subscription end time. Measured in seconds since the Unix epoch. """ - shipping: NotRequired[ - "Literal['']|PaymentIntentService.UpdateParamsShipping" - ] + name: str """ - Shipping information for this PaymentIntent. + Name of the product on subscription. e.g. Apple Music Subscription """ - statement_descriptor: NotRequired[str] + starts_at: NotRequired[int] """ - Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). - - Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Subscription start time. Measured in seconds since the Unix epoch. """ - statement_descriptor_suffix: NotRequired[str] + + class UpdateParamsPaymentDetailsSubscriptionAffiliate(TypedDict): + name: str """ - Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + The name of the affiliate that originated the purchase. """ - transfer_data: NotRequired[ - "PaymentIntentService.UpdateParamsTransferData" - ] + + class UpdateParamsPaymentDetailsSubscriptionBillingInterval(TypedDict): + count: int """ - Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - transfer_group: NotRequired[str] + interval: Literal["day", "month", "week", "year"] """ - A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ class UpdateParamsPaymentMethodData(TypedDict): @@ -5846,12 +9969,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataIdeal" ] @@ -5894,6 +10029,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -5958,6 +10099,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPix" ] @@ -5970,12 +10117,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataRevolutPay" ] @@ -6000,12 +10159,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSwish" ] @@ -6036,13 +10207,16 @@ class UpdateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -6053,13 +10227,18 @@ class UpdateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -6281,9 +10460,18 @@ class UpdateParamsPaymentMethodDataFpx(TypedDict): class UpdateParamsPaymentMethodDataGiropay(TypedDict): pass + class UpdateParamsPaymentMethodDataGopay(TypedDict): + pass + class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass + class UpdateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -6346,6 +10534,9 @@ class UpdateParamsPaymentMethodDataKrCard(TypedDict): class UpdateParamsPaymentMethodDataLink(TypedDict): pass + class UpdateParamsPaymentMethodDataMbWay(TypedDict): + pass + class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -6431,18 +10622,55 @@ class UpdateParamsPaymentMethodDataPaynow(TypedDict): class UpdateParamsPaymentMethodDataPaypal(TypedDict): pass + class UpdateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class UpdateParamsPaymentMethodDataPix(TypedDict): pass class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass + class UpdateParamsPaymentMethodDataQris(TypedDict): + pass + class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class UpdateParamsPaymentMethodDataRechnung(TypedDict): + dob: "PaymentIntentService.UpdateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class UpdateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -6458,12 +10686,25 @@ class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class UpdateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class UpdateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class UpdateParamsPaymentMethodDataSwish(TypedDict): pass @@ -6613,12 +10854,24 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ + gopay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsGopay" + ] + """ + If this is a `gopay` PaymentMethod, this sub-hash contains details about the Gopay payment method options. + """ grabpay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ + id_bank_transfer: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsIdBankTransfer" + ] + """ + If this is a `id_bank_transfer` PaymentMethod, this sub-hash contains details about the Indonesia Bank Transfer payment method options. + """ ideal: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsIdeal" ] @@ -6661,6 +10914,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ + mb_way: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMbWay" + ] + """ + If this is a `mb_way` PaymentMethod, this sub-hash contains details about the MB WAY payment method options. + """ mobilepay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMobilepay" ] @@ -6721,6 +10980,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` PaymentMethod, this sub-hash contains details about the PayTo payment method options. + """ pix: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPix" ] @@ -6733,6 +10998,18 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ + qris: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsQris" + ] + """ + If this is a `qris` PaymentMethod, this sub-hash contains details about the QRIS payment method options. + """ + rechnung: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this sub-hash contains details about the Rechnung payment method options. + """ revolut_pay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsRevolutPay" ] @@ -6757,12 +11034,24 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + shopeepay: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsShopeepay" + ] + """ + If this is a `shopeepay` PaymentMethod, this sub-hash contains details about the ShopeePay payment method options. + """ sofort: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ + stripe_balance: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsStripeBalance" + ] + """ + If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSwish" ] @@ -7122,6 +11411,12 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] @@ -7142,6 +11437,12 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ + request_partial_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request partial authorization on this PaymentIntent. + """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] @@ -7174,6 +11475,12 @@ class UpdateParamsPaymentMethodOptionsCard(TypedDict): """ Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ + statement_details: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCardStatementDetails" + ] + """ + Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. + """ three_d_secure: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -7272,6 +11579,46 @@ class UpdateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): Routing requested priority """ + class UpdateParamsPaymentMethodOptionsCardStatementDetails(TypedDict): + address: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardStatementDetailsAddress" + ] + """ + Please pass in an address that is within your Stripe user account country + """ + phone: NotRequired[str] + """ + Phone number (e.g., a toll-free number that customers can call) + """ + + class UpdateParamsPaymentMethodOptionsCardStatementDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] @@ -7446,7 +11793,21 @@ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ - class UpdateParamsPaymentMethodOptionsEps(TypedDict): + class UpdateParamsPaymentMethodOptionsEps(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7460,7 +11821,7 @@ class UpdateParamsPaymentMethodOptionsEps(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class UpdateParamsPaymentMethodOptionsFpx(TypedDict): + class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7474,7 +11835,7 @@ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ - class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): + class UpdateParamsPaymentMethodOptionsGopay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7502,6 +11863,28 @@ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsIdBankTransfer(TypedDict): + expires_after: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from 5 minutes from now until 31 days from now. If unset, it defaults to 3 days from now. + """ + expires_at: NotRequired[int] + """ + The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" @@ -7698,6 +12081,20 @@ class UpdateParamsPaymentMethodOptionsLink(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsMbWay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -7844,6 +12241,14 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): """ Controls when the funds will be captured from the customer's account. """ + line_items: NotRequired[ + List[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsPaypalLineItem" + ] + ] + """ + The line items purchased by the customer. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -7876,6 +12281,10 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. @@ -7894,6 +12303,131 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class UpdateParamsPaymentMethodOptionsPaypalLineItem(TypedDict): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + name: str + """ + Descriptive name of the line item. + """ + quantity: int + """ + Quantity of the line item. Must be a positive number. + """ + sku: NotRequired[str] + """ + Client facing stock keeping unit, article number or similar. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + tax: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsPaypalLineItemTax" + ] + """ + The tax information for the line item. + """ + unit_amount: int + """ + Price for a single unit of the line item in minor units. Cannot be a negative number. + """ + + class UpdateParamsPaymentMethodOptionsPaypalLineItemTax(TypedDict): + amount: int + """ + The tax for a single unit of the line item in minor units. Cannot be a negative number. + """ + behavior: Literal["exclusive", "inclusive"] + """ + The tax behavior for the line item. + """ + + class UpdateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ class UpdateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] @@ -7931,6 +12465,23 @@ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsQris(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class UpdateParamsPaymentMethodOptionsRechnung(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -8005,6 +12556,20 @@ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'. """ + class UpdateParamsPaymentMethodOptionsShopeepay(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" @@ -8027,6 +12592,22 @@ class UpdateParamsPaymentMethodOptionsSofort(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsStripeBalance(TypedDict): + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -8118,6 +12699,12 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -8129,7 +12716,14 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -8148,6 +12742,18 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -8753,6 +13359,80 @@ async def confirm_async( ), ) + def decrement_authorization( + self, + intent: str, + params: "PaymentIntentService.DecrementAuthorizationParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + PaymentIntent, + self._request( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def decrement_authorization_async( + self, + intent: str, + params: "PaymentIntentService.DecrementAuthorizationParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Perform a decremental authorization on an eligible + [PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/object). To be eligible, the + PaymentIntent's status must be requires_capture and + [decremental_authorization.status](https://docs.stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) + must be available. + + Decremental authorizations decrease the authorized amount on your customer's card + to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. + + After decrement, the PaymentIntent object + returns with the updated + [amount](https://docs.stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + The PaymentIntent will now be capturable up to the new authorized amount. + + Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. + After it's fully captured, a PaymentIntent can no longer be decremented. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/payment_intents/{intent}/decrement_authorization".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) + def increment_authorization( self, intent: str, @@ -8886,3 +13566,47 @@ async def verify_microdeposits_async( options=options, ), ) + + def trigger_action( + self, + intent: str, + params: "PaymentIntentService.TriggerActionParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + PaymentIntent, + self._request( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def trigger_action_async( + self, + intent: str, + params: "PaymentIntentService.TriggerActionParams", + options: RequestOptions = {}, + ) -> PaymentIntent: + """ + Trigger an external action on a PaymentIntent. + """ + return cast( + PaymentIntent, + await self._request_async( + "post", + "/v1/test/payment_intents/{intent}/trigger_action".format( + intent=sanitize_id(intent), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 53c60c42a..2eb8c5f00 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -828,11 +828,13 @@ class CreateParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", "ideal", "klarna", "konbini", "link", + "mb_way", "mobilepay", "multibanco", "oxxo", @@ -840,10 +842,14 @@ class CreateParams(RequestOptions): "pay_by_bank", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "satispay", "sepa_debit", + "shopeepay", "sofort", "swish", "twint", @@ -1770,7 +1776,7 @@ class ModifyParams(RequestOptions): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). @@ -2577,11 +2583,13 @@ class RetrieveParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", "ideal", "klarna", "konbini", "link", + "mb_way", "mobilepay", "multibanco", "oxxo", @@ -2589,10 +2597,14 @@ class RetrieveParams(RequestOptions): "pay_by_bank", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "satispay", "sepa_debit", + "shopeepay", "sofort", "swish", "twint", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 628f4d055..71fe9feb6 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -136,11 +136,13 @@ class CreateParams(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", "ideal", "klarna", "konbini", "link", + "mb_way", "mobilepay", "multibanco", "oxxo", @@ -148,10 +150,14 @@ class CreateParams(TypedDict): "pay_by_bank", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "satispay", "sepa_debit", + "shopeepay", "sofort", "swish", "twint", @@ -1080,7 +1086,7 @@ class UpdateParams(TypedDict): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 5e02947ae..7b1071510 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -39,6 +39,10 @@ class PaymentMethod( OBJECT_NAME: ClassVar[Literal["payment_method"]] = "payment_method" class AcssDebit(StripeObject): + account_number: Optional[str] + """ + Account number of the bank account. + """ bank_name: Optional[str] """ Name of the bank associated with the bank account. @@ -864,9 +868,18 @@ class Fpx(StripeObject): class Giropay(StripeObject): pass + class Gopay(StripeObject): + pass + class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + bank_code: Optional[str] + bank_name: Optional[str] + display_name: Optional[str] + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -1067,6 +1080,9 @@ class Link(StripeObject): [Deprecated] This is a legacy parameter that no longer has any function. """ + class MbWay(StripeObject): + pass + class Mobilepay(StripeObject): pass @@ -1161,6 +1177,10 @@ class Paypal(StripeObject): """ Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1170,6 +1190,25 @@ class Paypal(StripeObject): """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ class Pix(StripeObject): pass @@ -1177,12 +1216,33 @@ class Pix(StripeObject): class Promptpay(StripeObject): pass + class Qris(StripeObject): + pass + class RadarOptions(StripeObject): session: Optional[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class Rechnung(StripeObject): + class Dob(StripeObject): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + dob: Optional[Dob] + _inner_class_types = {"dob": Dob} + class RevolutPay(StripeObject): pass @@ -1229,12 +1289,25 @@ class GeneratedFrom(StripeObject): """ _inner_class_types = {"generated_from": GeneratedFrom} + class Shopeepay(StripeObject): + pass + class Sofort(StripeObject): country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ + class StripeBalance(StripeObject): + account: Optional[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: Literal["bank_account", "card", "fpx"] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class Swish(StripeObject): pass @@ -1294,6 +1367,10 @@ class Blocked(StripeObject): """ Account holder type: individual or company. """ + account_number: Optional[str] + """ + Account number of the bank account. + """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. @@ -1338,10 +1415,14 @@ class Zip(StripeObject): pass class AttachParams(RequestOptions): - customer: str + customer: NotRequired[str] """ The ID of the customer to which to attach the PaymentMethod. """ + customer_account: NotRequired[str] + """ + The ID of the account to which to attach the PaymentMethod. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -1444,10 +1525,20 @@ class CreateParams(RequestOptions): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["PaymentMethod.CreateParamsGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired["PaymentMethod.CreateParamsGrabpay"] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentMethod.CreateParamsIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentMethod.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -1478,6 +1569,10 @@ class CreateParams(RequestOptions): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["PaymentMethod.CreateParamsMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -1526,6 +1621,10 @@ class CreateParams(RequestOptions): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["PaymentMethod.CreateParamsPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["PaymentMethod.CreateParamsPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -1534,10 +1633,18 @@ class CreateParams(RequestOptions): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["PaymentMethod.CreateParamsQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired["PaymentMethod.CreateParamsRadarOptions"] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired["PaymentMethod.CreateParamsRechnung"] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired["PaymentMethod.CreateParamsRevolutPay"] """ If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. @@ -1554,10 +1661,18 @@ class CreateParams(RequestOptions): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired["PaymentMethod.CreateParamsShopeepay"] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired["PaymentMethod.CreateParamsSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired["PaymentMethod.CreateParamsStripeBalance"] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["PaymentMethod.CreateParamsSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -1586,13 +1701,16 @@ class CreateParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -1603,13 +1721,18 @@ class CreateParams(RequestOptions): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -1860,9 +1983,18 @@ class CreateParamsFpx(TypedDict): class CreateParamsGiropay(TypedDict): pass + class CreateParamsGopay(TypedDict): + pass + class CreateParamsGrabpay(TypedDict): pass + class CreateParamsIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -1923,6 +2055,9 @@ class CreateParamsKrCard(TypedDict): class CreateParamsLink(TypedDict): pass + class CreateParamsMbWay(TypedDict): + pass + class CreateParamsMobilepay(TypedDict): pass @@ -2008,18 +2143,55 @@ class CreateParamsPaynow(TypedDict): class CreateParamsPaypal(TypedDict): pass + class CreateParamsPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPix(TypedDict): pass class CreateParamsPromptpay(TypedDict): pass + class CreateParamsQris(TypedDict): + pass + class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsRechnung(TypedDict): + dob: "PaymentMethod.CreateParamsRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsRevolutPay(TypedDict): pass @@ -2035,12 +2207,25 @@ class CreateParamsSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsShopeepay(TypedDict): + pass + class CreateParamsSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsSwish(TypedDict): pass @@ -2122,13 +2307,16 @@ class ListParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -2139,13 +2327,18 @@ class ListParams(RequestOptions): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -2190,6 +2383,10 @@ class ModifyParams(RequestOptions): """ If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. """ + payto: NotRequired["PaymentMethod.ModifyParamsPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ us_bank_account: NotRequired["PaymentMethod.ModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -2273,6 +2470,20 @@ class ModifyParamsLink(TypedDict): class ModifyParamsPayByBank(TypedDict): pass + class ModifyParamsPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class ModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2317,15 +2528,18 @@ class RetrieveParams(RequestOptions): """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. """ + customer_account: Optional[str] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] id: str """ Unique identifier for the object. """ + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] kakao_pay: Optional[KakaoPay] @@ -2337,6 +2551,7 @@ class RetrieveParams(RequestOptions): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + mb_way: Optional[MbWay] metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -2355,17 +2570,22 @@ class RetrieveParams(RequestOptions): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] promptpay: Optional[Promptpay] + qris: Optional[Qris] radar_options: Optional[RadarOptions] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: Optional[Rechnung] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] + stripe_balance: Optional[StripeBalance] swish: Optional[Swish] twint: Optional[Twint] type: Literal[ @@ -2388,7 +2608,9 @@ class RetrieveParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "interac_present", "kakao_pay", @@ -2396,6 +2618,7 @@ class RetrieveParams(RequestOptions): "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -2406,13 +2629,18 @@ class RetrieveParams(RequestOptions): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -2903,7 +3131,9 @@ async def retrieve_async( "eps": Eps, "fpx": Fpx, "giropay": Giropay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "interac_present": InteracPresent, "kakao_pay": KakaoPay, @@ -2911,6 +3141,7 @@ async def retrieve_async( "konbini": Konbini, "kr_card": KrCard, "link": Link, + "mb_way": MbWay, "mobilepay": Mobilepay, "multibanco": Multibanco, "naver_pay": NaverPay, @@ -2921,14 +3152,19 @@ async def retrieve_async( "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "promptpay": Promptpay, + "qris": Qris, "radar_options": RadarOptions, + "rechnung": Rechnung, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, + "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index c9b83b450..f2ed80a24 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -499,6 +499,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Gopay(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Grabpay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -521,6 +543,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class IdBankTransfer(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Ideal(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -895,6 +939,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Payto(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Pix(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -939,6 +1005,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Qris(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class RevolutPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1027,6 +1115,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Shopeepay(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Sofort(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1274,10 +1384,20 @@ class CreateParams(RequestOptions): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired["PaymentMethodConfiguration.CreateParamsGopay"] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired["PaymentMethodConfiguration.CreateParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfiguration.CreateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired["PaymentMethodConfiguration.CreateParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. @@ -1366,6 +1486,10 @@ class CreateParams(RequestOptions): """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ + payto: NotRequired["PaymentMethodConfiguration.CreateParamsPayto"] + """ + PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. + """ pix: NotRequired["PaymentMethodConfiguration.CreateParamsPix"] """ Pix is a payment method popular in Brazil. When paying with Pix, customers authenticate and approve payments by scanning a QR code in their preferred banking app. Check this [page](https://docs.stripe.com/payments/pix) for more details. @@ -1376,6 +1500,10 @@ class CreateParams(RequestOptions): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfiguration.CreateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPay" ] @@ -1400,6 +1528,12 @@ class CreateParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfiguration.CreateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired["PaymentMethodConfiguration.CreateParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. @@ -1737,6 +1871,20 @@ class CreateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsGrabpayDisplayPreference" @@ -1751,6 +1899,20 @@ class CreateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsIdealDisplayPreference" @@ -1989,6 +2151,20 @@ class CreateParamsPaypalDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayto(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsPaytoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPaytoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPix(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPixDisplayPreference" @@ -2017,6 +2193,20 @@ class CreateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPayDisplayPreference" @@ -2073,6 +2263,20 @@ class CreateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSofortDisplayPreference" @@ -2298,10 +2502,20 @@ class ModifyParams(RequestOptions): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired["PaymentMethodConfiguration.ModifyParamsGopay"] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired["PaymentMethodConfiguration.ModifyParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired["PaymentMethodConfiguration.ModifyParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. @@ -2386,6 +2600,10 @@ class ModifyParams(RequestOptions): """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ + payto: NotRequired["PaymentMethodConfiguration.ModifyParamsPayto"] + """ + PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. + """ pix: NotRequired["PaymentMethodConfiguration.ModifyParamsPix"] """ Pix is a payment method popular in Brazil. When paying with Pix, customers authenticate and approve payments by scanning a QR code in their preferred banking app. Check this [page](https://docs.stripe.com/payments/pix) for more details. @@ -2396,6 +2614,10 @@ class ModifyParams(RequestOptions): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfiguration.ModifyParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPay" ] @@ -2420,6 +2642,12 @@ class ModifyParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired["PaymentMethodConfiguration.ModifyParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. @@ -2757,6 +2985,20 @@ class ModifyParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGrabpayDisplayPreference" @@ -2771,6 +3013,20 @@ class ModifyParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsIdealDisplayPreference" @@ -3009,6 +3265,20 @@ class ModifyParamsPaypalDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsPayto(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsPaytoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsPaytoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsPix(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPixDisplayPreference" @@ -3037,6 +3307,20 @@ class ModifyParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPayDisplayPreference" @@ -3093,6 +3377,20 @@ class ModifyParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSofortDisplayPreference" @@ -3212,11 +3510,13 @@ class RetrieveParams(RequestOptions): fpx: Optional[Fpx] giropay: Optional[Giropay] google_pay: Optional[GooglePay] + gopay: Optional[Gopay] grabpay: Optional[Grabpay] id: str """ Unique identifier for the object. """ + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] is_default: bool """ @@ -3254,12 +3554,15 @@ class RetrieveParams(RequestOptions): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] promptpay: Optional[Promptpay] + qris: Optional[Qris] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] @@ -3425,7 +3728,9 @@ async def retrieve_async( "fpx": Fpx, "giropay": Giropay, "google_pay": GooglePay, + "gopay": Gopay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "jcb": Jcb, "kakao_pay": KakaoPay, @@ -3443,12 +3748,15 @@ async def retrieve_async( "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "promptpay": Promptpay, + "qris": Qris, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, "sofort": Sofort, "swish": Swish, "twint": Twint, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index 30fa37262..6ba9a32b0 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -137,12 +137,24 @@ class CreateParams(TypedDict): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsGopay" + ] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdeal" ] @@ -245,6 +257,12 @@ class CreateParams(TypedDict): """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ + payto: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPayto" + ] + """ + PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. + """ pix: NotRequired["PaymentMethodConfigurationService.CreateParamsPix"] """ Pix is a payment method popular in Brazil. When paying with Pix, customers authenticate and approve payments by scanning a QR code in their preferred banking app. Check this [page](https://docs.stripe.com/payments/pix) for more details. @@ -255,6 +273,10 @@ class CreateParams(TypedDict): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfigurationService.CreateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPay" ] @@ -279,6 +301,12 @@ class CreateParams(TypedDict): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofort" ] @@ -622,6 +650,20 @@ class CreateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpayDisplayPreference" @@ -636,6 +678,20 @@ class CreateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdealDisplayPreference" @@ -874,6 +930,20 @@ class CreateParamsPaypalDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayto(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPaytoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPaytoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPix(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPixDisplayPreference" @@ -902,6 +972,20 @@ class CreateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPayDisplayPreference" @@ -958,6 +1042,20 @@ class CreateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofortDisplayPreference" @@ -1201,12 +1299,24 @@ class UpdateParams(TypedDict): """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ + gopay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsGopay" + ] + """ + GoPay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Gojek app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Gojek app to confirm payment. + """ grabpay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ + id_bank_transfer: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsIdBankTransfer" + ] + """ + Stripe users in Indonesia can receive bank transfers from customers in Indonesia. Bank transfers are a popular B2C and B2B payment method in Indonesia. + """ ideal: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdeal" ] @@ -1305,6 +1415,12 @@ class UpdateParams(TypedDict): """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ + payto: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPayto" + ] + """ + PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. + """ pix: NotRequired["PaymentMethodConfigurationService.UpdateParamsPix"] """ Pix is a payment method popular in Brazil. When paying with Pix, customers authenticate and approve payments by scanning a QR code in their preferred banking app. Check this [page](https://docs.stripe.com/payments/pix) for more details. @@ -1315,6 +1431,10 @@ class UpdateParams(TypedDict): """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ + qris: NotRequired["PaymentMethodConfigurationService.UpdateParamsQris"] + """ + QRIS is a [real-time](https://docs.stripe.com/payments/real-time) payment method popular in Indonesia. When paying with QRIS, customers authenticate and approve payments by scanning a QR code in their preferred digital wallet app. + """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPay" ] @@ -1339,6 +1459,12 @@ class UpdateParams(TypedDict): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ + shopeepay: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsShopeepay" + ] + """ + ShopeePay is a [single use](https://stripe.com/docs/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. + """ sofort: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofort" ] @@ -1682,6 +1808,20 @@ class UpdateParamsGooglePayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsGopay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsGopayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsGopayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpayDisplayPreference" @@ -1696,6 +1836,20 @@ class UpdateParamsGrabpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsIdBankTransfer(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsIdBankTransferDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsIdBankTransferDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdealDisplayPreference" @@ -1934,6 +2088,20 @@ class UpdateParamsPaypalDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsPayto(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPaytoDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsPaytoDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsPix(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPixDisplayPreference" @@ -1962,6 +2130,20 @@ class UpdateParamsPromptpayDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsQris(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsQrisDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsQrisDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPayDisplayPreference" @@ -2018,6 +2200,20 @@ class UpdateParamsSepaDebitDisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsShopeepay(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsShopeepayDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsShopeepayDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofortDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index aec38a34e..8c42e896d 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -11,10 +11,14 @@ class PaymentMethodService(StripeService): class AttachParams(TypedDict): - customer: str + customer: NotRequired[str] """ The ID of the customer to which to attach the PaymentMethod. """ + customer_account: NotRequired[str] + """ + The ID of the account to which to attach the PaymentMethod. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -119,10 +123,20 @@ class CreateParams(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["PaymentMethodService.CreateParamsGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired["PaymentMethodService.CreateParamsGrabpay"] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "PaymentMethodService.CreateParamsIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["PaymentMethodService.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -153,6 +167,10 @@ class CreateParams(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["PaymentMethodService.CreateParamsMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -203,6 +221,10 @@ class CreateParams(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["PaymentMethodService.CreateParamsPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["PaymentMethodService.CreateParamsPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -211,12 +233,20 @@ class CreateParams(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["PaymentMethodService.CreateParamsQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "PaymentMethodService.CreateParamsRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired["PaymentMethodService.CreateParamsRechnung"] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired["PaymentMethodService.CreateParamsRevolutPay"] """ If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. @@ -233,10 +263,20 @@ class CreateParams(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired["PaymentMethodService.CreateParamsShopeepay"] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired["PaymentMethodService.CreateParamsSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "PaymentMethodService.CreateParamsStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["PaymentMethodService.CreateParamsSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -265,13 +305,16 @@ class CreateParams(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -282,13 +325,18 @@ class CreateParams(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -541,9 +589,18 @@ class CreateParamsFpx(TypedDict): class CreateParamsGiropay(TypedDict): pass + class CreateParamsGopay(TypedDict): + pass + class CreateParamsGrabpay(TypedDict): pass + class CreateParamsIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -604,6 +661,9 @@ class CreateParamsKrCard(TypedDict): class CreateParamsLink(TypedDict): pass + class CreateParamsMbWay(TypedDict): + pass + class CreateParamsMobilepay(TypedDict): pass @@ -689,18 +749,55 @@ class CreateParamsPaynow(TypedDict): class CreateParamsPaypal(TypedDict): pass + class CreateParamsPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPix(TypedDict): pass class CreateParamsPromptpay(TypedDict): pass + class CreateParamsQris(TypedDict): + pass + class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsRechnung(TypedDict): + dob: "PaymentMethodService.CreateParamsRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsRevolutPay(TypedDict): pass @@ -716,12 +813,25 @@ class CreateParamsSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsShopeepay(TypedDict): + pass + class CreateParamsSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsSwish(TypedDict): pass @@ -803,13 +913,16 @@ class ListParams(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -820,13 +933,18 @@ class ListParams(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -877,6 +995,10 @@ class UpdateParams(TypedDict): """ If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. """ + payto: NotRequired["PaymentMethodService.UpdateParamsPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ us_bank_account: NotRequired[ "PaymentMethodService.UpdateParamsUsBankAccount" ] @@ -962,6 +1084,20 @@ class UpdateParamsLink(TypedDict): class UpdateParamsPayByBank(TypedDict): pass + class UpdateParamsPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class UpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1143,7 +1279,7 @@ async def update_async( def attach( self, payment_method: str, - params: "PaymentMethodService.AttachParams", + params: "PaymentMethodService.AttachParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ @@ -1177,7 +1313,7 @@ def attach( async def attach_async( self, payment_method: str, - params: "PaymentMethodService.AttachParams", + params: "PaymentMethodService.AttachParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py new file mode 100644 index 000000000..82417fa14 --- /dev/null +++ b/stripe/_payment_record.py @@ -0,0 +1,2916 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._expandable_field import ExpandableField +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._mandate import Mandate + from stripe._payment_method import PaymentMethod + + +class PaymentRecord(APIResource["PaymentRecord"]): + """ + A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. + For example, you can create a Payment Record to model a payment made on a different payment processor, + in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or + more Payment Attempt Records, which represent individual attempts made on a payment network. + """ + + OBJECT_NAME: ClassVar[Literal["payment_record"]] = "payment_record" + + class AmountCanceled(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountFailed(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountGuaranteed(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class AmountRequested(StripeObject): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class CustomerDetails(StripeObject): + customer: Optional[str] + """ + ID of the Stripe Customer associated with this payment. + """ + email: Optional[str] + """ + The customer's email address. + """ + name: Optional[str] + """ + The customer's name. + """ + phone: Optional[str] + """ + The customer's phone number. + """ + + class PaymentMethodDetails(StripeObject): + class AchCreditTransfer(StripeObject): + account_number: Optional[str] + """ + Account number to transfer funds to. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the routing number. + """ + routing_number: Optional[str] + """ + Routing transit number for the bank account to transfer funds to. + """ + swift_code: Optional[str] + """ + SWIFT code of the bank associated with the routing number. + """ + + class AchDebit(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Type of entity that holds the account. This can be either `individual` or `company`. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + routing_number: Optional[str] + """ + Routing transit number of the bank account. + """ + + class AcssDebit(StripeObject): + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + institution_number: Optional[str] + """ + Institution number of the bank account + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + transit_number: Optional[str] + """ + Transit number of the bank account. + """ + + class Affirm(StripeObject): + location: Optional[str] + """ + ID of the [location](https://stripe.com/docs/api/terminal/locations) that this transaction's reader is assigned to. + """ + reader: Optional[str] + """ + ID of the [reader](https://stripe.com/docs/api/terminal/readers) this transaction was made on. + """ + transaction_id: Optional[str] + """ + The Affirm transaction ID associated with this payment. + """ + + class AfterpayClearpay(StripeObject): + order_id: Optional[str] + """ + The Afterpay order ID associated with this payment intent. + """ + reference: Optional[str] + """ + Order identifier shown to the merchant in Afterpay's online portal. + """ + + class Alipay(StripeObject): + buyer_id: Optional[str] + """ + Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + """ + transaction_id: Optional[str] + """ + Transaction ID of this particular Alipay transaction. + """ + + class Alma(StripeObject): + pass + + class AmazonPay(StripeObject): + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} + + class AuBecsDebit(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + + class BacsDebit(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + sort_code: Optional[str] + """ + Sort code of the bank account. (e.g., `10-20-30`) + """ + + class Bancontact(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + preferred_language: Optional[Literal["de", "en", "fr", "nl"]] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + Can be one of `en`, `de`, `fr`, or `nl` + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Bancontact directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class Billie(StripeObject): + pass + + class BillingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Address + """ + A representation of a physical address. + """ + email: Optional[str] + """ + The billing email associated with the method of payment. + """ + name: Optional[str] + """ + The billing name associated with the method of payment. + """ + phone: Optional[str] + """ + The billing phone number associated with the method of payment. + """ + _inner_class_types = {"address": Address} + + class Blik(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by BLIK to every buyer. + """ + + class Boleto(StripeObject): + tax_id: str + """ + The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) + """ + + class Card(StripeObject): + class Checks(StripeObject): + address_line1_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + address_postal_code_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + cvc_check: Optional[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + + class NetworkToken(StripeObject): + used: bool + + class ThreeDSecure(StripeObject): + authentication_flow: Optional[ + Literal["challenge", "frictionless"] + ] + result: Optional[ + Literal[ + "attempt_acknowledged", + "authenticated", + "exempted", + "failed", + "not_supported", + "processing_error", + ] + ] + result_reason: Optional[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ] + ] + version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] + + brand: Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + """ + checks: Optional[Checks] + """ + Check results by Card networks on Card address and CVC at time of payment. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Literal["credit", "debit", "prepaid", "unknown"] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: str + """ + The last four digits of the card. + """ + moto: Optional[bool] + """ + True if this payment was marked as MOTO and out of scope for SCA. + """ + network: Optional[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] + ] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_token: Optional[NetworkToken] + """ + If this card has network token credentials, this contains the details of the network token credentials. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + three_d_secure: Optional[ThreeDSecure] + """ + Populated if this transaction used 3D Secure authentication. + """ + _inner_class_types = { + "checks": Checks, + "network_token": NetworkToken, + "three_d_secure": ThreeDSecure, + } + + class CardPresent(StripeObject): + class Offline(StripeObject): + stored_at: Optional[int] + """ + Time at which the payment was collected while offline + """ + type: Optional[Literal["deferred"]] + """ + The method used to process this payment method offline. Only deferred is allowed. + """ + + class Receipt(StripeObject): + account_type: Optional[ + Literal["checking", "credit", "prepaid", "unknown"] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + class Wallet(StripeObject): + type: Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ] + """ + The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + """ + + amount_authorized: Optional[int] + """ + The authorized amount + """ + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + """ + capture_before: Optional[int] + """ + When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + incremental_authorization_supported: bool + """ + Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + offline: Optional[Offline] + """ + Details about payments collected offline. + """ + overcapture_supported: bool + """ + Defines whether the authorized amount can be over-captured or not + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + wallet: Optional[Wallet] + _inner_class_types = { + "offline": Offline, + "receipt": Receipt, + "wallet": Wallet, + } + + class Cashapp(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by Cash App to every buyer. + """ + cashtag: Optional[str] + """ + A public identifier for buyers using Cash App. + """ + + class Custom(StripeObject): + display_name: str + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: Optional[str] + """ + The custom payment method type associated with this payment. + """ + + class CustomerBalance(StripeObject): + pass + + class Eps(StripeObject): + bank: Optional[ + Literal[ + "arzte_und_apotheker_bank", + "austrian_anadi_bank_ag", + "bank_austria", + "bankhaus_carl_spangler", + "bankhaus_schelhammer_und_schattera_ag", + "bawag_psk_ag", + "bks_bank_ag", + "brull_kallmus_bank_ag", + "btv_vier_lander_bank", + "capital_bank_grawe_gruppe_ag", + "deutsche_bank_ag", + "dolomitenbank", + "easybank_ag", + "erste_bank_und_sparkassen", + "hypo_alpeadriabank_international_ag", + "hypo_bank_burgenland_aktiengesellschaft", + "hypo_noe_lb_fur_niederosterreich_u_wien", + "hypo_oberosterreich_salzburg_steiermark", + "hypo_tirol_bank_ag", + "hypo_vorarlberg_bank_ag", + "marchfelder_bank", + "oberbank_ag", + "raiffeisen_bankengruppe_osterreich", + "schoellerbank_ag", + "sparda_bank_wien", + "volksbank_gruppe", + "volkskreditbank_ag", + "vr_bank_braunau", + ] + ] + """ + The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by EPS directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + EPS rarely provides this information so the attribute is usually empty. + """ + + class Fpx(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type, if provided. Can be one of `individual` or `company`. + """ + bank: Literal[ + "affin_bank", + "agrobank", + "alliance_bank", + "ambank", + "bank_islam", + "bank_muamalat", + "bank_of_china", + "bank_rakyat", + "bsn", + "cimb", + "deutsche_bank", + "hong_leong_bank", + "hsbc", + "kfh", + "maybank2e", + "maybank2u", + "ocbc", + "pb_enterprise", + "public_bank", + "rhb", + "standard_chartered", + "uob", + ] + """ + The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + """ + transaction_id: Optional[str] + """ + Unique transaction id generated by FPX for every request from the merchant + """ + + class Giropay(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Giropay directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Giropay rarely provides this information so the attribute is usually empty. + """ + + class Gopay(StripeObject): + pass + + class Grabpay(StripeObject): + transaction_id: Optional[str] + """ + Unique transaction id generated by GrabPay + """ + + class IdBankTransfer(StripeObject): + account_number: str + """ + Account number of the bank account to transfer funds to. + """ + bank: Literal["bca", "bni", "bri", "cimb", "permata"] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + + class Ideal(StripeObject): + bank: Optional[ + Literal[ + "abn_amro", + "asn_bank", + "bunq", + "handelsbanken", + "ing", + "knab", + "moneyou", + "n26", + "nn", + "rabobank", + "regiobank", + "revolut", + "sns_bank", + "triodos_bank", + "van_lanschot", + "yoursafe", + ] + ] + """ + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + """ + bic: Optional[ + Literal[ + "ABNANL2A", + "ASNBNL21", + "BITSNL2A", + "BUNQNL2A", + "FVLBNL22", + "HANDNL2A", + "INGBNL2A", + "KNABNL2H", + "MOYONL21", + "NNBANL2G", + "NTSBDEB1", + "RABONL2U", + "RBRBNL21", + "REVOIE23", + "REVOLT21", + "SNSBNL2A", + "TRIONL2U", + ] + ] + """ + The Bank Identifier Code of the customer's bank. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by iDEAL directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class InteracPresent(StripeObject): + class Receipt(StripeObject): + account_type: Optional[ + Literal["checking", "savings", "unknown"] + ] + """ + The type of account being debited or credited + """ + application_cryptogram: Optional[str] + """ + EMV tag 9F26, cryptogram generated by the integrated circuit chip. + """ + application_preferred_name: Optional[str] + """ + Mnenomic of the Application Identifier. + """ + authorization_code: Optional[str] + """ + Identifier for this transaction. + """ + authorization_response_code: Optional[str] + """ + EMV tag 8A. A code returned by the card issuer. + """ + cardholder_verification_method: Optional[str] + """ + Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + """ + dedicated_file_name: Optional[str] + """ + EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + """ + terminal_verification_results: Optional[str] + """ + The outcome of a series of EMV functions performed by the card reader. + """ + transaction_status_information: Optional[str] + """ + An indication of various EMV functions performed during the transaction. + """ + + brand: Optional[str] + """ + Card brand. Can be `interac`, `mastercard` or `visa`. + """ + cardholder_name: Optional[str] + """ + The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + description: Optional[str] + """ + A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + """ + emv_auth_data: Optional[str] + """ + Authorization response cryptogram. + """ + exp_month: int + """ + Two-digit number representing the card's expiration month. + """ + exp_year: int + """ + Four-digit number representing the card's expiration year. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + + *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + generated_card: Optional[str] + """ + ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + """ + iin: Optional[str] + """ + Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + """ + issuer: Optional[str] + """ + The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + network: Optional[str] + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + network_transaction_id: Optional[str] + """ + This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ + preferred_locales: Optional[List[str]] + """ + EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + """ + read_method: Optional[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ] + ] + """ + How card details were read in this transaction. + """ + receipt: Optional[Receipt] + """ + A collection of fields required to be displayed on receipts. Only required for EMV transactions. + """ + _inner_class_types = {"receipt": Receipt} + + class KakaoPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Klarna(StripeObject): + class PayerDetails(StripeObject): + class Address(StripeObject): + country: Optional[str] + """ + The payer address country + """ + + address: Optional[Address] + """ + The payer's address + """ + _inner_class_types = {"address": Address} + + payer_details: Optional[PayerDetails] + """ + The payer details for this transaction. + """ + payment_method_category: Optional[str] + """ + The Klarna payment method used for this transaction. + Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` + """ + preferred_locale: Optional[str] + """ + Preferred language of the Klarna authorization page that the customer is redirected to. + Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` + """ + _inner_class_types = {"payer_details": PayerDetails} + + class Konbini(StripeObject): + class Store(StripeObject): + chain: Optional[ + Literal["familymart", "lawson", "ministop", "seicomart"] + ] + """ + The name of the convenience store chain where the payment was completed. + """ + + store: Optional[Store] + """ + If the payment succeeded, this contains the details of the convenience store where the payment was completed. + """ + _inner_class_types = {"store": Store} + + class KrCard(StripeObject): + brand: Optional[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ] + ] + """ + The local credit or debit card brand. + """ + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + last4: Optional[str] + """ + The last four digits of the card. This may not be present for American Express cards. + """ + + class Link(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the funding source country beneath the Link payment. + You could use this attribute to get a sense of international fees. + """ + + class MbWay(StripeObject): + pass + + class Mobilepay(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Brand of the card used in the transaction + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card + """ + exp_month: Optional[int] + """ + Two digit number representing the card's expiration month + """ + exp_year: Optional[int] + """ + Two digit number representing the card's expiration year + """ + last4: Optional[str] + """ + The last 4 digits of the card + """ + + card: Optional[Card] + """ + Internal card details + """ + _inner_class_types = {"card": Card} + + class Multibanco(StripeObject): + entity: Optional[str] + """ + Entity number associated with this Multibanco payment. + """ + reference: Optional[str] + """ + Reference number associated with this Multibanco payment. + """ + + class NaverPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class NzBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod's billing details. + """ + bank_code: str + """ + The numeric code for the bank account's bank. + """ + bank_name: str + """ + The name of the bank. + """ + branch_code: str + """ + The numeric code for the bank account's bank branch. + """ + last4: str + """ + Last four digits of the bank account number. + """ + suffix: Optional[str] + """ + The suffix of the bank account number. + """ + + class Oxxo(StripeObject): + number: Optional[str] + """ + OXXO reference number + """ + + class P24(StripeObject): + bank: Optional[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ] + ] + """ + The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + """ + reference: Optional[str] + """ + Unique reference for this Przelewy24 payment. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by Przelewy24 directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Przelewy24 rarely provides this information so the attribute is usually empty. + """ + + class PayByBank(StripeObject): + pass + + class Payco(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Paynow(StripeObject): + reference: Optional[str] + """ + Reference number associated with this PayNow payment + """ + + class Paypal(StripeObject): + class SellerProtection(StripeObject): + dispute_categories: Optional[ + List[Literal["fraudulent", "product_not_received"]] + ] + """ + An array of conditions that are covered for the transaction, if applicable. + """ + status: Literal[ + "eligible", "not_eligible", "partially_eligible" + ] + """ + Indicates whether the transaction is eligible for PayPal's seller protection. + """ + + class Shipping(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class VerifiedAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + payer_email: Optional[str] + """ + Owner's email. Values are provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + payer_id: Optional[str] + """ + PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + """ + payer_name: Optional[str] + """ + Owner's full name. Values provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + seller_protection: Optional[SellerProtection] + """ + The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + """ + shipping: Optional[Shipping] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ + transaction_id: Optional[str] + """ + A unique ID generated by PayPal for this transaction. + """ + verified_address: Optional[VerifiedAddress] + """ + The shipping address for the customer, as supplied by the merchant at the point of payment + execution. This shipping address will not be updated if the merchant updates the shipping + address on the PaymentIntent after the PaymentIntent was successfully confirmed. + """ + verified_email: Optional[str] + """ + Owner's verified email. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by PayPal directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + _inner_class_types = { + "seller_protection": SellerProtection, + "shipping": Shipping, + "verified_address": VerifiedAddress, + } + + class Payto(StripeObject): + bsb_number: Optional[str] + """ + Bank-State-Branch number of the bank account. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[str] + """ + ID of the mandate used to make this payment. + """ + pay_id: Optional[str] + """ + The PayID alias for the bank account. + """ + + class Pix(StripeObject): + bank_transaction_id: Optional[str] + """ + Unique transaction id generated by BCB + """ + + class Promptpay(StripeObject): + reference: Optional[str] + """ + Bill reference generated by PromptPay + """ + + class Qris(StripeObject): + pass + + class Rechnung(StripeObject): + pass + + class RevolutPay(StripeObject): + class Funding(StripeObject): + class Card(StripeObject): + brand: Optional[str] + """ + Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ + brand_product: Optional[str] + """ + The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.) + """ + country: Optional[str] + """ + Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + """ + exp_month: Optional[int] + """ + Two-digit number representing the card's expiration month. + """ + exp_year: Optional[int] + """ + Four-digit number representing the card's expiration year. + """ + funding: Optional[str] + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + + card: Optional[Card] + type: Optional[Literal["card"]] + """ + funding type of the underlying payment method. + """ + _inner_class_types = {"card": Card} + + funding: Optional[Funding] + _inner_class_types = {"funding": Funding} + + class SamsungPay(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ + + class Satispay(StripeObject): + pass + + class SepaCreditTransfer(StripeObject): + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + iban: Optional[str] + """ + IBAN of the bank account to transfer funds to. + """ + + class SepaDebit(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + branch_code: Optional[str] + """ + Branch code of bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four characters of the IBAN. + """ + mandate: Optional[str] + """ + Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + """ + + class Shopeepay(StripeObject): + pass + + class Sofort(StripeObject): + bank_code: Optional[str] + """ + Bank code of bank associated with the bank account. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + bic: Optional[str] + """ + Bank Identifier Code of the bank associated with the bank account. + """ + country: Optional[str] + """ + Two-letter ISO code representing the country the bank account is located in. + """ + generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] + """ + The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + """ + iban_last4: Optional[str] + """ + Last four characters of the IBAN. + """ + preferred_language: Optional[ + Literal["de", "en", "es", "fr", "it", "nl", "pl"] + ] + """ + Preferred language of the SOFORT authorization page that the customer is redirected to. + Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + """ + verified_name: Optional[str] + """ + Owner's verified full name. Values are verified or provided by SOFORT directly + (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ + + class StripeAccount(StripeObject): + pass + + class StripeBalance(StripeObject): + account: Optional[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: Literal["bank_account", "card", "fpx"] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + + class Swish(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + """ + payment_reference: Optional[str] + """ + Payer bank reference number for the payment + """ + verified_phone_last4: Optional[str] + """ + The last four digits of the Swish account phone number + """ + + class Twint(StripeObject): + pass + + class UsBankAccount(StripeObject): + account_holder_type: Optional[Literal["company", "individual"]] + """ + Account holder type: individual or company. + """ + account_type: Optional[Literal["checking", "savings"]] + """ + Account type: checkings or savings. Defaults to checking if omitted. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + mandate: Optional[ExpandableField["Mandate"]] + """ + ID of the mandate used to make this payment. + """ + payment_reference: Optional[str] + """ + Reference number to locate ACH payments with customer's bank. + """ + routing_number: Optional[str] + """ + Routing number of the bank account. + """ + + class Wechat(StripeObject): + pass + + class WechatPay(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular WeChat Pay account. You can use this attribute to check whether two WeChat accounts are the same. + """ + location: Optional[str] + """ + ID of the [location](https://stripe.com/docs/api/terminal/locations) that this transaction's reader is assigned to. + """ + reader: Optional[str] + """ + ID of the [reader](https://stripe.com/docs/api/terminal/readers) this transaction was made on. + """ + transaction_id: Optional[str] + """ + Transaction ID of this particular WeChat Pay transaction. + """ + + class Zip(StripeObject): + pass + + ach_credit_transfer: Optional[AchCreditTransfer] + ach_debit: Optional[AchDebit] + acss_debit: Optional[AcssDebit] + affirm: Optional[Affirm] + afterpay_clearpay: Optional[AfterpayClearpay] + alipay: Optional[Alipay] + alma: Optional[Alma] + amazon_pay: Optional[AmazonPay] + au_becs_debit: Optional[AuBecsDebit] + bacs_debit: Optional[BacsDebit] + bancontact: Optional[Bancontact] + billie: Optional[Billie] + billing_details: Optional[BillingDetails] + """ + The billing details associated with the method of payment. + """ + blik: Optional[Blik] + boleto: Optional[Boleto] + card: Optional[Card] + """ + Details of the card used for this payment attempt. + """ + card_present: Optional[CardPresent] + cashapp: Optional[Cashapp] + custom: Optional[Custom] + """ + Custom Payment Methods represent Payment Method types not modeled directly in + the Stripe API. This resource consists of details about the custom payment method + used for this payment attempt. + """ + customer_balance: Optional[CustomerBalance] + eps: Optional[Eps] + fpx: Optional[Fpx] + giropay: Optional[Giropay] + gopay: Optional[Gopay] + grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] + ideal: Optional[Ideal] + interac_present: Optional[InteracPresent] + kakao_pay: Optional[KakaoPay] + klarna: Optional[Klarna] + konbini: Optional[Konbini] + kr_card: Optional[KrCard] + link: Optional[Link] + mb_way: Optional[MbWay] + mobilepay: Optional[Mobilepay] + multibanco: Optional[Multibanco] + naver_pay: Optional[NaverPay] + nz_bank_account: Optional[NzBankAccount] + oxxo: Optional[Oxxo] + p24: Optional[P24] + pay_by_bank: Optional[PayByBank] + payco: Optional[Payco] + payment_method: Optional[str] + """ + ID of the Stripe PaymentMethod used to make this payment. + """ + paynow: Optional[Paynow] + paypal: Optional[Paypal] + payto: Optional[Payto] + pix: Optional[Pix] + promptpay: Optional[Promptpay] + qris: Optional[Qris] + rechnung: Optional[Rechnung] + revolut_pay: Optional[RevolutPay] + samsung_pay: Optional[SamsungPay] + satispay: Optional[Satispay] + sepa_credit_transfer: Optional[SepaCreditTransfer] + sepa_debit: Optional[SepaDebit] + shopeepay: Optional[Shopeepay] + sofort: Optional[Sofort] + stripe_account: Optional[StripeAccount] + stripe_balance: Optional[StripeBalance] + swish: Optional[Swish] + twint: Optional[Twint] + type: str + """ + The type of transaction-specific details of the payment method used in the payment. See [PaymentMethod.type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type) for the full list of possible types. + An additional hash is included on `payment_method_details` with a name matching this value. + It contains information specific to the payment method. + """ + us_bank_account: Optional[UsBankAccount] + wechat: Optional[Wechat] + wechat_pay: Optional[WechatPay] + zip: Optional[Zip] + _inner_class_types = { + "ach_credit_transfer": AchCreditTransfer, + "ach_debit": AchDebit, + "acss_debit": AcssDebit, + "affirm": Affirm, + "afterpay_clearpay": AfterpayClearpay, + "alipay": Alipay, + "alma": Alma, + "amazon_pay": AmazonPay, + "au_becs_debit": AuBecsDebit, + "bacs_debit": BacsDebit, + "bancontact": Bancontact, + "billie": Billie, + "billing_details": BillingDetails, + "blik": Blik, + "boleto": Boleto, + "card": Card, + "card_present": CardPresent, + "cashapp": Cashapp, + "custom": Custom, + "customer_balance": CustomerBalance, + "eps": Eps, + "fpx": Fpx, + "giropay": Giropay, + "gopay": Gopay, + "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, + "ideal": Ideal, + "interac_present": InteracPresent, + "kakao_pay": KakaoPay, + "klarna": Klarna, + "konbini": Konbini, + "kr_card": KrCard, + "link": Link, + "mb_way": MbWay, + "mobilepay": Mobilepay, + "multibanco": Multibanco, + "naver_pay": NaverPay, + "nz_bank_account": NzBankAccount, + "oxxo": Oxxo, + "p24": P24, + "pay_by_bank": PayByBank, + "payco": Payco, + "paynow": Paynow, + "paypal": Paypal, + "payto": Payto, + "pix": Pix, + "promptpay": Promptpay, + "qris": Qris, + "rechnung": Rechnung, + "revolut_pay": RevolutPay, + "samsung_pay": SamsungPay, + "satispay": Satispay, + "sepa_credit_transfer": SepaCreditTransfer, + "sepa_debit": SepaDebit, + "shopeepay": Shopeepay, + "sofort": Sofort, + "stripe_account": StripeAccount, + "stripe_balance": StripeBalance, + "swish": Swish, + "twint": Twint, + "us_bank_account": UsBankAccount, + "wechat": Wechat, + "wechat_pay": WechatPay, + "zip": Zip, + } + + class ShippingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Address + """ + A representation of a physical address. + """ + name: Optional[str] + """ + The shipping recipient's name. + """ + phone: Optional[str] + """ + The shipping recipient's phone number. + """ + _inner_class_types = {"address": Address} + + class ReportPaymentAttemptCanceledParams(RequestOptions): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptFailedParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptGuaranteedParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptParams(RequestOptions): + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed: NotRequired["PaymentRecord.ReportPaymentAttemptParamsFailed"] + """ + Information about the payment attempt failure. + """ + guaranteed: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsGuaranteed" + ] + """ + Information about the payment attempt guarantee. + """ + initiated_at: int + """ + When the reported payment was initiated. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + outcome: NotRequired[Literal["failed", "guaranteed"]] + """ + The outcome of the reported payment. + """ + payment_method_details: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsPaymentMethodDetails" + ] + """ + Information about the Payment Method debited for this payment. + """ + shipping_details: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsShippingDetails" + ] + """ + Shipping information for this payment. + """ + + class ReportPaymentAttemptParamsFailed(TypedDict): + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentAttemptParamsGuaranteed(TypedDict): + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetails(TypedDict): + billing_details: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetails" + ] + """ + The billing details associated with the method of payment. + """ + custom: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsPaymentMethodDetailsCustom" + ] + """ + Information about the custom (user-defined) payment method used to make this payment. + """ + payment_method: NotRequired[str] + """ + ID of the Stripe Payment Method used to make this payment. + """ + type: NotRequired[Literal["custom"]] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetails( + TypedDict, + ): + address: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + The billing address associated with the method of payment. + """ + email: NotRequired[str] + """ + The billing email associated with the method of payment. + """ + name: NotRequired[str] + """ + The billing name associated with the method of payment. + """ + phone: NotRequired[str] + """ + The billing phone number associated with the method of payment. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsCustom(TypedDict): + display_name: NotRequired[str] + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: NotRequired[str] + """ + The custom payment method type associated with this payment. + """ + + class ReportPaymentAttemptParamsShippingDetails(TypedDict): + address: NotRequired[ + "PaymentRecord.ReportPaymentAttemptParamsShippingDetailsAddress" + ] + """ + The physical shipping address. + """ + name: NotRequired[str] + """ + The shipping recipient's name. + """ + phone: NotRequired[str] + """ + The shipping recipient's phone number. + """ + + class ReportPaymentAttemptParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentParams(RequestOptions): + amount_requested: "PaymentRecord.ReportPaymentParamsAmountRequested" + """ + The amount you initially requested for this payment. + """ + customer_details: NotRequired[ + "PaymentRecord.ReportPaymentParamsCustomerDetails" + ] + """ + Customer information for this payment. + """ + customer_presence: NotRequired[Literal["off_session", "on_session"]] + """ + Indicates whether the customer was present in your checkout flow during this payment. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed: NotRequired["PaymentRecord.ReportPaymentParamsFailed"] + """ + Information about the payment attempt failure. + """ + guaranteed: NotRequired["PaymentRecord.ReportPaymentParamsGuaranteed"] + """ + Information about the payment attempt guarantee. + """ + initiated_at: int + """ + When the reported payment was initiated. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + outcome: NotRequired[Literal["failed", "guaranteed"]] + """ + The outcome of the reported payment. + """ + payment_method_details: ( + "PaymentRecord.ReportPaymentParamsPaymentMethodDetails" + ) + """ + Information about the Payment Method debited for this payment. + """ + payment_reference: NotRequired[str] + """ + An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + """ + shipping_details: NotRequired[ + "PaymentRecord.ReportPaymentParamsShippingDetails" + ] + """ + Shipping information for this payment. + """ + + class ReportPaymentParamsAmountRequested(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class ReportPaymentParamsCustomerDetails(TypedDict): + customer: NotRequired[str] + """ + The customer who made the payment. + """ + email: NotRequired[str] + """ + The customer's phone number. + """ + name: NotRequired[str] + """ + The customer's name. + """ + phone: NotRequired[str] + """ + The customer's phone number. + """ + + class ReportPaymentParamsFailed(TypedDict): + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentParamsGuaranteed(TypedDict): + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentParamsPaymentMethodDetails(TypedDict): + billing_details: NotRequired[ + "PaymentRecord.ReportPaymentParamsPaymentMethodDetailsBillingDetails" + ] + """ + The billing details associated with the method of payment. + """ + custom: NotRequired[ + "PaymentRecord.ReportPaymentParamsPaymentMethodDetailsCustom" + ] + """ + Information about the custom (user-defined) payment method used to make this payment. + """ + payment_method: NotRequired[str] + """ + ID of the Stripe Payment Method used to make this payment. + """ + type: NotRequired[Literal["custom"]] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + class ReportPaymentParamsPaymentMethodDetailsBillingDetails(TypedDict): + address: NotRequired[ + "PaymentRecord.ReportPaymentParamsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + The billing address associated with the method of payment. + """ + email: NotRequired[str] + """ + The billing email associated with the method of payment. + """ + name: NotRequired[str] + """ + The billing name associated with the method of payment. + """ + phone: NotRequired[str] + """ + The billing phone number associated with the method of payment. + """ + + class ReportPaymentParamsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentParamsPaymentMethodDetailsCustom(TypedDict): + display_name: NotRequired[str] + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: NotRequired[str] + """ + The custom payment method type associated with this payment. + """ + + class ReportPaymentParamsShippingDetails(TypedDict): + address: NotRequired[ + "PaymentRecord.ReportPaymentParamsShippingDetailsAddress" + ] + """ + The physical shipping address. + """ + name: NotRequired[str] + """ + The shipping recipient's name. + """ + phone: NotRequired[str] + """ + The shipping recipient's phone number. + """ + + class ReportPaymentParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount_canceled: AmountCanceled + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_failed: AmountFailed + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_guaranteed: AmountGuaranteed + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + amount_requested: AmountRequested + """ + A representation of an amount of money, consisting of an amount and a currency. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer_details: Optional[CustomerDetails] + """ + Customer information for this payment. + """ + customer_presence: Optional[Literal["off_session", "on_session"]] + """ + Indicates whether the customer was present in your checkout flow during this payment. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + id: str + """ + Unique identifier for the object. + """ + latest_payment_attempt_record: Optional[str] + """ + ID of the latest Payment Attempt Record attached to this Payment Record. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["payment_record"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Information about the Payment Method debited for this payment. + """ + payment_reference: Optional[str] + """ + An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + """ + shipping_details: Optional[ShippingDetails] + """ + Shipping information for this payment. + """ + + @classmethod + def report_payment( + cls, **params: Unpack["PaymentRecord.ReportPaymentParams"] + ) -> "PaymentRecord": + """ + Report a new Payment Record. You may report a Payment Record as it is + initialized and later report updates through the other report_* methods, or report Payment + Records in a terminal state directly, through this method. + """ + return cast( + "PaymentRecord", + cls._static_request( + "post", + "/v1/payment_records/report_payment", + params=params, + ), + ) + + @classmethod + async def report_payment_async( + cls, **params: Unpack["PaymentRecord.ReportPaymentParams"] + ) -> "PaymentRecord": + """ + Report a new Payment Record. You may report a Payment Record as it is + initialized and later report updates through the other report_* methods, or report Payment + Records in a terminal state directly, through this method. + """ + return cast( + "PaymentRecord", + await cls._static_request_async( + "post", + "/v1/payment_records/report_payment", + params=params, + ), + ) + + @classmethod + def _cls_report_payment_attempt( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"], + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + "PaymentRecord", + cls._static_request( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def report_payment_attempt( + id: str, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + ... + + @overload + def report_payment_attempt( + self, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + ... + + @class_method_variant("_cls_report_payment_attempt") + def report_payment_attempt( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + "PaymentRecord", + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_report_payment_attempt_async( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"], + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + "PaymentRecord", + await cls._static_request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def report_payment_attempt_async( + id: str, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + ... + + @overload + async def report_payment_attempt_async( + self, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_async") + async def report_payment_attempt_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["PaymentRecord.ReportPaymentAttemptParams"] + ) -> "PaymentRecord": + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + "PaymentRecord", + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_report_payment_attempt_canceled( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + "PaymentRecord", + cls._static_request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def report_payment_attempt_canceled( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + ... + + @overload + def report_payment_attempt_canceled( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_canceled") + def report_payment_attempt_canceled( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + "PaymentRecord", + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_report_payment_attempt_canceled_async( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + "PaymentRecord", + await cls._static_request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def report_payment_attempt_canceled_async( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + ... + + @overload + async def report_payment_attempt_canceled_async( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_canceled_async") + async def report_payment_attempt_canceled_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptCanceledParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + "PaymentRecord", + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_report_payment_attempt_failed( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + "PaymentRecord", + cls._static_request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def report_payment_attempt_failed( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + ... + + @overload + def report_payment_attempt_failed( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_failed") + def report_payment_attempt_failed( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + "PaymentRecord", + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_report_payment_attempt_failed_async( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + "PaymentRecord", + await cls._static_request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def report_payment_attempt_failed_async( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + ... + + @overload + async def report_payment_attempt_failed_async( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_failed_async") + async def report_payment_attempt_failed_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptFailedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + "PaymentRecord", + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_report_payment_attempt_guaranteed( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + "PaymentRecord", + cls._static_request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def report_payment_attempt_guaranteed( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + ... + + @overload + def report_payment_attempt_guaranteed( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_guaranteed") + def report_payment_attempt_guaranteed( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + "PaymentRecord", + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_report_payment_attempt_guaranteed_async( + cls, + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + "PaymentRecord", + await cls._static_request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def report_payment_attempt_guaranteed_async( + id: str, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + ... + + @overload + async def report_payment_attempt_guaranteed_async( + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + ... + + @class_method_variant("_cls_report_payment_attempt_guaranteed_async") + async def report_payment_attempt_guaranteed_async( # pyright: ignore[reportGeneralTypeIssues] + self, + **params: Unpack["PaymentRecord.ReportPaymentAttemptGuaranteedParams"], + ) -> "PaymentRecord": + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + "PaymentRecord", + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["PaymentRecord.RetrieveParams"] + ) -> "PaymentRecord": + """ + Retrieves a Payment Record with the given ID + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["PaymentRecord.RetrieveParams"] + ) -> "PaymentRecord": + """ + Retrieves a Payment Record with the given ID + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "amount_canceled": AmountCanceled, + "amount_failed": AmountFailed, + "amount_guaranteed": AmountGuaranteed, + "amount_requested": AmountRequested, + "customer_details": CustomerDetails, + "payment_method_details": PaymentMethodDetails, + "shipping_details": ShippingDetails, + } diff --git a/stripe/_payment_record_service.py b/stripe/_payment_record_service.py new file mode 100644 index 000000000..9b15c55e3 --- /dev/null +++ b/stripe/_payment_record_service.py @@ -0,0 +1,723 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._payment_record import PaymentRecord +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PaymentRecordService(StripeService): + class ReportPaymentAttemptCanceledParams(TypedDict): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptFailedParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptGuaranteedParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + + class ReportPaymentAttemptParams(TypedDict): + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsFailed" + ] + """ + Information about the payment attempt failure. + """ + guaranteed: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsGuaranteed" + ] + """ + Information about the payment attempt guarantee. + """ + initiated_at: int + """ + When the reported payment was initiated. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + outcome: NotRequired[Literal["failed", "guaranteed"]] + """ + The outcome of the reported payment. + """ + payment_method_details: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsPaymentMethodDetails" + ] + """ + Information about the Payment Method debited for this payment. + """ + shipping_details: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsShippingDetails" + ] + """ + Shipping information for this payment. + """ + + class ReportPaymentAttemptParamsFailed(TypedDict): + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentAttemptParamsGuaranteed(TypedDict): + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetails(TypedDict): + billing_details: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetails" + ] + """ + The billing details associated with the method of payment. + """ + custom: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsPaymentMethodDetailsCustom" + ] + """ + Information about the custom (user-defined) payment method used to make this payment. + """ + payment_method: NotRequired[str] + """ + ID of the Stripe Payment Method used to make this payment. + """ + type: NotRequired[Literal["custom"]] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetails( + TypedDict, + ): + address: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + The billing address associated with the method of payment. + """ + email: NotRequired[str] + """ + The billing email associated with the method of payment. + """ + name: NotRequired[str] + """ + The billing name associated with the method of payment. + """ + phone: NotRequired[str] + """ + The billing phone number associated with the method of payment. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentAttemptParamsPaymentMethodDetailsCustom(TypedDict): + display_name: NotRequired[str] + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: NotRequired[str] + """ + The custom payment method type associated with this payment. + """ + + class ReportPaymentAttemptParamsShippingDetails(TypedDict): + address: NotRequired[ + "PaymentRecordService.ReportPaymentAttemptParamsShippingDetailsAddress" + ] + """ + The physical shipping address. + """ + name: NotRequired[str] + """ + The shipping recipient's name. + """ + phone: NotRequired[str] + """ + The shipping recipient's phone number. + """ + + class ReportPaymentAttemptParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentParams(TypedDict): + amount_requested: ( + "PaymentRecordService.ReportPaymentParamsAmountRequested" + ) + """ + The amount you initially requested for this payment. + """ + customer_details: NotRequired[ + "PaymentRecordService.ReportPaymentParamsCustomerDetails" + ] + """ + Customer information for this payment. + """ + customer_presence: NotRequired[Literal["off_session", "on_session"]] + """ + Indicates whether the customer was present in your checkout flow during this payment. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + failed: NotRequired["PaymentRecordService.ReportPaymentParamsFailed"] + """ + Information about the payment attempt failure. + """ + guaranteed: NotRequired[ + "PaymentRecordService.ReportPaymentParamsGuaranteed" + ] + """ + Information about the payment attempt guarantee. + """ + initiated_at: int + """ + When the reported payment was initiated. Measured in seconds since the Unix epoch. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + outcome: NotRequired[Literal["failed", "guaranteed"]] + """ + The outcome of the reported payment. + """ + payment_method_details: ( + "PaymentRecordService.ReportPaymentParamsPaymentMethodDetails" + ) + """ + Information about the Payment Method debited for this payment. + """ + payment_reference: NotRequired[str] + """ + An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + """ + shipping_details: NotRequired[ + "PaymentRecordService.ReportPaymentParamsShippingDetails" + ] + """ + Shipping information for this payment. + """ + + class ReportPaymentParamsAmountRequested(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + value: int + """ + A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) for example, 100 cents for 1 USD or 100 for 100 JPY, a zero-decimal currency. + """ + + class ReportPaymentParamsCustomerDetails(TypedDict): + customer: NotRequired[str] + """ + The customer who made the payment. + """ + email: NotRequired[str] + """ + The customer's phone number. + """ + name: NotRequired[str] + """ + The customer's name. + """ + phone: NotRequired[str] + """ + The customer's phone number. + """ + + class ReportPaymentParamsFailed(TypedDict): + failed_at: int + """ + When the reported payment failed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentParamsGuaranteed(TypedDict): + guaranteed_at: int + """ + When the reported payment was guaranteed. Measured in seconds since the Unix epoch. + """ + + class ReportPaymentParamsPaymentMethodDetails(TypedDict): + billing_details: NotRequired[ + "PaymentRecordService.ReportPaymentParamsPaymentMethodDetailsBillingDetails" + ] + """ + The billing details associated with the method of payment. + """ + custom: NotRequired[ + "PaymentRecordService.ReportPaymentParamsPaymentMethodDetailsCustom" + ] + """ + Information about the custom (user-defined) payment method used to make this payment. + """ + payment_method: NotRequired[str] + """ + ID of the Stripe Payment Method used to make this payment. + """ + type: NotRequired[Literal["custom"]] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + class ReportPaymentParamsPaymentMethodDetailsBillingDetails(TypedDict): + address: NotRequired[ + "PaymentRecordService.ReportPaymentParamsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + The billing address associated with the method of payment. + """ + email: NotRequired[str] + """ + The billing email associated with the method of payment. + """ + name: NotRequired[str] + """ + The billing name associated with the method of payment. + """ + phone: NotRequired[str] + """ + The billing phone number associated with the method of payment. + """ + + class ReportPaymentParamsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, + ): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class ReportPaymentParamsPaymentMethodDetailsCustom(TypedDict): + display_name: NotRequired[str] + """ + Display name for the custom (user-defined) payment method type used to make this payment. + """ + type: NotRequired[str] + """ + The custom payment method type associated with this payment. + """ + + class ReportPaymentParamsShippingDetails(TypedDict): + address: NotRequired[ + "PaymentRecordService.ReportPaymentParamsShippingDetailsAddress" + ] + """ + The physical shipping address. + """ + name: NotRequired[str] + """ + The shipping recipient's name. + """ + phone: NotRequired[str] + """ + The shipping recipient's phone number. + """ + + class ReportPaymentParamsShippingDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def retrieve( + self, + id: str, + params: "PaymentRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Retrieves a Payment Record with the given ID + """ + return cast( + PaymentRecord, + self._request( + "get", + "/v1/payment_records/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "PaymentRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Retrieves a Payment Record with the given ID + """ + return cast( + PaymentRecord, + await self._request_async( + "get", + "/v1/payment_records/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def report_payment_attempt( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + PaymentRecord, + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def report_payment_attempt_async( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report a new payment attempt on the specified Payment Record. A new payment + attempt can only be specified if all other payment attempts are canceled or failed. + """ + return cast( + PaymentRecord, + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def report_payment_attempt_canceled( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptCanceledParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + PaymentRecord, + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def report_payment_attempt_canceled_async( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptCanceledParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + was canceled. + """ + return cast( + PaymentRecord, + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_canceled".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def report_payment_attempt_failed( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptFailedParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + PaymentRecord, + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def report_payment_attempt_failed_async( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptFailedParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + failed or errored. + """ + return cast( + PaymentRecord, + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_failed".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def report_payment_attempt_guaranteed( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptGuaranteedParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + PaymentRecord, + self._request( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def report_payment_attempt_guaranteed_async( + self, + id: str, + params: "PaymentRecordService.ReportPaymentAttemptGuaranteedParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report that the most recent payment attempt on the specified Payment Record + was guaranteed. + """ + return cast( + PaymentRecord, + await self._request_async( + "post", + "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def report_payment( + self, + params: "PaymentRecordService.ReportPaymentParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report a new Payment Record. You may report a Payment Record as it is + initialized and later report updates through the other report_* methods, or report Payment + Records in a terminal state directly, through this method. + """ + return cast( + PaymentRecord, + self._request( + "post", + "/v1/payment_records/report_payment", + base_address="api", + params=params, + options=options, + ), + ) + + async def report_payment_async( + self, + params: "PaymentRecordService.ReportPaymentParams", + options: RequestOptions = {}, + ) -> PaymentRecord: + """ + Report a new Payment Record. You may report a Payment Record as it is + initialized and later report updates through the other report_* methods, or report Payment + Records in a terminal state directly, through this method. + """ + return cast( + PaymentRecord, + await self._request_async( + "post", + "/v1/payment_records/report_payment", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_payout.py b/stripe/_payout.py index f5c99c37b..d000d8181 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -87,6 +87,10 @@ class CreateParams(RequestOptions): """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ + payout_method: NotRequired[str] + """ + The ID of a v2 FinancialAccount to send funds to. + """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. @@ -270,6 +274,10 @@ class ReverseParams(RequestOptions): """ If the payout reverses another, this is the ID of the original payout. """ + payout_method: Optional[str] + """ + ID of the v2 FinancialAccount the funds are sent to. + """ reconciliation_status: Literal[ "completed", "in_progress", "not_applicable" ] diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 47ea401b5..b50b51bf5 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -45,6 +45,10 @@ class CreateParams(TypedDict): """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ + payout_method: NotRequired[str] + """ + The ID of a v2 FinancialAccount to send funds to. + """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. diff --git a/stripe/_price.py b/stripe/_price.py index e85e365eb..33573cc5e 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -127,6 +127,20 @@ class CustomUnitAmount(StripeObject): The starting unit amount which can be updated by the customer. """ + class MigrateTo(StripeObject): + behavior: Literal["at_cycle_end"] + """ + The behavior controlling at what point in the subscription lifecycle to migrate the price + """ + effective_after: int + """ + The unix timestamp after at which subscriptions will start to migrate to the new price. + """ + price: str + """ + The id of the price being migrated to + """ + class Recurring(StripeObject): interval: Literal["day", "month", "week", "year"] """ @@ -534,6 +548,10 @@ class ModifyParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + migrate_to: NotRequired["Literal['']|Price.ModifyParamsMigrateTo"] + """ + If specified, subscriptions using this price will be updated to use the new referenced price. + """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. @@ -615,6 +633,20 @@ class ModifyParamsCurrencyOptionsTier(TypedDict): Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ + class ModifyParamsMigrateTo(TypedDict): + behavior: Literal["at_cycle_end"] + """ + The behavior controlling the point in the subscription lifecycle after which to migrate the price. Currently must be `at_cycle_end`. + """ + effective_after: NotRequired[int] + """ + The time after which subscriptions should start using the new price. + """ + price: str + """ + The ID of the price object. + """ + class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -679,6 +711,10 @@ class SearchParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + migrate_to: Optional[MigrateTo] + """ + Subscriptions using this price will be migrated to use the new referenced price. + """ nickname: Optional[str] """ A brief description of the price, hidden from customers. @@ -893,6 +929,7 @@ async def search_auto_paging_iter_async( _inner_class_types = { "currency_options": CurrencyOptions, "custom_unit_amount": CustomUnitAmount, + "migrate_to": MigrateTo, "recurring": Recurring, "tiers": Tier, "transform_quantity": TransformQuantity, diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 28830d162..eb208c2d3 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -394,6 +394,12 @@ class UpdateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + migrate_to: NotRequired[ + "Literal['']|PriceService.UpdateParamsMigrateTo" + ] + """ + If specified, subscriptions using this price will be updated to use the new referenced price. + """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. @@ -477,6 +483,20 @@ class UpdateParamsCurrencyOptionsTier(TypedDict): Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ + class UpdateParamsMigrateTo(TypedDict): + behavior: Literal["at_cycle_end"] + """ + The behavior controlling the point in the subscription lifecycle after which to migrate the price. Currently must be `at_cycle_end`. + """ + effective_after: NotRequired[int] + """ + The time after which subscriptions should start using the new price. + """ + price: str + """ + The ID of the price object. + """ + def list( self, params: "PriceService.ListParams" = {}, diff --git a/stripe/_privacy_service.py b/stripe/_privacy_service.py new file mode 100644 index 000000000..7c66ba9d3 --- /dev/null +++ b/stripe/_privacy_service.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.privacy._redaction_job_service import RedactionJobService + + +class PrivacyService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.redaction_jobs = RedactionJobService(self._requestor) diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index d8f300558..bc44ab5e0 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -79,6 +79,10 @@ class CreateParams(RequestOptions): """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ + customer_account: NotRequired[str] + """ + The account that this promotion code can be used by. If not set, the promotion code can be used by all accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -147,6 +151,10 @@ class ListParams(RequestOptions): """ Only return promotion codes that are restricted to this customer. """ + customer_account: NotRequired[str] + """ + Only return promotion codes that are restricted to this account. + """ 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. @@ -242,6 +250,10 @@ class RetrieveParams(RequestOptions): """ The customer that this promotion code can be used by. """ + customer_account: Optional[str] + """ + The account that this promotion code can be used by. + """ expires_at: Optional[int] """ Date at which the promotion code can no longer be redeemed. diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index 8e154469e..cbeaa42c5 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -29,6 +29,10 @@ class CreateParams(TypedDict): """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ + customer_account: NotRequired[str] + """ + The account that this promotion code can be used by. If not set, the promotion code can be used by all accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -102,6 +106,10 @@ class ListParams(TypedDict): """ Only return promotion codes that are restricted to this customer. """ + customer_account: NotRequired[str] + """ + Only return promotion codes that are restricted to this account. + """ 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. diff --git a/stripe/_quote.py b/stripe/_quote.py index fd2a8baa1..042dee204 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -4,6 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource @@ -23,13 +24,23 @@ from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._invoice import Invoice + from stripe._invoice_line_item import InvoiceLineItem from stripe._line_item import LineItem + from stripe._quote_line import QuoteLine + from stripe._quote_preview_invoice import QuotePreviewInvoice + from stripe._quote_preview_subscription_schedule import ( + QuotePreviewSubscriptionSchedule, + ) from stripe._subscription import Subscription - from stripe._subscription_schedule import SubscriptionSchedule + from stripe._subscription_schedule import ( + SubscriptionSchedule as SubscriptionScheduleResource, + ) from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock +@nested_resource_class_methods("preview_invoice") +@nested_resource_class_methods("preview_subscription_schedule") class Quote( CreateableAPIResource["Quote"], ListableAPIResource["Quote"], @@ -74,6 +85,31 @@ class Liability(StripeObject): _inner_class_types = {"liability": Liability} class Computed(StripeObject): + class LastReestimationDetails(StripeObject): + class Failed(StripeObject): + failure_code: Optional[str] + """ + The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field. + """ + message: Optional[str] + """ + Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID". + """ + reason: Literal["automation_failure", "internal_error"] + """ + The reason the reestimation failed. + """ + + failed: Optional[Failed] + """ + When `status` is `failed`, provides details about the quote reestimation failure. + """ + status: Literal["failed", "in_progress", "succeeded"] + """ + Latest status of the reestimation. + """ + _inner_class_types = {"failed": Failed} + class Recurring(StripeObject): class TotalDetails(StripeObject): class Breakdown(StripeObject): @@ -266,12 +302,24 @@ class Tax(StripeObject): total_details: TotalDetails _inner_class_types = {"total_details": TotalDetails} + last_reestimation_details: Optional[LastReestimationDetails] + """ + Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation. + """ recurring: Optional[Recurring] """ The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices. """ + updated_at: Optional[int] + """ + The time at which the quote's estimated schedules and upcoming invoices were generated. + """ upfront: Upfront - _inner_class_types = {"recurring": Recurring, "upfront": Upfront} + _inner_class_types = { + "last_reestimation_details": LastReestimationDetails, + "recurring": Recurring, + "upfront": Upfront, + } class FromQuote(StripeObject): is_revision: bool @@ -301,6 +349,129 @@ class Issuer(StripeObject): issuer: Issuer _inner_class_types = {"issuer": Issuer} + class StatusDetails(StripeObject): + class Canceled(StripeObject): + reason: Optional[ + Literal[ + "canceled", + "quote_accepted", + "quote_expired", + "quote_superseded", + "subscription_canceled", + ] + ] + """ + The reason this quote was marked as canceled. + """ + transitioned_at: Optional[int] + """ + Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch. + """ + + class Stale(StripeObject): + class LastReason(StripeObject): + class LinesInvalid(StripeObject): + invalid_at: int + """ + The timestamp at which the lines were marked as invalid. + """ + lines: List[str] + """ + The list of lines that became invalid at the given timestamp. + """ + + class SubscriptionChanged(StripeObject): + previous_subscription: Optional["Subscription"] + """ + The subscription's state before the quote was marked as stale. + """ + + class SubscriptionScheduleChanged(StripeObject): + previous_subscription_schedule: Optional[ + "SubscriptionScheduleResource" + ] + """ + The subscription schedule's state before the quote was marked as stale. + """ + + line_invalid: Optional[str] + """ + The ID of the line that is invalid if the stale reason type is `line_invalid`. + """ + lines_invalid: Optional[List[LinesInvalid]] + """ + The IDs of the lines that are invalid if the stale reason type is `lines_invalid`. + """ + marked_stale: Optional[str] + """ + The user supplied mark stale reason. + """ + subscription_canceled: Optional[str] + """ + The ID of the subscription that was canceled. + """ + subscription_changed: Optional[SubscriptionChanged] + subscription_expired: Optional[str] + """ + The ID of the subscription that was expired. + """ + subscription_schedule_canceled: Optional[str] + """ + The ID of the subscription schedule that was canceled. + """ + subscription_schedule_changed: Optional[ + SubscriptionScheduleChanged + ] + subscription_schedule_released: Optional[str] + """ + The ID of the subscription schedule that was released. + """ + type: Optional[ + Literal[ + "accept_failed_validations", + "bill_on_acceptance_invalid", + "line_invalid", + "lines_invalid", + "marked_stale", + "subscription_canceled", + "subscription_changed", + "subscription_expired", + "subscription_schedule_canceled", + "subscription_schedule_changed", + "subscription_schedule_released", + ] + ] + """ + The reason the quote was marked as stale. + """ + _inner_class_types = { + "lines_invalid": LinesInvalid, + "subscription_changed": SubscriptionChanged, + "subscription_schedule_changed": SubscriptionScheduleChanged, + } + + expires_at: Optional[int] + """ + Time at which the quote expires. Measured in seconds since the Unix epoch. + """ + last_reason: Optional[LastReason] + """ + The most recent reason this quote was marked as stale. + """ + last_updated_at: Optional[int] + """ + Time at which the stale reason was updated. Measured in seconds since the Unix epoch. + """ + transitioned_at: Optional[int] + """ + Time at which the quote was marked as stale. Measured in seconds since the Unix epoch. + """ + _inner_class_types = {"last_reason": LastReason} + + canceled: Optional[Canceled] + stale: Optional[Stale] + _inner_class_types = {"canceled": Canceled, "stale": Stale} + class StatusTransitions(StripeObject): accepted_at: Optional[int] """ @@ -316,6 +487,120 @@ class StatusTransitions(StripeObject): """ class SubscriptionData(StripeObject): + class BillOnAcceptance(StripeObject): + class BillFrom(StripeObject): + class LineStartsAt(StripeObject): + id: str + """ + Unique identifier for the object. + """ + + computed: Optional[int] + """ + The materialized time. + """ + line_starts_at: Optional[LineStartsAt] + """ + The timestamp the given line starts at. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + _inner_class_types = {"line_starts_at": LineStartsAt} + + class BillUntil(StripeObject): + class Duration(StripeObject): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class LineEndsAt(StripeObject): + id: str + """ + Unique identifier for the object. + """ + + computed: Optional[int] + """ + The materialized time. + """ + duration: Optional[Duration] + """ + Time span for the quote line starting from the `starts_at` date. + """ + line_ends_at: Optional[LineEndsAt] + """ + The timestamp the given line ends at. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + _inner_class_types = { + "duration": Duration, + "line_ends_at": LineEndsAt, + } + + bill_from: Optional[BillFrom] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: Optional[BillUntil] + """ + The end of the period to bill until when the Quote is accepted. + """ + _inner_class_types = { + "bill_from": BillFrom, + "bill_until": BillUntil, + } + + class Prebilling(StripeObject): + iterations: int + + bill_on_acceptance: Optional[BillOnAcceptance] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: Optional[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_cycle_anchor: Optional[Literal["reset"]] + """ + Whether the subscription will always start a new billing period when the quote is accepted. + """ + billing_mode: Optional[Literal["classic", "flexible"]] + """ + The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be set on the subscription once the quote is accepted. + """ description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -324,14 +609,200 @@ class SubscriptionData(StripeObject): """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. """ + end_behavior: Optional[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + from_subscription: Optional[ExpandableField["Subscription"]] + """ + The id of the subscription that will be updated when the quote is accepted. + """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/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. """ + prebilling: Optional[Prebilling] + """ + If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + """ + proration_behavior: Optional[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + """ trial_period_days: Optional[int] """ Integer representing the number of trial period days before the customer is charged for the first time. """ + _inner_class_types = { + "bill_on_acceptance": BillOnAcceptance, + "prebilling": Prebilling, + } + + class SubscriptionDataOverride(StripeObject): + class AppliesTo(StripeObject): + new_reference: Optional[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: Optional[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class BillOnAcceptance(StripeObject): + class BillFrom(StripeObject): + class LineStartsAt(StripeObject): + id: str + """ + Unique identifier for the object. + """ + + computed: Optional[int] + """ + The materialized time. + """ + line_starts_at: Optional[LineStartsAt] + """ + The timestamp the given line starts at. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + _inner_class_types = {"line_starts_at": LineStartsAt} + + class BillUntil(StripeObject): + class Duration(StripeObject): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class LineEndsAt(StripeObject): + id: str + """ + Unique identifier for the object. + """ + + computed: Optional[int] + """ + The materialized time. + """ + duration: Optional[Duration] + """ + Time span for the quote line starting from the `starts_at` date. + """ + line_ends_at: Optional[LineEndsAt] + """ + The timestamp the given line ends at. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + _inner_class_types = { + "duration": Duration, + "line_ends_at": LineEndsAt, + } + + bill_from: Optional[BillFrom] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: Optional[BillUntil] + """ + The end of the period to bill until when the Quote is accepted. + """ + _inner_class_types = { + "bill_from": BillFrom, + "bill_until": BillUntil, + } + + applies_to: AppliesTo + bill_on_acceptance: Optional[BillOnAcceptance] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: Optional[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + customer: Optional[str] + """ + The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + """ + description: Optional[str] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + end_behavior: Optional[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + proration_behavior: Optional[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + """ + _inner_class_types = { + "applies_to": AppliesTo, + "bill_on_acceptance": BillOnAcceptance, + } + + class SubscriptionSchedule(StripeObject): + class AppliesTo(StripeObject): + new_reference: Optional[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: Optional[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + applies_to: AppliesTo + subscription_schedule: str + """ + The subscription schedule that was created or updated from this quote. + """ + _inner_class_types = {"applies_to": AppliesTo} class TotalDetails(StripeObject): class Breakdown(StripeObject): @@ -438,6 +909,10 @@ class CancelParams(RequestOptions): """ class CreateParams(RequestOptions): + allow_backdated_lines: NotRequired[bool] + """ + Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + """ application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. @@ -460,6 +935,10 @@ class CreateParams(RequestOptions): """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ + customer_account: NotRequired[str] + """ + The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed. + """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. @@ -500,6 +979,10 @@ class CreateParams(RequestOptions): """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ + lines: NotRequired[List["Quote.CreateParamsLine"]] + """ + A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -512,6 +995,12 @@ class CreateParams(RequestOptions): """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ + subscription_data_overrides: NotRequired[ + List["Quote.CreateParamsSubscriptionDataOverride"] + ] + """ + List representing overrides for `subscription_data` configurations for specific subscription schedules. + """ test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. @@ -552,11 +1041,39 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired["Quote.CreateParamsDiscountDiscountEnd"] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired["Quote.CreateParamsDiscountDiscountEndDuration"] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] """ @@ -587,340 +1104,430 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): Type of the account referenced in the request. """ - class CreateParamsLineItem(TypedDict): - discounts: NotRequired[ - "Literal['']|List[Quote.CreateParamsLineItemDiscount]" + class CreateParamsLine(TypedDict): + actions: NotRequired[List["Quote.CreateParamsLineAction"]] + """ + An array of operations the quote line performs. + """ + applies_to: NotRequired["Quote.CreateParamsLineAppliesTo"] + """ + Details to identify the subscription schedule the quote line applies to. + """ + billing_cycle_anchor: NotRequired[ + Literal["automatic", "line_starts_at"] ] """ - The discounts applied to this line item. + For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. """ - price: NotRequired[str] + cancel_subscription_schedule: NotRequired[ + "Quote.CreateParamsLineCancelSubscriptionSchedule" + ] """ - The ID of the price object. One of `price` or `price_data` is required. + A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. """ - price_data: NotRequired["Quote.CreateParamsLineItemPriceData"] + ends_at: NotRequired["Quote.CreateParamsLineEndsAt"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. """ - quantity: NotRequired[int] + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] """ - The quantity of the line item. + Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. """ - tax_rates: NotRequired["Literal['']|List[str]"] + set_pause_collection: NotRequired[ + "Quote.CreateParamsLineSetPauseCollection" + ] """ - The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. """ - - class CreateParamsLineItemDiscount(TypedDict): - coupon: NotRequired[str] + set_schedule_end: NotRequired[ + Literal["line_ends_at", "line_starts_at"] + ] """ - ID of the coupon to create a new discount for. + Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. """ - discount: NotRequired[str] + starts_at: NotRequired["Quote.CreateParamsLineStartsAt"] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + Details to identify the earliest timestamp where the proposed change should take effect. """ - promotion_code: NotRequired[str] + trial_settings: NotRequired["Quote.CreateParamsLineTrialSettings"] """ - ID of the promotion code to create a new discount for. + Settings related to subscription trials. """ - class CreateParamsLineItemPriceData(TypedDict): - currency: str + class CreateParamsLineAction(TypedDict): + add_discount: NotRequired["Quote.CreateParamsLineActionAddDiscount"] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Details for the `add_discount` type. """ - product: str + add_item: NotRequired["Quote.CreateParamsLineActionAddItem"] """ - The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + Details for the `add_item` type. """ - recurring: NotRequired["Quote.CreateParamsLineItemPriceDataRecurring"] + add_metadata: NotRequired[Dict[str, str]] """ - The recurring components of a price such as `interval` and `interval_count`. + Details for the `add_metadata` type: specify a hash of key-value pairs. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] + remove_discount: NotRequired[ + "Quote.CreateParamsLineActionRemoveDiscount" ] """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + Details for the `remove_discount` type. """ - unit_amount: NotRequired[int] + remove_item: NotRequired["Quote.CreateParamsLineActionRemoveItem"] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + Details for the `remove_item` type. """ - unit_amount_decimal: NotRequired[str] + remove_metadata: NotRequired[List[str]] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + Details for the `remove_metadata` type: specify an array of metadata keys. """ - - class CreateParamsLineItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] + set_discounts: NotRequired[ + List["Quote.CreateParamsLineActionSetDiscount"] + ] """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. + Details for the `set_discounts` type. """ - interval_count: NotRequired[int] + set_items: NotRequired[List["Quote.CreateParamsLineActionSetItem"]] """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + Details for the `set_items` type. + """ + set_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Details for the `set_metadata` type: specify an array of key-value pairs. + """ + type: Literal[ + "add_discount", + "add_item", + "add_metadata", + "clear_discounts", + "clear_metadata", + "remove_discount", + "remove_item", + "remove_metadata", + "set_discounts", + "set_items", + "set_metadata", + ] + """ + The type of action the quote line performs. """ - class CreateParamsSubscriptionData(TypedDict): - description: NotRequired[str] + class CreateParamsLineActionAddDiscount(TypedDict): + coupon: NotRequired[str] """ - The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + The coupon code to redeem. """ - effective_date: NotRequired[ - "Literal['']|Literal['current_period_end']|int" + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "Quote.CreateParamsLineActionAddDiscountDiscountEnd" ] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + Details to determine how long the discount should be applied for. """ - metadata: NotRequired[Dict[str, str]] + index: NotRequired[int] """ - Set of [key-value pairs](https://stripe.com/docs/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. + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. """ - trial_period_days: NotRequired["Literal['']|int"] + promotion_code: NotRequired[str] """ - Integer representing the number of trial period days before the customer is charged for the first time. + The promotion code to redeem. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class CreateParamsLineActionAddDiscountDiscountEnd(TypedDict): + type: Literal["line_ends_at"] """ - The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + The type of calculation made to determine when the discount ends. """ - amount_percent: NotRequired[float] + + class CreateParamsLineActionAddItem(TypedDict): + discounts: NotRequired[ + List["Quote.CreateParamsLineActionAddItemDiscount"] + ] """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. """ - destination: str + metadata: NotRequired[Dict[str, str]] """ - ID of an existing, connected Stripe account. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - - class FinalizeQuoteParams(RequestOptions): - expand: NotRequired[List[str]] + price: str """ - Specifies which fields in the response should be expanded. + The ID of the price object. """ - expires_at: NotRequired[int] + quantity: NotRequired[int] """ - A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired["Quote.CreateParamsLineActionAddItemTrial"] + """ + Options that configure the trial on the subscription item. """ - class ListComputedUpfrontLineItemsParams(RequestOptions): - ending_before: NotRequired[str] + class CreateParamsLineActionAddItemDiscount(TypedDict): + coupon: 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. + ID of the coupon to create a new discount for. """ - expand: NotRequired[List[str]] + discount: NotRequired[str] """ - Specifies which fields in the response should be expanded. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - limit: NotRequired[int] + discount_end: NotRequired[ + "Quote.CreateParamsLineActionAddItemDiscountDiscountEnd" + ] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + Details to determine how long the discount should be applied for. """ - starting_after: NotRequired[str] + promotion_code: 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. + ID of the promotion code to create a new discount for. """ - class ListLineItemsParams(RequestOptions): - ending_before: NotRequired[str] + class CreateParamsLineActionAddItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.CreateParamsLineActionAddItemDiscountDiscountEndDuration" + ] """ - 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. + Time span for the redeemed discount. """ - expand: NotRequired[List[str]] + timestamp: NotRequired[int] """ - Specifies which fields in the response should be expanded. + A precise Unix timestamp for the discount to end. Must be in the future. """ - limit: NotRequired[int] + type: Literal["duration", "timestamp"] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + The type of calculation made to determine when the discount ends. """ - starting_after: NotRequired[str] + + class CreateParamsLineActionAddItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - 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. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - - class ListParams(RequestOptions): - customer: NotRequired[str] + interval_count: int """ - The ID of the customer whose quotes will be retrieved. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - ending_before: NotRequired[str] + + class CreateParamsLineActionAddItemTrial(TypedDict): + converts_to: NotRequired[List[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. + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. """ - expand: NotRequired[List[str]] + type: Literal["free", "paid"] """ - Specifies which fields in the response should be expanded. + Determines the type of trial for this item. """ - limit: NotRequired[int] + + class CreateParamsLineActionRemoveDiscount(TypedDict): + coupon: NotRequired[str] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + The coupon code to remove from the `discounts` array. """ - starting_after: NotRequired[str] + discount: 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. + The ID of a discount to remove from the `discounts` array. """ - status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] + promotion_code: NotRequired[str] """ - The status of the quote. + The ID of a promotion code to remove from the `discounts` array. """ - test_clock: NotRequired[str] + + class CreateParamsLineActionRemoveItem(TypedDict): + price: str """ - Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. + ID of a price to remove. """ - class ModifyParams(RequestOptions): - application_fee_amount: NotRequired["Literal['']|int"] + class CreateParamsLineActionSetDiscount(TypedDict): + coupon: NotRequired[str] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + The coupon code to replace the `discounts` array with. """ - application_fee_percent: NotRequired["Literal['']|float"] + discount: NotRequired[str] """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + An ID of an existing discount to replace the `discounts` array with. """ - automatic_tax: NotRequired["Quote.ModifyParamsAutomaticTax"] + promotion_code: NotRequired[str] """ - Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + An ID of an existing promotion code to replace the `discounts` array with. """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] + + class CreateParamsLineActionSetItem(TypedDict): + discounts: NotRequired[ + List["Quote.CreateParamsLineActionSetItemDiscount"] ] """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. """ - customer: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ - The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. """ - default_tax_rates: NotRequired["Literal['']|List[str]"] + price: str """ - The tax rates that will apply to any line item that does not have `tax_rates` set. + The ID of the price object. """ - description: NotRequired["Literal['']|str"] + quantity: NotRequired[int] """ - A description that will be displayed on the quote PDF. + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. """ - discounts: NotRequired["Literal['']|List[Quote.ModifyParamsDiscount]"] + tax_rates: NotRequired[List[str]] """ - The discounts applied to the quote. + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. """ - expand: NotRequired[List[str]] + trial: NotRequired["Quote.CreateParamsLineActionSetItemTrial"] """ - Specifies which fields in the response should be expanded. + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ - expires_at: NotRequired[int] + + class CreateParamsLineActionSetItemDiscount(TypedDict): + coupon: NotRequired[str] """ - A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + ID of the coupon to create a new discount for. """ - footer: NotRequired["Literal['']|str"] + discount: NotRequired[str] """ - A footer that will be displayed on the quote PDF. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - header: NotRequired["Literal['']|str"] + discount_end: NotRequired[ + "Quote.CreateParamsLineActionSetItemDiscountDiscountEnd" + ] """ - A header that will be displayed on the quote PDF. + Details to determine how long the discount should be applied for. """ - invoice_settings: NotRequired["Quote.ModifyParamsInvoiceSettings"] + promotion_code: NotRequired[str] """ - All invoices will be billed using the specified settings. + ID of the promotion code to create a new discount for. """ - line_items: NotRequired[List["Quote.ModifyParamsLineItem"]] + + class CreateParamsLineActionSetItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.CreateParamsLineActionSetItemDiscountDiscountEndDuration" + ] """ - A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + Time span for the redeemed discount. """ - metadata: NotRequired[Dict[str, str]] + timestamp: NotRequired[int] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + A precise Unix timestamp for the discount to end. Must be in the future. """ - on_behalf_of: NotRequired["Literal['']|str"] + type: Literal["duration", "timestamp"] """ - The account on behalf of which to charge. + The type of calculation made to determine when the discount ends. """ - subscription_data: NotRequired["Quote.ModifyParamsSubscriptionData"] + + class CreateParamsLineActionSetItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - transfer_data: NotRequired[ - "Literal['']|Quote.ModifyParamsTransferData" - ] + interval_count: int """ - The data with which to automatically create a Transfer for each of the invoices. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - class ModifyParamsAutomaticTax(TypedDict): - enabled: bool + class CreateParamsLineActionSetItemTrial(TypedDict): + converts_to: NotRequired[List[str]] """ - Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. """ - liability: NotRequired["Quote.ModifyParamsAutomaticTaxLiability"] + type: Literal["free", "paid"] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + Determines the type of trial for this item. """ - class ModifyParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] + class CreateParamsLineAppliesTo(TypedDict): + new_reference: NotRequired[str] """ - The connected account being referenced when `type` is `account`. + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. """ - type: Literal["account", "self"] + subscription_schedule: NotRequired[str] """ - Type of the account referenced in the request. + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. """ - class ModifyParamsDiscount(TypedDict): - coupon: NotRequired[str] + class CreateParamsLineCancelSubscriptionSchedule(TypedDict): + cancel_at: Literal["line_starts_at"] """ - ID of the coupon to create a new discount for. + Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. """ - discount: NotRequired[str] + invoice_now: NotRequired[bool] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. """ - promotion_code: NotRequired[str] + prorate: NotRequired[bool] """ - ID of the promotion code to create a new discount for. + If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. """ - class ModifyParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired[int] + class CreateParamsLineEndsAt(TypedDict): + discount_end: NotRequired["Quote.CreateParamsLineEndsAtDiscountEnd"] """ - Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + Use the `end` time of a given discount. """ - issuer: NotRequired["Quote.ModifyParamsInvoiceSettingsIssuer"] + duration: NotRequired["Quote.CreateParamsLineEndsAtDuration"] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Time span for the quote line starting from the `starts_at` date. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "billing_period_end", + "discount_end", + "duration", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `ends_at`. """ - class ModifyParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired[str] + class CreateParamsLineEndsAtDiscountEnd(TypedDict): + discount: str """ - The connected account being referenced when `type` is `account`. + The ID of a specific discount. """ - type: Literal["account", "self"] + + class CreateParamsLineEndsAtDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - Type of the account referenced in the request. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - class ModifyParamsLineItem(TypedDict): + class CreateParamsLineItem(TypedDict): discounts: NotRequired[ - "Literal['']|List[Quote.ModifyParamsLineItemDiscount]" + "Literal['']|List[Quote.CreateParamsLineItemDiscount]" ] """ The discounts applied to this line item. """ - id: NotRequired[str] - """ - The ID of an existing line item on the quote. - """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ - price_data: NotRequired["Quote.ModifyParamsLineItemPriceData"] + price_data: NotRequired["Quote.CreateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ @@ -933,7 +1540,7 @@ class ModifyParamsLineItem(TypedDict): The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ - class ModifyParamsLineItemDiscount(TypedDict): + class CreateParamsLineItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -942,12 +1549,44 @@ class ModifyParamsLineItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Quote.CreateParamsLineItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ - class ModifyParamsLineItemPriceData(TypedDict): + class CreateParamsLineItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.CreateParamsLineItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsLineItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsLineItemPriceData(TypedDict): currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -956,7 +1595,7 @@ class ModifyParamsLineItemPriceData(TypedDict): """ The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. """ - recurring: NotRequired["Quote.ModifyParamsLineItemPriceDataRecurring"] + recurring: NotRequired["Quote.CreateParamsLineItemPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. """ @@ -975,7 +1614,7 @@ class ModifyParamsLineItemPriceData(TypedDict): Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ - class ModifyParamsLineItemPriceDataRecurring(TypedDict): + class CreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. @@ -985,218 +1624,2424 @@ class ModifyParamsLineItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ - class ModifyParamsSubscriptionData(TypedDict): - description: NotRequired["Literal['']|str"] - """ - The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - effective_date: NotRequired[ - "Literal['']|Literal['current_period_end']|int" - ] + class CreateParamsLineSetPauseCollection(TypedDict): + set: NotRequired["Quote.CreateParamsLineSetPauseCollectionSet"] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + Details of the pause_collection behavior to apply to the amendment. """ - metadata: NotRequired[Dict[str, str]] + type: Literal["remove", "set"] """ - Set of [key-value pairs](https://stripe.com/docs/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. + Determines the type of the pause_collection amendment. """ - trial_period_days: NotRequired["Literal['']|int"] + + class CreateParamsLineSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - Integer representing the number of trial period days before the customer is charged for the first time. + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ - class ModifyParamsTransferData(TypedDict): - amount: NotRequired[int] + class CreateParamsLineStartsAt(TypedDict): + discount_end: NotRequired["Quote.CreateParamsLineStartsAtDiscountEnd"] """ - The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + Use the `end` time of a given discount. """ - amount_percent: NotRequired[float] + line_ends_at: NotRequired["Quote.CreateParamsLineStartsAtLineEndsAt"] """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + The timestamp the given line ends at. """ - destination: str + timestamp: NotRequired[int] """ - ID of an existing, connected Stripe account. + A precise Unix timestamp. """ + type: Literal[ + "discount_end", + "line_ends_at", + "now", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `starts_at`. + """ + + class CreateParamsLineStartsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class CreateParamsLineStartsAtLineEndsAt(TypedDict): + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsLineTrialSettings(TypedDict): + end_behavior: NotRequired[ + "Quote.CreateParamsLineTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreateParamsLineTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreateParamsSubscriptionData(TypedDict): + bill_on_acceptance: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_cycle_anchor: NotRequired["Literal['']|Literal['reset']"] + """ + When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + description: NotRequired[str] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + effective_date: NotRequired[ + "Literal['']|Literal['current_period_end']|int" + ] + """ + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + from_subscription: NotRequired[str] + """ + The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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. + """ + prebilling: NotRequired[ + "Literal['']|Quote.CreateParamsSubscriptionDataPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillFrom(TypedDict): + line_starts_at: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntil(TypedDict): + duration: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataOverride(TypedDict): + applies_to: "Quote.CreateParamsSubscriptionDataOverrideAppliesTo" + """ + Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule. + """ + bill_on_acceptance: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + customer: NotRequired[str] + """ + The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`. + """ + description: NotRequired[str] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + + class CreateParamsSubscriptionDataOverrideAppliesTo(TypedDict): + new_reference: NotRequired[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: NotRequired[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom( + TypedDict, + ): + line_starts_at: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil( + TypedDict, + ): + duration: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "Quote.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class FinalizeQuoteParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + """ + + class ListComputedUpfrontLineItemsParams(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. + """ + + class ListLineItemsParams(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. + """ + + class ListLinesParams(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. + """ + + class ListParams(RequestOptions): + customer: NotRequired[str] + """ + The ID of the customer whose quotes will be retrieved. + """ + customer_account: NotRequired[str] + """ + The ID of the account whose quotes will be retrieved. + """ + 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. + """ + from_subscription: NotRequired[str] + """ + The subscription which the quote updates. + """ + 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. + """ + status: NotRequired[ + Literal[ + "accepted", "accepting", "canceled", "draft", "open", "stale" + ] + ] + """ + The status of the quote. + """ + test_clock: NotRequired[str] + """ + Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. + """ + + class ListPreviewInvoiceLinesParams(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. + """ + + class ListPreviewInvoicesParams(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. + """ + + class ListPreviewSubscriptionSchedulesParams(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. + """ + + class MarkDraftParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MarkStaleParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + reason: NotRequired[str] + """ + Reason the Quote is being marked stale. + """ + + class ModifyParams(RequestOptions): + allow_backdated_lines: NotRequired[bool] + """ + Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + """ + application_fee_percent: NotRequired["Literal['']|float"] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + """ + automatic_tax: NotRequired["Quote.ModifyParamsAutomaticTax"] + """ + Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + """ + customer: NotRequired[str] + """ + The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + """ + customer_account: NotRequired[str] + """ + The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that will apply to any line item that does not have `tax_rates` set. + """ + description: NotRequired["Literal['']|str"] + """ + A description that will be displayed on the quote PDF. + """ + discounts: NotRequired["Literal['']|List[Quote.ModifyParamsDiscount]"] + """ + The discounts applied to the quote. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + """ + footer: NotRequired["Literal['']|str"] + """ + A footer that will be displayed on the quote PDF. + """ + header: NotRequired["Literal['']|str"] + """ + A header that will be displayed on the quote PDF. + """ + invoice_settings: NotRequired["Quote.ModifyParamsInvoiceSettings"] + """ + All invoices will be billed using the specified settings. + """ + line_items: NotRequired[List["Quote.ModifyParamsLineItem"]] + """ + A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + """ + lines: NotRequired[List["Quote.ModifyParamsLine"]] + """ + A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account on behalf of which to charge. + """ + subscription_data: NotRequired["Quote.ModifyParamsSubscriptionData"] + """ + When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + """ + subscription_data_overrides: NotRequired[ + "Literal['']|List[Quote.ModifyParamsSubscriptionDataOverride]" + ] + """ + List representing overrides for `subscription_data` configurations for specific subscription schedules. + """ + transfer_data: NotRequired[ + "Literal['']|Quote.ModifyParamsTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the invoices. + """ + + class ModifyParamsAutomaticTax(TypedDict): + enabled: bool + """ + Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + """ + liability: NotRequired["Quote.ModifyParamsAutomaticTaxLiability"] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class ModifyParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ModifyParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired["Quote.ModifyParamsDiscountDiscountEnd"] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired["Quote.ModifyParamsDiscountDiscountEndDuration"] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsInvoiceSettings(TypedDict): + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + """ + issuer: NotRequired["Quote.ModifyParamsInvoiceSettingsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + + class ModifyParamsInvoiceSettingsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class ModifyParamsLine(TypedDict): + actions: NotRequired[List["Quote.ModifyParamsLineAction"]] + """ + An array of operations the quote line performs. + """ + applies_to: NotRequired["Quote.ModifyParamsLineAppliesTo"] + """ + Details to identify the subscription schedule the quote line applies to. + """ + billing_cycle_anchor: NotRequired[ + Literal["automatic", "line_starts_at"] + ] + """ + For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + """ + cancel_subscription_schedule: NotRequired[ + "Quote.ModifyParamsLineCancelSubscriptionSchedule" + ] + """ + A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + """ + ends_at: NotRequired["Quote.ModifyParamsLineEndsAt"] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + """ + id: NotRequired[str] + """ + The ID of an existing line on the quote. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + """ + set_pause_collection: NotRequired[ + "Quote.ModifyParamsLineSetPauseCollection" + ] + """ + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. + """ + set_schedule_end: NotRequired[ + Literal["line_ends_at", "line_starts_at"] + ] + """ + Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + """ + starts_at: NotRequired["Quote.ModifyParamsLineStartsAt"] + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + trial_settings: NotRequired["Quote.ModifyParamsLineTrialSettings"] + """ + Settings related to subscription trials. + """ + + class ModifyParamsLineAction(TypedDict): + add_discount: NotRequired["Quote.ModifyParamsLineActionAddDiscount"] + """ + Details for the `add_discount` type. + """ + add_item: NotRequired["Quote.ModifyParamsLineActionAddItem"] + """ + Details for the `add_item` type. + """ + add_metadata: NotRequired[Dict[str, str]] + """ + Details for the `add_metadata` type: specify a hash of key-value pairs. + """ + remove_discount: NotRequired[ + "Quote.ModifyParamsLineActionRemoveDiscount" + ] + """ + Details for the `remove_discount` type. + """ + remove_item: NotRequired["Quote.ModifyParamsLineActionRemoveItem"] + """ + Details for the `remove_item` type. + """ + remove_metadata: NotRequired[List[str]] + """ + Details for the `remove_metadata` type: specify an array of metadata keys. + """ + set_discounts: NotRequired[ + List["Quote.ModifyParamsLineActionSetDiscount"] + ] + """ + Details for the `set_discounts` type. + """ + set_items: NotRequired[List["Quote.ModifyParamsLineActionSetItem"]] + """ + Details for the `set_items` type. + """ + set_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Details for the `set_metadata` type: specify an array of key-value pairs. + """ + type: Literal[ + "add_discount", + "add_item", + "add_metadata", + "clear_discounts", + "clear_metadata", + "remove_discount", + "remove_item", + "remove_metadata", + "set_discounts", + "set_items", + "set_metadata", + ] + """ + The type of action the quote line performs. + """ + + class ModifyParamsLineActionAddDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "Quote.ModifyParamsLineActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class ModifyParamsLineActionAddDiscountDiscountEnd(TypedDict): + type: Literal["line_ends_at"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsLineActionAddItem(TypedDict): + discounts: NotRequired[ + List["Quote.ModifyParamsLineActionAddItemDiscount"] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired["Quote.ModifyParamsLineActionAddItemTrial"] + """ + Options that configure the trial on the subscription item. + """ + + class ModifyParamsLineActionAddItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "Quote.ModifyParamsLineActionAddItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsLineActionAddItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.ModifyParamsLineActionAddItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsLineActionAddItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsLineActionAddItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class ModifyParamsLineActionRemoveDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class ModifyParamsLineActionRemoveItem(TypedDict): + price: str + """ + ID of a price to remove. + """ + + class ModifyParamsLineActionSetDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class ModifyParamsLineActionSetItem(TypedDict): + discounts: NotRequired[ + List["Quote.ModifyParamsLineActionSetItemDiscount"] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired["Quote.ModifyParamsLineActionSetItemTrial"] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class ModifyParamsLineActionSetItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "Quote.ModifyParamsLineActionSetItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsLineActionSetItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.ModifyParamsLineActionSetItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsLineActionSetItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsLineActionSetItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class ModifyParamsLineAppliesTo(TypedDict): + new_reference: NotRequired[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: NotRequired[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class ModifyParamsLineCancelSubscriptionSchedule(TypedDict): + cancel_at: Literal["line_starts_at"] + """ + Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + """ + invoice_now: NotRequired[bool] + """ + If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + """ + prorate: NotRequired[bool] + """ + If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + """ + + class ModifyParamsLineEndsAt(TypedDict): + discount_end: NotRequired["Quote.ModifyParamsLineEndsAtDiscountEnd"] + """ + Use the `end` time of a given discount. + """ + duration: NotRequired["Quote.ModifyParamsLineEndsAtDuration"] + """ + Time span for the quote line starting from the `starts_at` date. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "billing_period_end", + "discount_end", + "duration", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `ends_at`. + """ + + class ModifyParamsLineEndsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class ModifyParamsLineEndsAtDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[Quote.ModifyParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + id: NotRequired[str] + """ + The ID of an existing line item on the quote. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["Quote.ModifyParamsLineItemPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + """ + + class ModifyParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "Quote.ModifyParamsLineItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class ModifyParamsLineItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Quote.ModifyParamsLineItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsLineItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsLineItemPriceData(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: str + """ + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + """ + recurring: NotRequired["Quote.ModifyParamsLineItemPriceDataRecurring"] + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ModifyParamsLineItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class ModifyParamsLineSetPauseCollection(TypedDict): + set: NotRequired["Quote.ModifyParamsLineSetPauseCollectionSet"] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class ModifyParamsLineSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class ModifyParamsLineStartsAt(TypedDict): + discount_end: NotRequired["Quote.ModifyParamsLineStartsAtDiscountEnd"] + """ + Use the `end` time of a given discount. + """ + line_ends_at: NotRequired["Quote.ModifyParamsLineStartsAtLineEndsAt"] + """ + The timestamp the given line ends at. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "discount_end", + "line_ends_at", + "now", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `starts_at`. + """ + + class ModifyParamsLineStartsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class ModifyParamsLineStartsAtLineEndsAt(TypedDict): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class ModifyParamsLineTrialSettings(TypedDict): + end_behavior: NotRequired[ + "Quote.ModifyParamsLineTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class ModifyParamsLineTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class ModifyParamsSubscriptionData(TypedDict): + bill_on_acceptance: NotRequired[ + "Literal['']|Quote.ModifyParamsSubscriptionDataBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_cycle_anchor: NotRequired["Literal['']|Literal['reset']"] + """ + When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. + """ + description: NotRequired["Literal['']|str"] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + effective_date: NotRequired[ + "Literal['']|Literal['current_period_end']|int" + ] + """ + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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. + """ + prebilling: NotRequired[ + "Literal['']|Quote.ModifyParamsSubscriptionDataPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "Quote.ModifyParamsSubscriptionDataBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "Quote.ModifyParamsSubscriptionDataBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptanceBillFrom(TypedDict): + line_starts_at: NotRequired[ + "Quote.ModifyParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptanceBillUntil(TypedDict): + duration: NotRequired[ + "Quote.ModifyParamsSubscriptionDataBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "Quote.ModifyParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class ModifyParamsSubscriptionDataOverride(TypedDict): + applies_to: "Quote.ModifyParamsSubscriptionDataOverrideAppliesTo" + """ + Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule. + """ + bill_on_acceptance: NotRequired[ + "Literal['']|Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + customer: NotRequired[str] + """ + The customer the Subscription Data override applies to. + """ + description: NotRequired["Literal['']|str"] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + + class ModifyParamsSubscriptionDataOverrideAppliesTo(TypedDict): + new_reference: NotRequired[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: NotRequired[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom( + TypedDict, + ): + line_starts_at: NotRequired[ + "Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil( + TypedDict, + ): + duration: NotRequired[ + "Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "Quote.ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class ModifyParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class ModifyParamsSubscriptionDataPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + + class ModifyParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class PdfParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ReestimateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + allow_backdated_lines: Optional[bool] + """ + Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + """ + amount_subtotal: int + """ + Total before any discounts or taxes are applied. + """ + amount_total: int + """ + Total after discounts and taxes are applied. + """ + application: Optional[ExpandableField["Application"]] + """ + ID of the Connect Application that created the quote. + """ + application_fee_amount: Optional[int] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. + """ + application_fee_percent: Optional[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. + """ + automatic_tax: AutomaticTax + collection_method: Literal["charge_automatically", "send_invoice"] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + """ + computed: Computed + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: Optional[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + customer: Optional[ExpandableField["Customer"]] + """ + The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + """ + customer_account: Optional[str] + """ + The account which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed. + """ + default_tax_rates: Optional[List[ExpandableField["TaxRate"]]] + """ + The tax rates applied to this quote. + """ + description: Optional[str] + """ + A description that will be displayed on the quote PDF. + """ + discounts: List[ExpandableField["DiscountResource"]] + """ + The discounts applied to this quote. + """ + expires_at: int + """ + The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + """ + footer: Optional[str] + """ + A footer that will be displayed on the quote PDF. + """ + from_quote: Optional[FromQuote] + """ + Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. + """ + header: Optional[str] + """ + A header that will be displayed on the quote PDF. + """ + id: str + """ + Unique identifier for the object. + """ + invoice: Optional[ExpandableField["Invoice"]] + """ + The invoice that was created from this quote. + """ + invoice_settings: InvoiceSettings + line_items: Optional[ListObject["LineItem"]] + """ + A list of items the customer is being quoted for. + """ + lines: Optional[List[str]] + """ + A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + number: Optional[str] + """ + A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). + """ + object: Literal["quote"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + on_behalf_of: Optional[ExpandableField["Account"]] + """ + The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + """ + status: Literal[ + "accepted", "accepting", "canceled", "draft", "open", "stale" + ] + """ + The status of the quote. + """ + status_details: Optional[StatusDetails] + """ + Details on when and why a quote has been marked as stale or canceled. + """ + status_transitions: StatusTransitions + subscription: Optional[ExpandableField["Subscription"]] + """ + The subscription that was created or updated from this quote. + """ + subscription_data: SubscriptionData + subscription_data_overrides: Optional[List[SubscriptionDataOverride]] + """ + List representing overrides for `subscription_data` configurations for specific subscription schedules. + """ + subscription_schedule: Optional[ + ExpandableField["SubscriptionScheduleResource"] + ] + """ + The subscription schedule that was created or updated from this quote. + """ + subscription_schedules: Optional[List[SubscriptionSchedule]] + """ + The subscription schedules that were created or updated from this quote. + """ + test_clock: Optional[ExpandableField["TestClock"]] + """ + ID of the test clock this quote belongs to. + """ + total_details: TotalDetails + transfer_data: Optional[TransferData] + """ + The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + """ + + @classmethod + def _cls_accept( + cls, quote: str, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + cls._static_request( + "post", + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + def accept(quote: str, **params: Unpack["Quote.AcceptParams"]) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @overload + def accept(self, **params: Unpack["Quote.AcceptParams"]) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @class_method_variant("_cls_accept") + def accept( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + self._request( + "post", + "/v1/quotes/{quote}/accept".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_accept_async( + cls, quote: str, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def accept_async( + quote: str, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @overload + async def accept_async( + self, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + ... + + @class_method_variant("_cls_accept_async") + async def accept_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.AcceptParams"] + ) -> "Quote": + """ + Accepts the specified quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/accept".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_cancel( + cls, quote: str, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + cls._static_request( + "post", + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + def cancel(quote: str, **params: Unpack["Quote.CancelParams"]) -> "Quote": + """ + Cancels the quote. + """ + ... + + @overload + def cancel(self, **params: Unpack["Quote.CancelParams"]) -> "Quote": + """ + Cancels the quote. + """ + ... + + @class_method_variant("_cls_cancel") + def cancel( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + self._request( + "post", + "/v1/quotes/{quote}/cancel".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_cancel_async( + cls, quote: str, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + quote: str, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.CancelParams"] + ) -> "Quote": + """ + Cancels the quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/cancel".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": + """ + A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + """ + return cast( + "Quote", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["Quote.CreateParams"] + ) -> "Quote": + """ + A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_finalize_quote( + cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + cls._static_request( + "post", + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + def finalize_quote( + quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @overload + def finalize_quote( + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @class_method_variant("_cls_finalize_quote") + def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + self._request( + "post", + "/v1/quotes/{quote}/finalize".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_finalize_quote_async( + cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + params=params, + ), + ) + + @overload + @staticmethod + async def finalize_quote_async( + quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @overload + async def finalize_quote_async( + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + ... + + @class_method_variant("_cls_finalize_quote_async") + async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.FinalizeQuoteParams"] + ) -> "Quote": + """ + Finalizes the quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/finalize".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: + """ + Returns a list of your quotes. + """ + 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["Quote.ListParams"] + ) -> ListObject["Quote"]: + """ + Returns a list of your quotes. + """ + 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__) + ) - class PdfParams(RequestOptions): - expand: NotRequired[List[str]] + return result + + @classmethod + def _cls_list_computed_upfront_line_items( + cls, + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], + ) -> ListObject["LineItem"]: """ - Specifies which fields in the response should be expanded. + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ + return cast( + ListObject["LineItem"], + cls._static_request( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) - class RetrieveParams(RequestOptions): - expand: NotRequired[List[str]] + @overload + @staticmethod + def list_computed_upfront_line_items( + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], + ) -> ListObject["LineItem"]: """ - Specifies which fields in the response should be expanded. + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ + ... - amount_subtotal: int - """ - Total before any discounts or taxes are applied. - """ - amount_total: int - """ - Total after discounts and taxes are applied. - """ - application: Optional[ExpandableField["Application"]] - """ - ID of the Connect Application that created the quote. - """ - application_fee_amount: Optional[int] - """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. - """ - application_fee_percent: Optional[float] - """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. - """ - automatic_tax: AutomaticTax - collection_method: Literal["charge_automatically", "send_invoice"] - """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - """ - computed: Computed - created: int - """ - Time at which the object was created. Measured in seconds since the Unix epoch. - """ - currency: Optional[str] - """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - """ - customer: Optional[ExpandableField["Customer"]] - """ - The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - """ - default_tax_rates: Optional[List[ExpandableField["TaxRate"]]] - """ - The tax rates applied to this quote. - """ - description: Optional[str] - """ - A description that will be displayed on the quote PDF. - """ - discounts: List[ExpandableField["DiscountResource"]] - """ - The discounts applied to this quote. - """ - expires_at: int - """ - The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. - """ - footer: Optional[str] - """ - A footer that will be displayed on the quote PDF. - """ - from_quote: Optional[FromQuote] - """ - Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. - """ - header: Optional[str] - """ - A header that will be displayed on the quote PDF. - """ - id: str - """ - Unique identifier for the object. - """ - invoice: Optional[ExpandableField["Invoice"]] - """ - The invoice that was created from this quote. - """ - invoice_settings: InvoiceSettings - line_items: Optional[ListObject["LineItem"]] - """ - A list of items the customer is being quoted for. - """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - metadata: Dict[str, str] - """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - """ - number: Optional[str] - """ - A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). - """ - object: Literal["quote"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - on_behalf_of: Optional[ExpandableField["Account"]] - """ - The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - """ - status: Literal["accepted", "canceled", "draft", "open"] - """ - The status of the quote. - """ - status_transitions: StatusTransitions - subscription: Optional[ExpandableField["Subscription"]] - """ - The subscription that was created or updated from this quote. - """ - subscription_data: SubscriptionData - subscription_schedule: Optional[ExpandableField["SubscriptionSchedule"]] - """ - The subscription schedule that was created or updated from this quote. - """ - test_clock: Optional[ExpandableField["TestClock"]] - """ - ID of the test clock this quote belongs to. - """ - total_details: TotalDetails - transfer_data: Optional[TransferData] - """ - The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. - """ + @overload + def list_computed_upfront_line_items( + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + ... + + @class_method_variant("_cls_list_computed_upfront_line_items") + def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + return cast( + ListObject["LineItem"], + self._request( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) @classmethod - def _cls_accept( - cls, quote: str, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + async def _cls_list_computed_upfront_line_items_async( + cls, + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( - "Quote", + ListObject["LineItem"], + await cls._static_request_async( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def list_computed_upfront_line_items_async( + quote: str, + **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + ... + + @overload + async def list_computed_upfront_line_items_async( + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + ... + + @class_method_variant("_cls_list_computed_upfront_line_items_async") + async def list_computed_upfront_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + """ + return cast( + ListObject["LineItem"], + await self._request_async( + "get", + "/v1/quotes/{quote}/computed_upfront_line_items".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_list_line_items( + cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: + """ + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + """ + return cast( + ListObject["LineItem"], cls._static_request( - "post", - "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/line_items".format( + quote=sanitize_id(quote) + ), params=params, ), ) @overload @staticmethod - def accept(quote: str, **params: Unpack["Quote.AcceptParams"]) -> "Quote": + def list_line_items( + quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload - def accept(self, **params: Unpack["Quote.AcceptParams"]) -> "Quote": + def list_line_items( + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... - @class_method_variant("_cls_accept") - def accept( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + @class_method_variant("_cls_list_line_items") + def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( - "Quote", + ListObject["LineItem"], self._request( - "post", - "/v1/quotes/{quote}/accept".format( + "get", + "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1204,52 +4049,54 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - async def _cls_accept_async( - cls, quote: str, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + async def _cls_list_line_items_async( + cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( - "Quote", + ListObject["LineItem"], await cls._static_request_async( - "post", - "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/line_items".format( + quote=sanitize_id(quote) + ), params=params, ), ) @overload @staticmethod - async def accept_async( - quote: str, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + async def list_line_items_async( + quote: str, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload - async def accept_async( - self, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + async def list_line_items_async( + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... - @class_method_variant("_cls_accept_async") - async def accept_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + @class_method_variant("_cls_list_line_items_async") + async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListLineItemsParams"] + ) -> ListObject["LineItem"]: """ - Accepts the specified quote. + When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( - "Quote", + ListObject["LineItem"], await self._request_async( - "post", - "/v1/quotes/{quote}/accept".format( + "get", + "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1257,48 +4104,52 @@ async def accept_async( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - def _cls_cancel( - cls, quote: str, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + def _cls_list_lines( + cls, quote: str, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ return cast( - "Quote", + ListObject["QuoteLine"], cls._static_request( - "post", - "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/lines".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod - def cancel(quote: str, **params: Unpack["Quote.CancelParams"]) -> "Quote": + def list_lines( + quote: str, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ ... @overload - def cancel(self, **params: Unpack["Quote.CancelParams"]) -> "Quote": + def list_lines( + self, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ ... - @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + @class_method_variant("_cls_list_lines") + def list_lines( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ return cast( - "Quote", + ListObject["QuoteLine"], self._request( - "post", - "/v1/quotes/{quote}/cancel".format( + "get", + "/v1/quotes/{quote}/lines".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1306,52 +4157,52 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - async def _cls_cancel_async( - cls, quote: str, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + async def _cls_list_lines_async( + cls, quote: str, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ return cast( - "Quote", + ListObject["QuoteLine"], await cls._static_request_async( - "post", - "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/lines".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod - async def cancel_async( - quote: str, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + async def list_lines_async( + quote: str, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ ... @overload - async def cancel_async( - self, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + async def list_lines_async( + self, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ ... - @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + @class_method_variant("_cls_list_lines_async") + async def list_lines_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ListLinesParams"] + ) -> ListObject["QuoteLine"]: """ - Cancels the quote. + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. """ return cast( - "Quote", + ListObject["QuoteLine"], await self._request_async( - "post", - "/v1/quotes/{quote}/cancel".format( + "get", + "/v1/quotes/{quote}/lines".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1359,193 +4210,149 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": - """ - A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). - """ - return cast( - "Quote", - cls._static_request( - "post", - cls.class_url(), - params=params, - ), - ) - - @classmethod - async def create_async( - cls, **params: Unpack["Quote.CreateParams"] - ) -> "Quote": - """ - A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). - """ - return cast( - "Quote", - await cls._static_request_async( - "post", - cls.class_url(), - params=params, - ), - ) - - @classmethod - def _cls_finalize_quote( - cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + def _cls_list_preview_invoice_lines( + cls, + quote: str, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ return cast( - "Quote", + ListObject["InvoiceLineItem"], cls._static_request( - "post", - "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(quote), + preview_invoice=sanitize_id(preview_invoice), + ), params=params, ), ) @overload @staticmethod - def finalize_quote( - quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + def list_preview_invoice_lines( + quote: str, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ ... @overload - def finalize_quote( - self, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + def list_preview_invoice_lines( + self, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ ... - @class_method_variant("_cls_finalize_quote") - def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + @class_method_variant("_cls_list_preview_invoice_lines") + def list_preview_invoice_lines( # pyright: ignore[reportGeneralTypeIssues] + self, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ return cast( - "Quote", + ListObject["InvoiceLineItem"], self._request( - "post", - "/v1/quotes/{quote}/finalize".format( - quote=sanitize_id(self.get("id")) + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(self.get("id")), + preview_invoice=sanitize_id(preview_invoice), ), params=params, ), ) @classmethod - async def _cls_finalize_quote_async( - cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + async def _cls_list_preview_invoice_lines_async( + cls, + quote: str, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ return cast( - "Quote", + ListObject["InvoiceLineItem"], await cls._static_request_async( - "post", - "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(quote), + preview_invoice=sanitize_id(preview_invoice), + ), params=params, ), ) @overload @staticmethod - async def finalize_quote_async( - quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + async def list_preview_invoice_lines_async( + quote: str, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ ... @overload - async def finalize_quote_async( - self, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + async def list_preview_invoice_lines_async( + self, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ ... - @class_method_variant("_cls_finalize_quote_async") - async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.FinalizeQuoteParams"] - ) -> "Quote": + @class_method_variant("_cls_list_preview_invoice_lines_async") + async def list_preview_invoice_lines_async( # pyright: ignore[reportGeneralTypeIssues] + self, + preview_invoice: str, + **params: Unpack["Quote.ListPreviewInvoiceLinesParams"], + ) -> ListObject["InvoiceLineItem"]: """ - Finalizes the quote. + Preview the invoice line items that would be generated by accepting the quote. """ return cast( - "Quote", + ListObject["InvoiceLineItem"], await self._request_async( - "post", - "/v1/quotes/{quote}/finalize".format( - quote=sanitize_id(self.get("id")) + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(self.get("id")), + preview_invoice=sanitize_id(preview_invoice), ), params=params, ), ) - @classmethod - def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: - """ - Returns a list of your quotes. - """ - 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["Quote.ListParams"] - ) -> ListObject["Quote"]: - """ - Returns a list of your quotes. - """ - 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 _cls_list_computed_upfront_line_items( - cls, - quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], - ) -> ListObject["LineItem"]: + @classmethod + def _cls_mark_draft( + cls, quote: str, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ return cast( - ListObject["LineItem"], + "Quote", cls._static_request( - "get", - "/v1/quotes/{quote}/computed_upfront_line_items".format( + "post", + "/v1/quotes/{quote}/mark_draft".format( quote=sanitize_id(quote) ), params=params, @@ -1554,36 +4361,33 @@ def _cls_list_computed_upfront_line_items( @overload @staticmethod - def list_computed_upfront_line_items( - quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], - ) -> ListObject["LineItem"]: + def mark_draft( + quote: str, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ ... @overload - def list_computed_upfront_line_items( - self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] - ) -> ListObject["LineItem"]: + def mark_draft(self, **params: Unpack["Quote.MarkDraftParams"]) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ ... - @class_method_variant("_cls_list_computed_upfront_line_items") - def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] - ) -> ListObject["LineItem"]: + @class_method_variant("_cls_mark_draft") + def mark_draft( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ return cast( - ListObject["LineItem"], + "Quote", self._request( - "get", - "/v1/quotes/{quote}/computed_upfront_line_items".format( + "post", + "/v1/quotes/{quote}/mark_draft".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1591,19 +4395,17 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues ) @classmethod - async def _cls_list_computed_upfront_line_items_async( - cls, - quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], - ) -> ListObject["LineItem"]: + async def _cls_mark_draft_async( + cls, quote: str, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ return cast( - ListObject["LineItem"], + "Quote", await cls._static_request_async( - "get", - "/v1/quotes/{quote}/computed_upfront_line_items".format( + "post", + "/v1/quotes/{quote}/mark_draft".format( quote=sanitize_id(quote) ), params=params, @@ -1612,36 +4414,35 @@ async def _cls_list_computed_upfront_line_items_async( @overload @staticmethod - async def list_computed_upfront_line_items_async( - quote: str, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], - ) -> ListObject["LineItem"]: + async def mark_draft_async( + quote: str, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ ... @overload - async def list_computed_upfront_line_items_async( - self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] - ) -> ListObject["LineItem"]: + async def mark_draft_async( + self, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ ... - @class_method_variant("_cls_list_computed_upfront_line_items_async") - async def list_computed_upfront_line_items_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] - ) -> ListObject["LineItem"]: + @class_method_variant("_cls_mark_draft_async") + async def mark_draft_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.MarkDraftParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + Converts a stale quote to draft. """ return cast( - ListObject["LineItem"], + "Quote", await self._request_async( - "get", - "/v1/quotes/{quote}/computed_upfront_line_items".format( + "post", + "/v1/quotes/{quote}/mark_draft".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1649,17 +4450,17 @@ async def list_computed_upfront_line_items_async( # pyright: ignore[reportGener ) @classmethod - def _cls_list_line_items( - cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + def _cls_mark_stale( + cls, quote: str, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ return cast( - ListObject["LineItem"], + "Quote", cls._static_request( - "get", - "/v1/quotes/{quote}/line_items".format( + "post", + "/v1/quotes/{quote}/mark_stale".format( quote=sanitize_id(quote) ), params=params, @@ -1668,35 +4469,33 @@ def _cls_list_line_items( @overload @staticmethod - def list_line_items( - quote: str, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + def mark_stale( + quote: str, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ ... @overload - def list_line_items( - self, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + def mark_stale(self, **params: Unpack["Quote.MarkStaleParams"]) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ ... - @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + @class_method_variant("_cls_mark_stale") + def mark_stale( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ return cast( - ListObject["LineItem"], + "Quote", self._request( - "get", - "/v1/quotes/{quote}/line_items".format( + "post", + "/v1/quotes/{quote}/mark_stale".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1704,17 +4503,17 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - async def _cls_list_line_items_async( - cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + async def _cls_mark_stale_async( + cls, quote: str, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ return cast( - ListObject["LineItem"], + "Quote", await cls._static_request_async( - "get", - "/v1/quotes/{quote}/line_items".format( + "post", + "/v1/quotes/{quote}/mark_stale".format( quote=sanitize_id(quote) ), params=params, @@ -1723,35 +4522,35 @@ async def _cls_list_line_items_async( @overload @staticmethod - async def list_line_items_async( - quote: str, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + async def mark_stale_async( + quote: str, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ ... @overload - async def list_line_items_async( - self, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + async def mark_stale_async( + self, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ ... - @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["Quote.ListLineItemsParams"] - ) -> ListObject["LineItem"]: + @class_method_variant("_cls_mark_stale_async") + async def mark_stale_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.MarkStaleParams"] + ) -> "Quote": """ - When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + Converts a draft or open quote to stale. """ return cast( - ListObject["LineItem"], + "Quote", await self._request_async( - "get", - "/v1/quotes/{quote}/line_items".format( + "post", + "/v1/quotes/{quote}/mark_stale".format( quote=sanitize_id(self.get("id")) ), params=params, @@ -1894,6 +4693,116 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_reestimate( + cls, quote: str, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + "Quote", + cls._static_request( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @overload + @staticmethod + def reestimate( + quote: str, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + ... + + @overload + def reestimate( + self, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + ... + + @class_method_variant("_cls_reestimate") + def reestimate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + "Quote", + self._request( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_reestimate_async( + cls, quote: str, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + "Quote", + await cls._static_request_async( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def reestimate_async( + quote: str, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + ... + + @overload + async def reestimate_async( + self, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + ... + + @class_method_variant("_cls_reestimate_async") + async def reestimate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Quote.ReestimateParams"] + ) -> "Quote": + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + "Quote", + await self._request_async( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["Quote.RetrieveParams"] @@ -1916,13 +4825,92 @@ async def retrieve_async( await instance.refresh_async() return instance + @classmethod + def list_preview_invoices( + cls, quote: str, **params: Unpack["Quote.ListPreviewInvoicesParams"] + ) -> ListObject["QuotePreviewInvoice"]: + """ + Preview the invoices that would be generated by accepting the quote. + """ + return cast( + ListObject["QuotePreviewInvoice"], + cls._static_request( + "get", + "/v1/quotes/{quote}/preview_invoices".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @classmethod + async def list_preview_invoices_async( + cls, quote: str, **params: Unpack["Quote.ListPreviewInvoicesParams"] + ) -> ListObject["QuotePreviewInvoice"]: + """ + Preview the invoices that would be generated by accepting the quote. + """ + return cast( + ListObject["QuotePreviewInvoice"], + await cls._static_request_async( + "get", + "/v1/quotes/{quote}/preview_invoices".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @classmethod + def list_preview_subscription_schedules( + cls, + quote: str, + **params: Unpack["Quote.ListPreviewSubscriptionSchedulesParams"], + ) -> ListObject["QuotePreviewSubscriptionSchedule"]: + """ + Preview the schedules that would be generated by accepting the quote + """ + return cast( + ListObject["QuotePreviewSubscriptionSchedule"], + cls._static_request( + "get", + "/v1/quotes/{quote}/preview_subscription_schedules".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + + @classmethod + async def list_preview_subscription_schedules_async( + cls, + quote: str, + **params: Unpack["Quote.ListPreviewSubscriptionSchedulesParams"], + ) -> ListObject["QuotePreviewSubscriptionSchedule"]: + """ + Preview the schedules that would be generated by accepting the quote + """ + return cast( + ListObject["QuotePreviewSubscriptionSchedule"], + await cls._static_request_async( + "get", + "/v1/quotes/{quote}/preview_subscription_schedules".format( + quote=sanitize_id(quote) + ), + params=params, + ), + ) + _inner_class_types = { "automatic_tax": AutomaticTax, "computed": Computed, "from_quote": FromQuote, "invoice_settings": InvoiceSettings, + "status_details": StatusDetails, "status_transitions": StatusTransitions, "subscription_data": SubscriptionData, + "subscription_data_overrides": SubscriptionDataOverride, + "subscription_schedules": SubscriptionSchedule, "total_details": TotalDetails, "transfer_data": TransferData, } diff --git a/stripe/_quote_line.py b/stripe/_quote_line.py new file mode 100644 index 000000000..4f236c1cc --- /dev/null +++ b/stripe/_quote_line.py @@ -0,0 +1,522 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._coupon import Coupon + from stripe._discount import Discount as DiscountResource + from stripe._price import Price + from stripe._promotion_code import PromotionCode + from stripe._tax_rate import TaxRate + + +class QuoteLine(StripeObject): + """ + A quote line defines a set of changes, in the order provided, that will be applied upon quote acceptance. + """ + + OBJECT_NAME: ClassVar[Literal["quote_line"]] = "quote_line" + + class Action(StripeObject): + class AddDiscount(StripeObject): + class DiscountEnd(StripeObject): + type: Literal["line_ends_at"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + index: Optional[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class AddItem(StripeObject): + class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class Trial(StripeObject): + converts_to: Optional[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + discounts: List[Discount] + """ + The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + """ + price: ExpandableField["Price"] + """ + ID of the price to which the customer should be subscribed. + """ + quantity: Optional[int] + """ + Quantity of the plan to which the customer should be subscribed. + """ + tax_rates: Optional[List["TaxRate"]] + """ + The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + """ + trial: Optional[Trial] + """ + Options that configure the trial on the subscription item. + """ + _inner_class_types = {"discounts": Discount, "trial": Trial} + + class RemoveDiscount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class RemoveItem(StripeObject): + price: ExpandableField["Price"] + """ + ID of a price to remove. + """ + + class SetDiscount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class SetItem(StripeObject): + class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class Trial(StripeObject): + converts_to: Optional[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + discounts: List[Discount] + """ + The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + """ + price: ExpandableField["Price"] + """ + ID of the price to which the customer should be subscribed. + """ + quantity: Optional[int] + """ + Quantity of the plan to which the customer should be subscribed. + """ + tax_rates: Optional[List["TaxRate"]] + """ + The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + """ + trial: Optional[Trial] + """ + Options that configure the trial on the subscription item. + """ + _inner_class_types = {"discounts": Discount, "trial": Trial} + + add_discount: Optional[AddDiscount] + """ + Details for the `add_discount` type. + """ + add_item: Optional[AddItem] + """ + Details for the `add_item` type. + """ + add_metadata: Optional[Dict[str, str]] + """ + Details for the `add_metadata` type: specify a hash of key-value pairs. + """ + remove_discount: Optional[RemoveDiscount] + """ + Details for the `remove_discount` type. + """ + remove_item: Optional[RemoveItem] + """ + Details for the `remove_item` type. + """ + remove_metadata: Optional[List[str]] + """ + Details for the `remove_metadata` type: specify an array of metadata keys. + """ + set_discounts: Optional[List[SetDiscount]] + """ + Details for the `set_discounts` type. + """ + set_items: Optional[List[SetItem]] + """ + Details for the `set_items` type. + """ + set_metadata: Optional[Dict[str, str]] + """ + Details for the `set_metadata` type: specify an array of key-value pairs. + """ + type: Literal[ + "add_discount", + "add_item", + "add_metadata", + "clear_discounts", + "clear_metadata", + "remove_discount", + "remove_item", + "remove_metadata", + "set_discounts", + "set_items", + "set_metadata", + ] + """ + The type of action the quote line performs. + """ + _inner_class_types = { + "add_discount": AddDiscount, + "add_item": AddItem, + "remove_discount": RemoveDiscount, + "remove_item": RemoveItem, + "set_discounts": SetDiscount, + "set_items": SetItem, + } + + class AppliesTo(StripeObject): + new_reference: Optional[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: Optional[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class CancelSubscriptionSchedule(StripeObject): + cancel_at: Literal["line_starts_at"] + """ + Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + """ + invoice_now: Optional[bool] + """ + If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + """ + prorate: Optional[bool] + """ + If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + """ + + class EndsAt(StripeObject): + class DiscountEnd(StripeObject): + discount: str + """ + The ID of a specific discount. + """ + + class Duration(StripeObject): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + computed: Optional[int] + """ + The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `ends_at` field. For example, if `ends_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `ends_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `ends_at` is respecified. This field is guaranteed to be populated after quote acceptance. + """ + discount_end: Optional[DiscountEnd] + """ + Use the `end` time of a given discount. + """ + duration: Optional[Duration] + """ + Time span for the quote line starting from the `starts_at` date. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "billing_period_end", + "discount_end", + "duration", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `ends_at`. + """ + _inner_class_types = { + "discount_end": DiscountEnd, + "duration": Duration, + } + + class SetPauseCollection(StripeObject): + class Set(StripeObject): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + set: Optional[Set] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ + type: Literal["remove", "set"] + """ + Defines the type of the pause_collection behavior for the quote line. + """ + _inner_class_types = {"set": Set} + + class StartsAt(StripeObject): + class DiscountEnd(StripeObject): + discount: str + """ + The ID of a specific discount. + """ + + class LineEndsAt(StripeObject): + id: str + """ + Unique identifier for the object. + """ + + computed: Optional[int] + """ + The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `starts_at` field. For example, if `starts_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `starts_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `starts_at` is respecified. This field is guaranteed to be populated after quote acceptance. + """ + discount_end: Optional[DiscountEnd] + """ + Use the `end` time of a given discount. + """ + line_ends_at: Optional[LineEndsAt] + """ + The timestamp the given line ends at. + """ + timestamp: Optional[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "discount_end", + "line_ends_at", + "now", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `starts_at`. + """ + _inner_class_types = { + "discount_end": DiscountEnd, + "line_ends_at": LineEndsAt, + } + + class TrialSettings(StripeObject): + class EndBehavior(StripeObject): + prorate_up_front: Optional[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + end_behavior: Optional[EndBehavior] + """ + Defines how the subscription should behave when a trial ends. + """ + _inner_class_types = {"end_behavior": EndBehavior} + + actions: Optional[List[Action]] + """ + A list of items the customer is being quoted for. + """ + applies_to: Optional[AppliesTo] + """ + Details to identify the subscription schedule the quote line applies to. + """ + billing_cycle_anchor: Optional[Literal["automatic", "line_starts_at"]] + """ + For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + """ + cancel_subscription_schedule: Optional[CancelSubscriptionSchedule] + """ + A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + """ + ends_at: Optional[EndsAt] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["quote_line"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + proration_behavior: Optional[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + """ + set_pause_collection: Optional[SetPauseCollection] + """ + Details to modify the pause_collection behavior of the subscription schedule. + """ + set_schedule_end: Optional[Literal["line_ends_at", "line_starts_at"]] + """ + Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + """ + starts_at: Optional[StartsAt] + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + trial_settings: Optional[TrialSettings] + """ + Settings related to subscription trials. + """ + _inner_class_types = { + "actions": Action, + "applies_to": AppliesTo, + "cancel_subscription_schedule": CancelSubscriptionSchedule, + "ends_at": EndsAt, + "set_pause_collection": SetPauseCollection, + "starts_at": StartsAt, + "trial_settings": TrialSettings, + } diff --git a/stripe/_quote_line_service.py b/stripe/_quote_line_service.py new file mode 100644 index 000000000..99e569228 --- /dev/null +++ b/stripe/_quote_line_service.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._quote_line import QuoteLine +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class QuoteLineService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + quote: str, + params: "QuoteLineService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuoteLine]: + """ + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ + return cast( + ListObject[QuoteLine], + self._request( + "get", + "/v1/quotes/{quote}/lines".format(quote=sanitize_id(quote)), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + quote: str, + params: "QuoteLineService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuoteLine]: + """ + Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ + return cast( + ListObject[QuoteLine], + await self._request_async( + "get", + "/v1/quotes/{quote}/lines".format(quote=sanitize_id(quote)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py new file mode 100644 index 000000000..1958ef530 --- /dev/null +++ b/stripe/_quote_preview_invoice.py @@ -0,0 +1,1567 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional, Union +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._application import Application + from stripe._bank_account import BankAccount + from stripe._card import Card as CardResource + from stripe._discount import Discount + from stripe._invoice import Invoice + from stripe._invoice_line_item import InvoiceLineItem + from stripe._invoice_payment import InvoicePayment + from stripe._margin import Margin + from stripe._payment_intent import PaymentIntent + from stripe._payment_method import PaymentMethod + from stripe._setup_intent import SetupIntent + from stripe._shipping_rate import ShippingRate + from stripe._source import Source + from stripe._subscription import Subscription + from stripe._tax_id import TaxId + from stripe._tax_rate import TaxRate + from stripe.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) + from stripe.test_helpers._test_clock import TestClock + + +class QuotePreviewInvoice(StripeObject): + """ + Invoices are statements of amounts owed by a customer, and are either + generated one-off, or generated periodically from a subscription. + + They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments + that may be caused by subscription upgrades/downgrades (if necessary). + + If your invoice is configured to be billed through automatic charges, + Stripe automatically finalizes your invoice and attempts payment. Note + that finalizing the invoice, + [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does + not happen immediately as the invoice is created. Stripe waits + until one hour after the last webhook was successfully sent (or the last + webhook timed out after failing). If you (and the platforms you may have + connected to) have no webhooks configured, Stripe waits one hour after + creation to finalize the invoice. + + If your invoice is configured to be billed by sending an email, then based on your + [email settings](https://dashboard.stripe.com/account/billing/automatic), + Stripe will email the invoice to your customer and await payment. These + emails can contain a link to a hosted page to pay the invoice. + + Stripe applies any customer credit on the account before determining the + amount due for the invoice (i.e., the amount that will be actually + charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge + per currency](https://docs.stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the + invoice is automatically marked paid, and we add the amount due to the + customer's credit balance which is applied to the next invoice. + + More details on the customer's credit balance are + [here](https://stripe.com/docs/billing/customer/balance). + + Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) + """ + + OBJECT_NAME: ClassVar[Literal["quote_preview_invoice"]] = ( + "quote_preview_invoice" + ) + + class AmountsDue(StripeObject): + amount: int + """ + Incremental amount due for this payment in cents (or local equivalent). + """ + amount_paid: int + """ + The amount in cents (or local equivalent) that was paid for this payment. + """ + amount_remaining: int + """ + The difference between the payment's amount and amount_paid, in cents (or local equivalent). + """ + days_until_due: Optional[int] + """ + Number of days from when invoice is finalized until the payment is due. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + due_date: Optional[int] + """ + Date on which a payment plan's payment is due. + """ + paid_at: Optional[int] + """ + Timestamp when the payment was paid. + """ + status: Literal["open", "paid", "past_due"] + """ + The status of the payment, one of `open`, `paid`, or `past_due` + """ + + class AppliesTo(StripeObject): + new_reference: Optional[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: Optional[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class AutomaticTax(StripeObject): + class Liability(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + disabled_reason: Optional[ + Literal[ + "finalization_requires_location_inputs", + "finalization_system_error", + ] + ] + """ + If Stripe disabled automatic tax, this enum describes why. + """ + enabled: bool + """ + Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + """ + liability: Optional[Liability] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + provider: Optional[str] + """ + The tax provider powering automatic tax. + """ + status: Optional[ + Literal["complete", "failed", "requires_location_inputs"] + ] + """ + The status of the most recent automated tax calculation for this invoice. + """ + _inner_class_types = {"liability": Liability} + + class ConfirmationSecret(StripeObject): + client_secret: str + """ + The client_secret of the payment that Stripe creates for the invoice after finalization. + """ + type: str + """ + The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization + """ + + class CustomField(StripeObject): + name: str + """ + The name of the custom field. + """ + value: str + """ + The value of the custom field. + """ + + class CustomerAddress(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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + class CustomerShipping(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + carrier: Optional[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: Optional[str] + """ + Recipient name. + """ + phone: Optional[str] + """ + Recipient phone (including extension). + """ + tracking_number: Optional[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + _inner_class_types = {"address": Address} + + class CustomerTaxId(StripeObject): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "unknown", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + """ + value: Optional[str] + """ + The value of the tax ID. + """ + + class FromInvoice(StripeObject): + action: str + """ + The relation between this invoice and the cloned invoice + """ + invoice: ExpandableField["Invoice"] + """ + The invoice that was cloned. + """ + + class Issuer(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + class LastFinalizationError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ + charge: Optional[str] + """ + For card errors, the ID of the failed charge. + """ + code: Optional[ + Literal[ + "account_closed", + "account_country_invalid_address", + "account_error_country_change_requires_additional_steps", + "account_information_mismatch", + "account_invalid", + "account_number_invalid", + "acss_debit_session_incomplete", + "alipay_upgrade_required", + "amount_too_large", + "amount_too_small", + "api_key_expired", + "application_fees_not_allowed", + "authentication_required", + "balance_insufficient", + "balance_invalid_parameter", + "bank_account_bad_routing_numbers", + "bank_account_declined", + "bank_account_exists", + "bank_account_restricted", + "bank_account_unusable", + "bank_account_unverified", + "bank_account_verification_failed", + "billing_invalid_mandate", + "bitcoin_upgrade_required", + "capture_charge_authorization_expired", + "capture_unauthorized_payment", + "card_decline_rate_limit_exceeded", + "card_declined", + "cardholder_phone_number_required", + "charge_already_captured", + "charge_already_refunded", + "charge_disputed", + "charge_exceeds_source_limit", + "charge_exceeds_transaction_limit", + "charge_expired_for_capture", + "charge_invalid_parameter", + "charge_not_refundable", + "clearing_code_unsupported", + "country_code_invalid", + "country_unsupported", + "coupon_expired", + "customer_max_payment_methods", + "customer_max_subscriptions", + "customer_tax_location_invalid", + "debit_not_authorized", + "email_invalid", + "expired_card", + "financial_connections_account_inactive", + "financial_connections_institution_unavailable", + "financial_connections_no_successful_transaction_refresh", + "forwarding_api_inactive", + "forwarding_api_invalid_parameter", + "forwarding_api_retryable_upstream_error", + "forwarding_api_upstream_connection_error", + "forwarding_api_upstream_connection_timeout", + "forwarding_api_upstream_error", + "idempotency_key_in_use", + "incorrect_address", + "incorrect_cvc", + "incorrect_number", + "incorrect_zip", + "instant_payouts_config_disabled", + "instant_payouts_currency_disabled", + "instant_payouts_limit_exceeded", + "instant_payouts_unsupported", + "insufficient_funds", + "intent_invalid_state", + "intent_verification_method_missing", + "invalid_card_type", + "invalid_characters", + "invalid_charge_amount", + "invalid_cvc", + "invalid_expiry_month", + "invalid_expiry_year", + "invalid_mandate_reference_prefix_format", + "invalid_number", + "invalid_source_usage", + "invalid_tax_location", + "invoice_no_customer_line_items", + "invoice_no_payment_method_types", + "invoice_no_subscription_line_items", + "invoice_not_editable", + "invoice_on_behalf_of_not_editable", + "invoice_payment_intent_requires_action", + "invoice_upcoming_none", + "livemode_mismatch", + "lock_timeout", + "missing", + "no_account", + "not_allowed_on_standard_account", + "out_of_inventory", + "ownership_declaration_not_allowed", + "parameter_invalid_empty", + "parameter_invalid_integer", + "parameter_invalid_string_blank", + "parameter_invalid_string_empty", + "parameter_missing", + "parameter_unknown", + "parameters_exclusive", + "payment_intent_action_required", + "payment_intent_authentication_failure", + "payment_intent_incompatible_payment_method", + "payment_intent_invalid_parameter", + "payment_intent_konbini_rejected_confirmation_number", + "payment_intent_mandate_invalid", + "payment_intent_payment_attempt_expired", + "payment_intent_payment_attempt_failed", + "payment_intent_unexpected_state", + "payment_method_bank_account_already_verified", + "payment_method_bank_account_blocked", + "payment_method_billing_details_address_missing", + "payment_method_configuration_failures", + "payment_method_currency_mismatch", + "payment_method_customer_decline", + "payment_method_invalid_parameter", + "payment_method_invalid_parameter_testmode", + "payment_method_microdeposit_failed", + "payment_method_microdeposit_verification_amounts_invalid", + "payment_method_microdeposit_verification_amounts_mismatch", + "payment_method_microdeposit_verification_attempts_exceeded", + "payment_method_microdeposit_verification_descriptor_code_mismatch", + "payment_method_microdeposit_verification_timeout", + "payment_method_not_available", + "payment_method_provider_decline", + "payment_method_provider_timeout", + "payment_method_unactivated", + "payment_method_unexpected_state", + "payment_method_unsupported_type", + "payout_reconciliation_not_ready", + "payouts_limit_exceeded", + "payouts_not_allowed", + "platform_account_required", + "platform_api_key_expired", + "postal_code_invalid", + "processing_error", + "product_inactive", + "progressive_onboarding_limit_exceeded", + "rate_limit", + "refer_to_customer", + "refund_disputed_payment", + "resource_already_exists", + "resource_missing", + "return_intent_already_processed", + "routing_number_invalid", + "secret_key_required", + "sensitive_data_access_expired", + "sepa_unsupported_account", + "setup_attempt_failed", + "setup_intent_authentication_failure", + "setup_intent_invalid_parameter", + "setup_intent_mandate_invalid", + "setup_intent_mobile_wallet_unsupported", + "setup_intent_setup_attempt_expired", + "setup_intent_unexpected_state", + "shipping_address_invalid", + "shipping_calculation_failed", + "sku_inactive", + "state_unsupported", + "status_transition_invalid", + "stripe_tax_inactive", + "tax_id_invalid", + "tax_id_prohibited", + "taxes_calculation_failed", + "terminal_location_country_unsupported", + "terminal_reader_busy", + "terminal_reader_collected_data_invalid", + "terminal_reader_hardware_fault", + "terminal_reader_invalid_location_for_activation", + "terminal_reader_invalid_location_for_payment", + "terminal_reader_offline", + "terminal_reader_timeout", + "testmode_charges_only", + "tls_version_unsupported", + "token_already_used", + "token_card_network_invalid", + "token_in_use", + "transfer_source_balance_parameters_mismatch", + "transfers_not_allowed", + "url_invalid", + "v2_account_disconnection_unsupported", + "v2_account_missing_configuration", + ] + ] + """ + For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + """ + decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + """ + doc_url: Optional[str] + """ + A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + """ + message: Optional[str] + """ + A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + """ + network_advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + """ + network_decline_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + """ + param: Optional[str] + """ + If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + """ + payment_intent: Optional["PaymentIntent"] + """ + A PaymentIntent guides you through the process of collecting a payment from your customer. + We recommend that you create exactly one PaymentIntent for each order or + customer session in your system. You can reference the PaymentIntent later to + see the history of payment attempts for a particular session. + + A PaymentIntent transitions through + [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + throughout its lifetime as it interfaces with Stripe.js to perform + authentication flows and ultimately creates at most one successful charge. + + Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + """ + payment_method: Optional["PaymentMethod"] + """ + PaymentMethod objects represent your customer's payment instruments. + You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + Customer objects to store instrument details for future payments. + + Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + """ + payment_method_type: Optional[str] + """ + If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + """ + request_log_url: Optional[str] + """ + A URL to the request log entry in your dashboard. + """ + setup_intent: Optional["SetupIntent"] + """ + A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + + Create a SetupIntent when you're ready to collect your customer's payment credentials. + Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + you through the setup process. + + Successful SetupIntents result in payment credentials that are optimized for future payments. + For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + it automatically attaches the resulting payment method to that Customer after successful setup. + We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + + By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + + Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + """ + source: Optional[ + Union["Account", "BankAccount", "CardResource", "Source"] + ] + type: Literal[ + "api_error", + "card_error", + "idempotency_error", + "invalid_request_error", + ] + """ + The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + """ + + class Parent(StripeObject): + class QuoteDetails(StripeObject): + quote: str + """ + The quote that generated this invoice + """ + + class SubscriptionDetails(StripeObject): + class PauseCollection(StripeObject): + behavior: Optional[ + Literal["keep_as_draft", "mark_uncollectible", "void"] + ] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + resumes_at: Optional[int] + """ + The time after which the subscription will resume collecting payments. + """ + + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + """ + pause_collection: Optional[PauseCollection] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ + subscription: ExpandableField["Subscription"] + """ + The subscription that generated this invoice + """ + subscription_proration_date: Optional[int] + """ + Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + """ + _inner_class_types = {"pause_collection": PauseCollection} + + quote_details: Optional[QuoteDetails] + """ + Details about the quote that generated this invoice + """ + subscription_details: Optional[SubscriptionDetails] + """ + Details about the subscription that generated this invoice + """ + type: Literal["quote_details", "subscription_details"] + """ + The type of parent that generated this invoice + """ + _inner_class_types = { + "quote_details": QuoteDetails, + "subscription_details": SubscriptionDetails, + } + + class PaymentSettings(StripeObject): + class PaymentMethodOptions(StripeObject): + class AcssDebit(StripeObject): + class MandateOptions(StripeObject): + transaction_type: Optional[Literal["business", "personal"]] + """ + Transaction type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + verification_method: Optional[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + _inner_class_types = {"mandate_options": MandateOptions} + + class Bancontact(StripeObject): + preferred_language: Literal["de", "en", "fr", "nl"] + """ + Preferred language of the Bancontact authorization page that the customer is redirected to. + """ + + class Card(StripeObject): + class Installments(StripeObject): + enabled: Optional[bool] + """ + Whether Installments are enabled for this Invoice. + """ + + installments: Optional[Installments] + request_three_d_secure: Optional[ + Literal["any", "automatic", "challenge"] + ] + """ + We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + """ + _inner_class_types = {"installments": Installments} + + class CustomerBalance(StripeObject): + class BankTransfer(StripeObject): + class EuBankTransfer(StripeObject): + country: Literal["BE", "DE", "ES", "FR", "IE", "NL"] + """ + The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + """ + + eu_bank_transfer: Optional[EuBankTransfer] + type: Optional[str] + """ + The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + """ + _inner_class_types = {"eu_bank_transfer": EuBankTransfer} + + bank_transfer: Optional[BankTransfer] + funding_type: Optional[Literal["bank_transfer"]] + """ + The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + """ + _inner_class_types = {"bank_transfer": BankTransfer} + + class IdBankTransfer(StripeObject): + pass + + class Konbini(StripeObject): + pass + + class SepaDebit(StripeObject): + pass + + class UsBankAccount(StripeObject): + class FinancialConnections(StripeObject): + class Filters(StripeObject): + account_subcategories: Optional[ + List[Literal["checking", "savings"]] + ] + """ + The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ + + filters: Optional[Filters] + permissions: Optional[ + List[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ] + ] + ] + """ + The list of permissions to request. The `payment_method` permission must be included. + """ + prefetch: Optional[ + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] + ] + """ + Data features requested to be retrieved upon account creation. + """ + _inner_class_types = {"filters": Filters} + + financial_connections: Optional[FinancialConnections] + verification_method: Optional[ + Literal["automatic", "instant", "microdeposits"] + ] + """ + Bank account verification method. + """ + _inner_class_types = { + "financial_connections": FinancialConnections, + } + + acss_debit: Optional[AcssDebit] + """ + If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + """ + bancontact: Optional[Bancontact] + """ + If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + """ + card: Optional[Card] + """ + If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + """ + customer_balance: Optional[CustomerBalance] + """ + If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + """ + id_bank_transfer: Optional[IdBankTransfer] + """ + If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ + konbini: Optional[Konbini] + """ + If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + """ + sepa_debit: Optional[SepaDebit] + """ + If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. + """ + us_bank_account: Optional[UsBankAccount] + """ + If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + """ + _inner_class_types = { + "acss_debit": AcssDebit, + "bancontact": Bancontact, + "card": Card, + "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, + "konbini": Konbini, + "sepa_debit": SepaDebit, + "us_bank_account": UsBankAccount, + } + + default_mandate: Optional[str] + """ + ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + """ + payment_method_options: Optional[PaymentMethodOptions] + """ + Payment-method-specific configuration to provide to the invoice's PaymentIntent. + """ + payment_method_types: Optional[ + List[ + Literal[ + "ach_credit_transfer", + "ach_debit", + "acss_debit", + "affirm", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "boleto", + "card", + "cashapp", + "custom", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "id_bank_transfer", + "ideal", + "jp_credit_transfer", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "multibanco", + "naver_pay", + "nz_bank_account", + "p24", + "payco", + "paynow", + "paypal", + "promptpay", + "revolut_pay", + "sepa_credit_transfer", + "sepa_debit", + "sofort", + "stripe_balance", + "swish", + "us_bank_account", + "wechat_pay", + ] + ] + ] + """ + The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + """ + _inner_class_types = {"payment_method_options": PaymentMethodOptions} + + class Rendering(StripeObject): + class Pdf(StripeObject): + page_size: Optional[Literal["a4", "auto", "letter"]] + """ + Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + """ + + amount_tax_display: Optional[str] + """ + How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + """ + pdf: Optional[Pdf] + """ + Invoice pdf rendering options + """ + template: Optional[str] + """ + ID of the rendering template that the invoice is formatted by. + """ + template_version: Optional[int] + """ + Version of the rendering template that the invoice is using. + """ + _inner_class_types = {"pdf": Pdf} + + class ShippingCost(StripeObject): + class Tax(StripeObject): + amount: int + """ + Amount of tax applied for this rate. + """ + rate: "TaxRate" + """ + Tax rates can be applied to [invoices](https://docs.stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://docs.stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://docs.stripe.com/payments/checkout/use-manual-tax-rates) to collect tax. + + Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) + """ + taxability_reason: Optional[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + """ + taxable_amount: Optional[int] + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + + amount_subtotal: int + """ + Total shipping cost before any taxes are applied. + """ + amount_tax: int + """ + Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + """ + amount_total: int + """ + Total shipping cost after taxes are applied. + """ + shipping_rate: Optional[ExpandableField["ShippingRate"]] + """ + The ID of the ShippingRate for this invoice. + """ + taxes: Optional[List[Tax]] + """ + The taxes applied to the shipping rate. + """ + _inner_class_types = {"taxes": Tax} + + class ShippingDetails(StripeObject): + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + carrier: Optional[str] + """ + The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + """ + name: Optional[str] + """ + Recipient name. + """ + phone: Optional[str] + """ + Recipient phone (including extension). + """ + tracking_number: Optional[str] + """ + The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + """ + _inner_class_types = {"address": Address} + + class StatusTransitions(StripeObject): + finalized_at: Optional[int] + """ + The time that the invoice draft was finalized. + """ + marked_uncollectible_at: Optional[int] + """ + The time that the invoice was marked uncollectible. + """ + paid_at: Optional[int] + """ + The time that the invoice was paid. + """ + voided_at: Optional[int] + """ + The time that the invoice was voided. + """ + + class ThresholdReason(StripeObject): + class ItemReason(StripeObject): + line_item_ids: List[str] + """ + The IDs of the line items that triggered the threshold invoice. + """ + usage_gte: int + """ + The quantity threshold boundary that applied to the given line item. + """ + + amount_gte: Optional[int] + """ + The total invoice amount threshold boundary if it triggered the threshold invoice. + """ + item_reasons: List[ItemReason] + """ + Indicates which line items triggered a threshold invoice. + """ + _inner_class_types = {"item_reasons": ItemReason} + + class TotalDiscountAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the discount. + """ + discount: ExpandableField["Discount"] + """ + The discount that was applied to get this discount amount. + """ + + class TotalMarginAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the reduction in line item amount. + """ + margin: ExpandableField["Margin"] + """ + The margin that was applied to get this margin amount. + """ + + class TotalPretaxCreditAmount(StripeObject): + amount: int + """ + The amount, in cents (or local equivalent), of the pretax credit amount. + """ + credit_balance_transaction: Optional[ + ExpandableField["CreditBalanceTransaction"] + ] + """ + The credit balance transaction that was applied to get this pretax credit amount. + """ + discount: Optional[ExpandableField["Discount"]] + """ + The discount that was applied to get this pretax credit amount. + """ + margin: Optional[ExpandableField["Margin"]] + """ + The margin that was applied to get this pretax credit amount. + """ + type: Literal["credit_balance_transaction", "discount", "margin"] + """ + Type of the pretax credit amount referenced. + """ + + class TotalTax(StripeObject): + class TaxRateDetails(StripeObject): + tax_rate: str + + amount: int + """ + The amount of the tax, in cents (or local equivalent). + """ + tax_behavior: Literal["exclusive", "inclusive"] + """ + Whether this tax is inclusive or exclusive. + """ + tax_rate_details: Optional[TaxRateDetails] + """ + Additional details about the tax rate. Only present when `type` is `tax_rate_details`. + """ + taxability_reason: Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ] + """ + The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + """ + taxable_amount: Optional[int] + """ + The amount on which tax is calculated, in cents (or local equivalent). + """ + type: Literal["tax_rate_details"] + """ + The type of tax information. + """ + _inner_class_types = {"tax_rate_details": TaxRateDetails} + + account_country: Optional[str] + """ + The country of the business associated with this invoice, most often the business creating the invoice. + """ + account_name: Optional[str] + """ + The public name of the business associated with this invoice, most often the business creating the invoice. + """ + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + """ + amount_due: int + """ + Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + """ + amount_overpaid: int + """ + Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance. + """ + amount_paid: int + """ + The amount, in cents (or local equivalent), that was paid. + """ + amount_remaining: int + """ + The difference between amount_due and amount_paid, in cents (or local equivalent). + """ + amount_shipping: int + """ + This is the sum of all the shipping amounts. + """ + amounts_due: Optional[List[AmountsDue]] + """ + List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + """ + application: Optional[ExpandableField["Application"]] + """ + ID of the Connect Application that created the invoice. + """ + applies_to: AppliesTo + attempt_count: int + """ + Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + """ + attempted: bool + """ + Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + """ + automatic_tax: AutomaticTax + automatically_finalizes_at: Optional[int] + """ + The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + """ + billing_reason: Optional[ + Literal[ + "automatic_pending_invoice_item_invoice", + "manual", + "quote_accept", + "subscription", + "subscription_create", + "subscription_cycle", + "subscription_threshold", + "subscription_update", + "upcoming", + ] + ] + """ + Indicates the reason why the invoice was created. + + * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + * `subscription_create`: A new subscription was created. + * `subscription_cycle`: A subscription advanced into a new period. + * `subscription_threshold`: A subscription reached a billing threshold. + * `subscription_update`: A subscription was updated. + * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + """ + collection_method: Literal["charge_automatically", "send_invoice"] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + """ + confirmation_secret: Optional[ConfirmationSecret] + """ + The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + custom_fields: Optional[List[CustomField]] + """ + Custom fields displayed on the invoice. + """ + customer_account: Optional[str] + """ + The ID of the account who will be billed. + """ + customer_address: Optional[CustomerAddress] + """ + The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_email: Optional[str] + """ + The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_name: Optional[str] + """ + The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_phone: Optional[str] + """ + The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_shipping: Optional[CustomerShipping] + """ + The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_tax_exempt: Optional[Literal["exempt", "none", "reverse"]] + """ + The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. + """ + customer_tax_ids: Optional[List[CustomerTaxId]] + """ + The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. + """ + default_margins: Optional[List[ExpandableField["Margin"]]] + """ + The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + """ + default_payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + """ + default_source: Optional[ + ExpandableField[ + Union["Account", "BankAccount", "CardResource", "Source"] + ] + ] + """ + ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + """ + default_tax_rates: List["TaxRate"] + """ + The tax rates applied to this invoice, if any. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + """ + discounts: List[ExpandableField["Discount"]] + """ + The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + """ + due_date: Optional[int] + """ + The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. + """ + effective_at: Optional[int] + """ + The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + """ + ending_balance: Optional[int] + """ + Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + """ + footer: Optional[str] + """ + Footer displayed on the invoice. + """ + from_invoice: Optional[FromInvoice] + """ + Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + """ + id: str + """ + Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`. + """ + issuer: Issuer + last_finalization_error: Optional[LastFinalizationError] + """ + The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + """ + latest_revision: Optional[ExpandableField["Invoice"]] + """ + The ID of the most recent non-draft revision of this invoice + """ + lines: ListObject["InvoiceLineItem"] + """ + The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + next_payment_attempt: Optional[int] + """ + The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. + """ + number: Optional[str] + """ + A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + """ + object: Literal["quote_preview_invoice"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + on_behalf_of: Optional[ExpandableField["Account"]] + """ + The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + """ + parent: Optional[Parent] + """ + The parent that generated this invoice + """ + payment_settings: PaymentSettings + payments: Optional[ListObject["InvoicePayment"]] + """ + Payments for this invoice + """ + period_end: int + """ + End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + """ + period_start: int + """ + Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + """ + post_payment_credit_notes_amount: int + """ + Total amount of all post-payment credit notes issued for this invoice. + """ + pre_payment_credit_notes_amount: int + """ + Total amount of all pre-payment credit notes issued for this invoice. + """ + receipt_number: Optional[str] + """ + This is the transaction number that appears on email receipts sent for this invoice. + """ + rendering: Optional[Rendering] + """ + The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + """ + shipping_cost: Optional[ShippingCost] + """ + The details of the cost of shipping, including the ShippingRate applied on the invoice. + """ + shipping_details: Optional[ShippingDetails] + """ + Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + """ + starting_balance: int + """ + Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. + """ + statement_descriptor: Optional[str] + """ + Extra information about an invoice for the customer's credit card statement. + """ + status: Optional[Literal["draft", "open", "paid", "uncollectible", "void"]] + """ + The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + """ + status_transitions: StatusTransitions + subscription: Optional[ExpandableField["Subscription"]] + subtotal: int + """ + Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated + """ + subtotal_excluding_tax: Optional[int] + """ + The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + """ + test_clock: Optional[ExpandableField["TestClock"]] + """ + ID of the test clock this invoice belongs to. + """ + threshold_reason: Optional[ThresholdReason] + total: int + """ + Total after discounts and taxes. + """ + total_discount_amounts: Optional[List[TotalDiscountAmount]] + """ + The aggregate amounts calculated per discount across all line items. + """ + total_excluding_tax: Optional[int] + """ + The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + """ + total_margin_amounts: Optional[List[TotalMarginAmount]] + """ + The aggregate amounts calculated per margin across all line items. + """ + total_pretax_credit_amounts: Optional[List[TotalPretaxCreditAmount]] + """ + Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + """ + total_taxes: Optional[List[TotalTax]] + """ + The aggregate tax information of all line items. + """ + webhooks_delivered_at: Optional[int] + """ + Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + """ + _inner_class_types = { + "amounts_due": AmountsDue, + "applies_to": AppliesTo, + "automatic_tax": AutomaticTax, + "confirmation_secret": ConfirmationSecret, + "custom_fields": CustomField, + "customer_address": CustomerAddress, + "customer_shipping": CustomerShipping, + "customer_tax_ids": CustomerTaxId, + "from_invoice": FromInvoice, + "issuer": Issuer, + "last_finalization_error": LastFinalizationError, + "parent": Parent, + "payment_settings": PaymentSettings, + "rendering": Rendering, + "shipping_cost": ShippingCost, + "shipping_details": ShippingDetails, + "status_transitions": StatusTransitions, + "threshold_reason": ThresholdReason, + "total_discount_amounts": TotalDiscountAmount, + "total_margin_amounts": TotalMarginAmount, + "total_pretax_credit_amounts": TotalPretaxCreditAmount, + "total_taxes": TotalTax, + } diff --git a/stripe/_quote_preview_invoice_service.py b/stripe/_quote_preview_invoice_service.py new file mode 100644 index 000000000..40903eb98 --- /dev/null +++ b/stripe/_quote_preview_invoice_service.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._quote_preview_invoice import QuotePreviewInvoice +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class QuotePreviewInvoiceService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + quote: str, + params: "QuotePreviewInvoiceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuotePreviewInvoice]: + """ + Preview the invoices that would be generated by accepting the quote. + """ + return cast( + ListObject[QuotePreviewInvoice], + self._request( + "get", + "/v1/quotes/{quote}/preview_invoices".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + quote: str, + params: "QuotePreviewInvoiceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuotePreviewInvoice]: + """ + Preview the invoices that would be generated by accepting the quote. + """ + return cast( + ListObject[QuotePreviewInvoice], + await self._request_async( + "get", + "/v1/quotes/{quote}/preview_invoices".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote_preview_subscription_schedule.py b/stripe/_quote_preview_subscription_schedule.py new file mode 100644 index 000000000..76c9f3c91 --- /dev/null +++ b/stripe/_quote_preview_subscription_schedule.py @@ -0,0 +1,665 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._application import Application + from stripe._coupon import Coupon + from stripe._customer import Customer + from stripe._discount import Discount as DiscountResource + from stripe._invoice import Invoice + from stripe._payment_method import PaymentMethod + from stripe._plan import Plan + from stripe._price import Price + from stripe._promotion_code import PromotionCode + from stripe._subscription import Subscription + from stripe._tax_id import TaxId + from stripe._tax_rate import TaxRate + from stripe.test_helpers._test_clock import TestClock + + +class QuotePreviewSubscriptionSchedule(StripeObject): + OBJECT_NAME: ClassVar[Literal["quote_preview_subscription_schedule"]] = ( + "quote_preview_subscription_schedule" + ) + + class AppliesTo(StripeObject): + new_reference: Optional[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: Optional[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class CurrentPhase(StripeObject): + end_date: int + """ + The end of this phase of the subscription schedule. + """ + start_date: int + """ + The start of this phase of the subscription schedule. + """ + + class DefaultSettings(StripeObject): + class AutomaticTax(StripeObject): + class Liability(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + disabled_reason: Optional[Literal["requires_location_inputs"]] + """ + If Stripe disabled automatic tax, this enum describes why. + """ + enabled: bool + """ + Whether Stripe automatically computes tax on invoices created during this phase. + """ + liability: Optional[Liability] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + _inner_class_types = {"liability": Liability} + + class BillingThresholds(StripeObject): + amount_gte: Optional[int] + """ + Monetary threshold that triggers the subscription to create an invoice + """ + reset_billing_cycle_anchor: Optional[bool] + """ + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + """ + + class InvoiceSettings(StripeObject): + class Issuer(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + """ + days_until_due: Optional[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: Issuer + _inner_class_types = {"issuer": Issuer} + + class TransferData(StripeObject): + amount_percent: Optional[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + """ + destination: ExpandableField["Account"] + """ + The account where funds from the payment will be transferred to upon payment success. + """ + + application_fee_percent: Optional[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + """ + automatic_tax: Optional[AutomaticTax] + billing_cycle_anchor: Literal["automatic", "phase_start"] + """ + Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: Optional[BillingThresholds] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + """ + collection_method: Optional[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + """ + default_payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + description: Optional[str] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + invoice_settings: InvoiceSettings + on_behalf_of: Optional[ExpandableField["Account"]] + """ + The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + """ + transfer_data: Optional[TransferData] + """ + The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + """ + _inner_class_types = { + "automatic_tax": AutomaticTax, + "billing_thresholds": BillingThresholds, + "invoice_settings": InvoiceSettings, + "transfer_data": TransferData, + } + + class LastPriceMigrationError(StripeObject): + class FailedTransition(StripeObject): + source_price: str + """ + The original price to be migrated. + """ + target_price: str + """ + The intended resulting price of the migration. + """ + + errored_at: int + """ + The time at which the price migration encountered an error. + """ + failed_transitions: List[FailedTransition] + """ + The involved price pairs in each failed transition. + """ + type: Literal["price_uniqueness_violation"] + """ + The type of error encountered by the price migration. + """ + _inner_class_types = {"failed_transitions": FailedTransition} + + class Phase(StripeObject): + class AddInvoiceItem(StripeObject): + class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + discounts: List[Discount] + """ + The stackable discounts that will be applied to the item. + """ + price: ExpandableField["Price"] + """ + ID of the price used to generate the invoice item. + """ + quantity: Optional[int] + """ + The quantity of the invoice item. + """ + tax_rates: Optional[List["TaxRate"]] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + _inner_class_types = {"discounts": Discount} + + class AutomaticTax(StripeObject): + class Liability(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + disabled_reason: Optional[Literal["requires_location_inputs"]] + """ + If Stripe disabled automatic tax, this enum describes why. + """ + enabled: bool + """ + Whether Stripe automatically computes tax on invoices created during this phase. + """ + liability: Optional[Liability] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + _inner_class_types = {"liability": Liability} + + class BillingThresholds(StripeObject): + amount_gte: Optional[int] + """ + Monetary threshold that triggers the subscription to create an invoice + """ + reset_billing_cycle_anchor: Optional[bool] + """ + Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + """ + + class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class InvoiceSettings(StripeObject): + class Issuer(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced. + """ + + account_tax_ids: Optional[List[ExpandableField["TaxId"]]] + """ + The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + """ + days_until_due: Optional[int] + """ + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + """ + issuer: Optional[Issuer] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + _inner_class_types = {"issuer": Issuer} + + class Item(StripeObject): + class BillingThresholds(StripeObject): + usage_gte: Optional[int] + """ + Usage threshold that triggers the subscription to create an invoice + """ + + class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + + coupon: Optional[ExpandableField["Coupon"]] + """ + ID of the coupon to create a new discount for. + """ + discount: Optional[ExpandableField["DiscountResource"]] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + ID of the promotion code to create a new discount for. + """ + _inner_class_types = {"discount_end": DiscountEnd} + + class Trial(StripeObject): + converts_to: Optional[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + billing_thresholds: Optional[BillingThresholds] + """ + Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + """ + discounts: List[Discount] + """ + The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + """ + plan: ExpandableField["Plan"] + """ + ID of the plan to which the customer should be subscribed. + """ + price: ExpandableField["Price"] + """ + ID of the price to which the customer should be subscribed. + """ + quantity: Optional[int] + """ + Quantity of the plan to which the customer should be subscribed. + """ + tax_rates: Optional[List["TaxRate"]] + """ + The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + """ + trial: Optional[Trial] + """ + Options that configure the trial on the subscription item. + """ + _inner_class_types = { + "billing_thresholds": BillingThresholds, + "discounts": Discount, + "trial": Trial, + } + + class PauseCollection(StripeObject): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class TransferData(StripeObject): + amount_percent: Optional[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + """ + destination: ExpandableField["Account"] + """ + The account where funds from the payment will be transferred to upon payment success. + """ + + class TrialSettings(StripeObject): + class EndBehavior(StripeObject): + prorate_up_front: Optional[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + end_behavior: Optional[EndBehavior] + """ + Defines how the subscription should behave when a trial ends. + """ + _inner_class_types = {"end_behavior": EndBehavior} + + add_invoice_items: List[AddInvoiceItem] + """ + A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + """ + application_fee_percent: Optional[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + """ + automatic_tax: Optional[AutomaticTax] + billing_cycle_anchor: Optional[Literal["automatic", "phase_start"]] + """ + Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + """ + billing_thresholds: Optional[BillingThresholds] + """ + Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + """ + collection_method: Optional[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + default_payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + """ + default_tax_rates: Optional[List["TaxRate"]] + """ + The default tax rates to apply to the subscription during this phase of the subscription schedule. + """ + description: Optional[str] + """ + Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + discounts: List[Discount] + """ + The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + """ + end_date: int + """ + The end of this phase of the subscription schedule. + """ + invoice_settings: Optional[InvoiceSettings] + """ + The invoice settings applicable during this phase. + """ + items: List[Item] + """ + Subscription items to configure the subscription to during this phase of the subscription schedule. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + """ + on_behalf_of: Optional[ExpandableField["Account"]] + """ + The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + """ + pause_collection: Optional[PauseCollection] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ + proration_behavior: Literal[ + "always_invoice", "create_prorations", "none" + ] + """ + When transitioning phases, controls how prorations are handled (if any). Possible values are `create_prorations`, `none`, and `always_invoice`. + """ + start_date: int + """ + The start of this phase of the subscription schedule. + """ + transfer_data: Optional[TransferData] + """ + The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + """ + trial_continuation: Optional[Literal["continue", "none"]] + """ + Specify behavior of the trial when crossing schedule phase boundaries + """ + trial_end: Optional[int] + """ + When the trial ends within the phase. + """ + trial_settings: Optional[TrialSettings] + """ + Settings related to any trials on the subscription during this phase. + """ + _inner_class_types = { + "add_invoice_items": AddInvoiceItem, + "automatic_tax": AutomaticTax, + "billing_thresholds": BillingThresholds, + "discounts": Discount, + "invoice_settings": InvoiceSettings, + "items": Item, + "pause_collection": PauseCollection, + "transfer_data": TransferData, + "trial_settings": TrialSettings, + } + + class Prebilling(StripeObject): + invoice: ExpandableField["Invoice"] + """ + ID of the prebilling invoice. + """ + period_end: int + """ + The end of the last period for which the invoice pre-bills. + """ + period_start: int + """ + The start of the first period for which the invoice pre-bills. + """ + update_behavior: Optional[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + """ + + application: Optional[ExpandableField["Application"]] + """ + ID of the Connect Application that created the schedule. + """ + applies_to: AppliesTo + billing_behavior: Optional[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: Optional[Literal["classic", "flexible"]] + """ + The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + """ + canceled_at: Optional[int] + """ + Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + """ + completed_at: Optional[int] + """ + Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + current_phase: Optional[CurrentPhase] + """ + Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + """ + customer: ExpandableField["Customer"] + """ + ID of the customer who owns the subscription schedule. + """ + customer_account: Optional[str] + """ + ID of the account who owns the subscription schedule. + """ + default_settings: DefaultSettings + end_behavior: Literal["cancel", "none", "release", "renew"] + """ + Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + """ + id: str + """ + Unique identifier for the object. + """ + last_price_migration_error: Optional[LastPriceMigrationError] + """ + Details of the most recent price migration that failed for the subscription schedule. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["quote_preview_subscription_schedule"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + phases: List[Phase] + """ + Configuration for the subscription schedule's phases. + """ + prebilling: Optional[Prebilling] + """ + Time period and invoice for a Subscription billed in advance. + """ + released_at: Optional[int] + """ + Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + """ + released_subscription: Optional[str] + """ + ID of the subscription once managed by the subscription schedule (if it is released). + """ + status: Literal[ + "active", "canceled", "completed", "not_started", "released" + ] + """ + The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + """ + subscription: Optional[ExpandableField["Subscription"]] + """ + ID of the subscription managed by the subscription schedule. + """ + test_clock: Optional[ExpandableField["TestClock"]] + """ + ID of the test clock this subscription schedule belongs to. + """ + _inner_class_types = { + "applies_to": AppliesTo, + "current_phase": CurrentPhase, + "default_settings": DefaultSettings, + "last_price_migration_error": LastPriceMigrationError, + "phases": Phase, + "prebilling": Prebilling, + } diff --git a/stripe/_quote_preview_subscription_schedule_service.py b/stripe/_quote_preview_subscription_schedule_service.py new file mode 100644 index 000000000..085e30e47 --- /dev/null +++ b/stripe/_quote_preview_subscription_schedule_service.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._quote_preview_subscription_schedule import ( + QuotePreviewSubscriptionSchedule, +) +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class QuotePreviewSubscriptionScheduleService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + quote: str, + params: "QuotePreviewSubscriptionScheduleService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuotePreviewSubscriptionSchedule]: + """ + Preview the schedules that would be generated by accepting the quote + """ + return cast( + ListObject[QuotePreviewSubscriptionSchedule], + self._request( + "get", + "/v1/quotes/{quote}/preview_subscription_schedules".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + quote: str, + params: "QuotePreviewSubscriptionScheduleService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[QuotePreviewSubscriptionSchedule]: + """ + Preview the schedules that would be generated by accepting the quote + """ + return cast( + ListObject[QuotePreviewSubscriptionSchedule], + await self._request_async( + "get", + "/v1/quotes/{quote}/preview_subscription_schedules".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 018d88d69..8b5f56649 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -1,11 +1,17 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._invoice_line_item import InvoiceLineItem from stripe._list_object import ListObject from stripe._quote import Quote from stripe._quote_computed_upfront_line_items_service import ( QuoteComputedUpfrontLineItemsService, ) from stripe._quote_line_item_service import QuoteLineItemService +from stripe._quote_line_service import QuoteLineService +from stripe._quote_preview_invoice_service import QuotePreviewInvoiceService +from stripe._quote_preview_subscription_schedule_service import ( + QuotePreviewSubscriptionScheduleService, +) from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id @@ -16,6 +22,13 @@ class QuoteService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.preview_invoices = QuotePreviewInvoiceService(self._requestor) + self.preview_subscription_schedules = ( + QuotePreviewSubscriptionScheduleService( + self._requestor, + ) + ) + self.lines = QuoteLineService(self._requestor) self.line_items = QuoteLineItemService(self._requestor) self.computed_upfront_line_items = ( QuoteComputedUpfrontLineItemsService( @@ -36,6 +49,10 @@ class CancelParams(TypedDict): """ class CreateParams(TypedDict): + allow_backdated_lines: NotRequired[bool] + """ + Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + """ application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. @@ -58,6 +75,10 @@ class CreateParams(TypedDict): """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ + customer_account: NotRequired[str] + """ + The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed. + """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. @@ -102,6 +123,10 @@ class CreateParams(TypedDict): """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ + lines: NotRequired[List["QuoteService.CreateParamsLine"]] + """ + A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -116,6 +141,12 @@ class CreateParams(TypedDict): """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ + subscription_data_overrides: NotRequired[ + List["QuoteService.CreateParamsSubscriptionDataOverride"] + ] + """ + List representing overrides for `subscription_data` configurations for specific subscription schedules. + """ test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. @@ -158,11 +189,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "QuoteService.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] """ @@ -193,31 +256,183 @@ class CreateParamsInvoiceSettingsIssuer(TypedDict): Type of the account referenced in the request. """ - class CreateParamsLineItem(TypedDict): + class CreateParamsLine(TypedDict): + actions: NotRequired[List["QuoteService.CreateParamsLineAction"]] + """ + An array of operations the quote line performs. + """ + applies_to: NotRequired["QuoteService.CreateParamsLineAppliesTo"] + """ + Details to identify the subscription schedule the quote line applies to. + """ + billing_cycle_anchor: NotRequired[ + Literal["automatic", "line_starts_at"] + ] + """ + For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + """ + cancel_subscription_schedule: NotRequired[ + "QuoteService.CreateParamsLineCancelSubscriptionSchedule" + ] + """ + A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + """ + ends_at: NotRequired["QuoteService.CreateParamsLineEndsAt"] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + """ + set_pause_collection: NotRequired[ + "QuoteService.CreateParamsLineSetPauseCollection" + ] + """ + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. + """ + set_schedule_end: NotRequired[ + Literal["line_ends_at", "line_starts_at"] + ] + """ + Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + """ + starts_at: NotRequired["QuoteService.CreateParamsLineStartsAt"] + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + trial_settings: NotRequired[ + "QuoteService.CreateParamsLineTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class CreateParamsLineAction(TypedDict): + add_discount: NotRequired[ + "QuoteService.CreateParamsLineActionAddDiscount" + ] + """ + Details for the `add_discount` type. + """ + add_item: NotRequired["QuoteService.CreateParamsLineActionAddItem"] + """ + Details for the `add_item` type. + """ + add_metadata: NotRequired[Dict[str, str]] + """ + Details for the `add_metadata` type: specify a hash of key-value pairs. + """ + remove_discount: NotRequired[ + "QuoteService.CreateParamsLineActionRemoveDiscount" + ] + """ + Details for the `remove_discount` type. + """ + remove_item: NotRequired[ + "QuoteService.CreateParamsLineActionRemoveItem" + ] + """ + Details for the `remove_item` type. + """ + remove_metadata: NotRequired[List[str]] + """ + Details for the `remove_metadata` type: specify an array of metadata keys. + """ + set_discounts: NotRequired[ + List["QuoteService.CreateParamsLineActionSetDiscount"] + ] + """ + Details for the `set_discounts` type. + """ + set_items: NotRequired[ + List["QuoteService.CreateParamsLineActionSetItem"] + ] + """ + Details for the `set_items` type. + """ + set_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Details for the `set_metadata` type: specify an array of key-value pairs. + """ + type: Literal[ + "add_discount", + "add_item", + "add_metadata", + "clear_discounts", + "clear_metadata", + "remove_discount", + "remove_item", + "remove_metadata", + "set_discounts", + "set_items", + "set_metadata", + ] + """ + The type of action the quote line performs. + """ + + class CreateParamsLineActionAddDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "QuoteService.CreateParamsLineActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class CreateParamsLineActionAddDiscountDiscountEnd(TypedDict): + type: Literal["line_ends_at"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsLineActionAddItem(TypedDict): discounts: NotRequired[ - "Literal['']|List[QuoteService.CreateParamsLineItemDiscount]" + List["QuoteService.CreateParamsLineActionAddItemDiscount"] ] """ - The discounts applied to this line item. + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. """ - price: NotRequired[str] + metadata: NotRequired[Dict[str, str]] """ - The ID of the price object. One of `price` or `price_data` is required. + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - price_data: NotRequired["QuoteService.CreateParamsLineItemPriceData"] + price: str """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + The ID of the price object. """ quantity: NotRequired[int] """ - The quantity of the line item. + Quantity for this item. """ - tax_rates: NotRequired["Literal['']|List[str]"] + tax_rates: NotRequired[List[str]] """ - The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired["QuoteService.CreateParamsLineActionAddItemTrial"] + """ + Options that configure the trial on the subscription item. """ - class CreateParamsLineItemDiscount(TypedDict): + class CreateParamsLineActionAddItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. @@ -226,377 +441,2007 @@ class CreateParamsLineItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "QuoteService.CreateParamsLineActionAddItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ - class CreateParamsLineItemPriceData(TypedDict): - currency: str + class CreateParamsLineActionAddItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.CreateParamsLineActionAddItemDiscountDiscountEndDuration" + ] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Time span for the redeemed discount. """ - product: str + timestamp: NotRequired[int] """ - The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + A precise Unix timestamp for the discount to end. Must be in the future. """ - recurring: NotRequired[ - "QuoteService.CreateParamsLineItemPriceDataRecurring" - ] + type: Literal["duration", "timestamp"] """ - The recurring components of a price such as `interval` and `interval_count`. + The type of calculation made to determine when the discount ends. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] - ] + + class CreateParamsLineActionAddItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - unit_amount: NotRequired[int] + interval_count: int """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - unit_amount_decimal: NotRequired[str] + + class CreateParamsLineActionAddItemTrial(TypedDict): + converts_to: NotRequired[List[str]] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. """ - class CreateParamsLineItemPriceDataRecurring(TypedDict): - interval: Literal["day", "month", "week", "year"] + class CreateParamsLineActionRemoveDiscount(TypedDict): + coupon: NotRequired[str] """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. + The coupon code to remove from the `discounts` array. """ - interval_count: NotRequired[int] + discount: NotRequired[str] """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. """ - class CreateParamsSubscriptionData(TypedDict): - description: NotRequired[str] + class CreateParamsLineActionRemoveItem(TypedDict): + price: str """ - The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + ID of a price to remove. """ - effective_date: NotRequired[ - "Literal['']|Literal['current_period_end']|int" - ] + + class CreateParamsLineActionSetDiscount(TypedDict): + coupon: NotRequired[str] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + The coupon code to replace the `discounts` array with. """ - metadata: NotRequired[Dict[str, str]] + discount: NotRequired[str] """ - Set of [key-value pairs](https://stripe.com/docs/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. + An ID of an existing discount to replace the `discounts` array with. """ - trial_period_days: NotRequired["Literal['']|int"] + promotion_code: NotRequired[str] """ - Integer representing the number of trial period days before the customer is charged for the first time. + An ID of an existing promotion code to replace the `discounts` array with. """ - class CreateParamsTransferData(TypedDict): - amount: NotRequired[int] + class CreateParamsLineActionSetItem(TypedDict): + discounts: NotRequired[ + List["QuoteService.CreateParamsLineActionSetItemDiscount"] + ] """ - The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. """ - amount_percent: NotRequired[float] + metadata: NotRequired[Dict[str, str]] """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. """ - destination: str + price: str """ - ID of an existing, connected Stripe account. + The ID of the price object. """ - - class FinalizeQuoteParams(TypedDict): - expand: NotRequired[List[str]] + quantity: NotRequired[int] """ - Specifies which fields in the response should be expanded. + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. """ - expires_at: NotRequired[int] + tax_rates: NotRequired[List[str]] """ - A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired["QuoteService.CreateParamsLineActionSetItemTrial"] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ - class ListParams(TypedDict): - customer: NotRequired[str] + class CreateParamsLineActionSetItemDiscount(TypedDict): + coupon: NotRequired[str] """ - The ID of the customer whose quotes will be retrieved. + ID of the coupon to create a new discount for. """ - ending_before: NotRequired[str] + discount: 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. + ID of an existing discount on the object (or one of its ancestors) to reuse. """ - expand: NotRequired[List[str]] + discount_end: NotRequired[ + "QuoteService.CreateParamsLineActionSetItemDiscountDiscountEnd" + ] """ - Specifies which fields in the response should be expanded. + Details to determine how long the discount should be applied for. """ - limit: NotRequired[int] + promotion_code: NotRequired[str] """ - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + ID of the promotion code to create a new discount for. """ - starting_after: NotRequired[str] + + class CreateParamsLineActionSetItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.CreateParamsLineActionSetItemDiscountDiscountEndDuration" + ] """ - 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. + Time span for the redeemed discount. """ - status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] + timestamp: NotRequired[int] """ - The status of the quote. + A precise Unix timestamp for the discount to end. Must be in the future. """ - test_clock: NotRequired[str] + type: Literal["duration", "timestamp"] """ - Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. + The type of calculation made to determine when the discount ends. """ - class PdfParams(TypedDict): - expand: NotRequired[List[str]] + class CreateParamsLineActionSetItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] """ - Specifies which fields in the response should be expanded. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - - class RetrieveParams(TypedDict): - expand: NotRequired[List[str]] + interval_count: int """ - Specifies which fields in the response should be expanded. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - class UpdateParams(TypedDict): - application_fee_amount: NotRequired["Literal['']|int"] + class CreateParamsLineActionSetItemTrial(TypedDict): + converts_to: NotRequired[List[str]] """ - The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. """ - application_fee_percent: NotRequired["Literal['']|float"] + type: Literal["free", "paid"] """ - A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + Determines the type of trial for this item. """ - automatic_tax: NotRequired["QuoteService.UpdateParamsAutomaticTax"] + + class CreateParamsLineAppliesTo(TypedDict): + new_reference: NotRequired[str] """ - Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. """ - collection_method: NotRequired[ - Literal["charge_automatically", "send_invoice"] - ] + subscription_schedule: NotRequired[str] """ - Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + The ID of the schedule the line applies to. """ - customer: NotRequired[str] + type: Literal["new_reference", "subscription_schedule"] """ - The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + Describes whether the quote line is affecting a new schedule or an existing schedule. """ - default_tax_rates: NotRequired["Literal['']|List[str]"] + + class CreateParamsLineCancelSubscriptionSchedule(TypedDict): + cancel_at: Literal["line_starts_at"] """ - The tax rates that will apply to any line item that does not have `tax_rates` set. + Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. """ - description: NotRequired["Literal['']|str"] + invoice_now: NotRequired[bool] """ - A description that will be displayed on the quote PDF. + If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. """ - discounts: NotRequired[ - "Literal['']|List[QuoteService.UpdateParamsDiscount]" + prorate: NotRequired[bool] + """ + If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + """ + + class CreateParamsLineEndsAt(TypedDict): + discount_end: NotRequired[ + "QuoteService.CreateParamsLineEndsAtDiscountEnd" ] """ - The discounts applied to the quote. + Use the `end` time of a given discount. """ - expand: NotRequired[List[str]] + duration: NotRequired["QuoteService.CreateParamsLineEndsAtDuration"] """ - Specifies which fields in the response should be expanded. + Time span for the quote line starting from the `starts_at` date. """ - expires_at: NotRequired[int] + timestamp: NotRequired[int] """ - A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + A precise Unix timestamp. """ - footer: NotRequired["Literal['']|str"] + type: Literal[ + "billing_period_end", + "discount_end", + "duration", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] """ - A footer that will be displayed on the quote PDF. + Select a way to pass in `ends_at`. """ - header: NotRequired["Literal['']|str"] + + class CreateParamsLineEndsAtDiscountEnd(TypedDict): + discount: str """ - A header that will be displayed on the quote PDF. + The ID of a specific discount. + """ + + class CreateParamsLineEndsAtDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[QuoteService.CreateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["QuoteService.CreateParamsLineItemPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + """ + + class CreateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "QuoteService.CreateParamsLineItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreateParamsLineItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.CreateParamsLineItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsLineItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsLineItemPriceData(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: str + """ + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + """ + recurring: NotRequired[ + "QuoteService.CreateParamsLineItemPriceDataRecurring" + ] + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class CreateParamsLineItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class CreateParamsLineSetPauseCollection(TypedDict): + set: NotRequired["QuoteService.CreateParamsLineSetPauseCollectionSet"] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class CreateParamsLineSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class CreateParamsLineStartsAt(TypedDict): + discount_end: NotRequired[ + "QuoteService.CreateParamsLineStartsAtDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + line_ends_at: NotRequired[ + "QuoteService.CreateParamsLineStartsAtLineEndsAt" + ] + """ + The timestamp the given line ends at. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "discount_end", + "line_ends_at", + "now", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `starts_at`. + """ + + class CreateParamsLineStartsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class CreateParamsLineStartsAtLineEndsAt(TypedDict): + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsLineTrialSettings(TypedDict): + end_behavior: NotRequired[ + "QuoteService.CreateParamsLineTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreateParamsLineTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreateParamsSubscriptionData(TypedDict): + bill_on_acceptance: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_cycle_anchor: NotRequired["Literal['']|Literal['reset']"] + """ + When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + description: NotRequired[str] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + effective_date: NotRequired[ + "Literal['']|Literal['current_period_end']|int" + ] + """ + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + from_subscription: NotRequired[str] + """ + The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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. + """ + prebilling: NotRequired[ + "Literal['']|QuoteService.CreateParamsSubscriptionDataPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillFrom(TypedDict): + line_starts_at: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntil(TypedDict): + duration: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataOverride(TypedDict): + applies_to: ( + "QuoteService.CreateParamsSubscriptionDataOverrideAppliesTo" + ) + """ + Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule. + """ + bill_on_acceptance: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + customer: NotRequired[str] + """ + The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`. + """ + description: NotRequired[str] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + + class CreateParamsSubscriptionDataOverrideAppliesTo(TypedDict): + new_reference: NotRequired[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: NotRequired[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom( + TypedDict, + ): + line_starts_at: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt" + ] + """ + Details of a Quote line to start the bill period from. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] + """ + The type of method to specify the `bill_from` time. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil( + TypedDict, + ): + duration: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration" + ] + """ + Details of the duration over which to bill. + """ + line_ends_at: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt" + ] + """ + Details of a Quote line item from which to bill until. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + The type of method to specify the `bill_until` time. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class CreateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class CreateParamsSubscriptionDataPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + + class CreateParamsTransferData(TypedDict): + amount: NotRequired[int] + """ + The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + """ + amount_percent: NotRequired[float] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + """ + destination: str + """ + ID of an existing, connected Stripe account. + """ + + class FinalizeQuoteParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + """ + + class ListParams(TypedDict): + customer: NotRequired[str] + """ + The ID of the customer whose quotes will be retrieved. + """ + customer_account: NotRequired[str] + """ + The ID of the account whose quotes will be retrieved. + """ + 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. + """ + from_subscription: NotRequired[str] + """ + The subscription which the quote updates. + """ + 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. + """ + status: NotRequired[ + Literal[ + "accepted", "accepting", "canceled", "draft", "open", "stale" + ] + ] + """ + The status of the quote. + """ + test_clock: NotRequired[str] + """ + Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. + """ + + class ListPreviewInvoiceLinesParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + class MarkDraftParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MarkStaleParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + reason: NotRequired[str] + """ + Reason the Quote is being marked stale. + """ + + class PdfParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ReestimateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + allow_backdated_lines: NotRequired[bool] + """ + Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + """ + application_fee_percent: NotRequired["Literal['']|float"] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + """ + automatic_tax: NotRequired["QuoteService.UpdateParamsAutomaticTax"] + """ + Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + """ + collection_method: NotRequired[ + Literal["charge_automatically", "send_invoice"] + ] + """ + Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + """ + customer: NotRequired[str] + """ + The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + """ + customer_account: NotRequired[str] + """ + The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed. + """ + default_tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates that will apply to any line item that does not have `tax_rates` set. + """ + description: NotRequired["Literal['']|str"] + """ + A description that will be displayed on the quote PDF. + """ + discounts: NotRequired[ + "Literal['']|List[QuoteService.UpdateParamsDiscount]" + ] + """ + The discounts applied to the quote. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + expires_at: NotRequired[int] + """ + A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + """ + footer: NotRequired["Literal['']|str"] + """ + A footer that will be displayed on the quote PDF. + """ + header: NotRequired["Literal['']|str"] + """ + A header that will be displayed on the quote PDF. + """ + invoice_settings: NotRequired[ + "QuoteService.UpdateParamsInvoiceSettings" + ] + """ + All invoices will be billed using the specified settings. + """ + line_items: NotRequired[List["QuoteService.UpdateParamsLineItem"]] + """ + A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + """ + lines: NotRequired[List["QuoteService.UpdateParamsLine"]] + """ + A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account on behalf of which to charge. + """ + subscription_data: NotRequired[ + "QuoteService.UpdateParamsSubscriptionData" + ] + """ + When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + """ + subscription_data_overrides: NotRequired[ + "Literal['']|List[QuoteService.UpdateParamsSubscriptionDataOverride]" + ] + """ + List representing overrides for `subscription_data` configurations for specific subscription schedules. + """ + transfer_data: NotRequired[ + "Literal['']|QuoteService.UpdateParamsTransferData" + ] + """ + The data with which to automatically create a Transfer for each of the invoices. + """ + + class UpdateParamsAutomaticTax(TypedDict): + enabled: bool + """ + Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + """ + liability: NotRequired[ + "QuoteService.UpdateParamsAutomaticTaxLiability" + ] + """ + The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + """ + + class UpdateParamsAutomaticTaxLiability(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpdateParamsDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "QuoteService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class UpdateParamsInvoiceSettings(TypedDict): + days_until_due: NotRequired[int] + """ + Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + """ + issuer: NotRequired["QuoteService.UpdateParamsInvoiceSettingsIssuer"] + """ + The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + """ + + class UpdateParamsInvoiceSettingsIssuer(TypedDict): + account: NotRequired[str] + """ + The connected account being referenced when `type` is `account`. + """ + type: Literal["account", "self"] + """ + Type of the account referenced in the request. + """ + + class UpdateParamsLine(TypedDict): + actions: NotRequired[List["QuoteService.UpdateParamsLineAction"]] + """ + An array of operations the quote line performs. + """ + applies_to: NotRequired["QuoteService.UpdateParamsLineAppliesTo"] + """ + Details to identify the subscription schedule the quote line applies to. + """ + billing_cycle_anchor: NotRequired[ + Literal["automatic", "line_starts_at"] + ] + """ + For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + """ + cancel_subscription_schedule: NotRequired[ + "QuoteService.UpdateParamsLineCancelSubscriptionSchedule" + ] + """ + A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + """ + ends_at: NotRequired["QuoteService.UpdateParamsLineEndsAt"] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + """ + id: NotRequired[str] + """ + The ID of an existing line on the quote. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + """ + set_pause_collection: NotRequired[ + "QuoteService.UpdateParamsLineSetPauseCollection" + ] + """ + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. + """ + set_schedule_end: NotRequired[ + Literal["line_ends_at", "line_starts_at"] + ] + """ + Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + """ + starts_at: NotRequired["QuoteService.UpdateParamsLineStartsAt"] + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + trial_settings: NotRequired[ + "QuoteService.UpdateParamsLineTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class UpdateParamsLineAction(TypedDict): + add_discount: NotRequired[ + "QuoteService.UpdateParamsLineActionAddDiscount" + ] + """ + Details for the `add_discount` type. + """ + add_item: NotRequired["QuoteService.UpdateParamsLineActionAddItem"] + """ + Details for the `add_item` type. + """ + add_metadata: NotRequired[Dict[str, str]] + """ + Details for the `add_metadata` type: specify a hash of key-value pairs. + """ + remove_discount: NotRequired[ + "QuoteService.UpdateParamsLineActionRemoveDiscount" + ] + """ + Details for the `remove_discount` type. + """ + remove_item: NotRequired[ + "QuoteService.UpdateParamsLineActionRemoveItem" + ] + """ + Details for the `remove_item` type. + """ + remove_metadata: NotRequired[List[str]] + """ + Details for the `remove_metadata` type: specify an array of metadata keys. + """ + set_discounts: NotRequired[ + List["QuoteService.UpdateParamsLineActionSetDiscount"] + ] + """ + Details for the `set_discounts` type. + """ + set_items: NotRequired[ + List["QuoteService.UpdateParamsLineActionSetItem"] + ] + """ + Details for the `set_items` type. + """ + set_metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Details for the `set_metadata` type: specify an array of key-value pairs. + """ + type: Literal[ + "add_discount", + "add_item", + "add_metadata", + "clear_discounts", + "clear_metadata", + "remove_discount", + "remove_item", + "remove_metadata", + "set_discounts", + "set_items", + "set_metadata", + ] + """ + The type of action the quote line performs. + """ + + class UpdateParamsLineActionAddDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class UpdateParamsLineActionAddDiscountDiscountEnd(TypedDict): + type: Literal["line_ends_at"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsLineActionAddItem(TypedDict): + discounts: NotRequired[ + List["QuoteService.UpdateParamsLineActionAddItemDiscount"] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired["QuoteService.UpdateParamsLineActionAddItemTrial"] + """ + Options that configure the trial on the subscription item. + """ + + class UpdateParamsLineActionAddItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineActionAddItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateParamsLineActionAddItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.UpdateParamsLineActionAddItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsLineActionAddItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class UpdateParamsLineActionAddItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class UpdateParamsLineActionRemoveDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class UpdateParamsLineActionRemoveItem(TypedDict): + price: str + """ + ID of a price to remove. + """ + + class UpdateParamsLineActionSetDiscount(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class UpdateParamsLineActionSetItem(TypedDict): + discounts: NotRequired[ + List["QuoteService.UpdateParamsLineActionSetItemDiscount"] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired["QuoteService.UpdateParamsLineActionSetItemTrial"] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class UpdateParamsLineActionSetItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineActionSetItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateParamsLineActionSetItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.UpdateParamsLineActionSetItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsLineActionSetItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class UpdateParamsLineActionSetItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class UpdateParamsLineAppliesTo(TypedDict): + new_reference: NotRequired[str] + """ + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + """ + subscription_schedule: NotRequired[str] + """ + The ID of the schedule the line applies to. + """ + type: Literal["new_reference", "subscription_schedule"] + """ + Describes whether the quote line is affecting a new schedule or an existing schedule. + """ + + class UpdateParamsLineCancelSubscriptionSchedule(TypedDict): + cancel_at: Literal["line_starts_at"] + """ + Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + """ + invoice_now: NotRequired[bool] + """ + If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + """ + prorate: NotRequired[bool] + """ + If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + """ + + class UpdateParamsLineEndsAt(TypedDict): + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineEndsAtDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + duration: NotRequired["QuoteService.UpdateParamsLineEndsAtDuration"] + """ + Time span for the quote line starting from the `starts_at` date. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "billing_period_end", + "discount_end", + "duration", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `ends_at`. + """ + + class UpdateParamsLineEndsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class UpdateParamsLineEndsAtDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class UpdateParamsLineItem(TypedDict): + discounts: NotRequired[ + "Literal['']|List[QuoteService.UpdateParamsLineItemDiscount]" + ] + """ + The discounts applied to this line item. + """ + id: NotRequired[str] + """ + The ID of an existing line item on the quote. + """ + price: NotRequired[str] + """ + The ID of the price object. One of `price` or `price_data` is required. + """ + price_data: NotRequired["QuoteService.UpdateParamsLineItemPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + The quantity of the line item. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + """ + + class UpdateParamsLineItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class UpdateParamsLineItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "QuoteService.UpdateParamsLineItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsLineItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class UpdateParamsLineItemPriceData(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: str + """ + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + """ + recurring: NotRequired[ + "QuoteService.UpdateParamsLineItemPriceDataRecurring" + ] + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateParamsLineItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + + class UpdateParamsLineSetPauseCollection(TypedDict): + set: NotRequired["QuoteService.UpdateParamsLineSetPauseCollectionSet"] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class UpdateParamsLineSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class UpdateParamsLineStartsAt(TypedDict): + discount_end: NotRequired[ + "QuoteService.UpdateParamsLineStartsAtDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + line_ends_at: NotRequired[ + "QuoteService.UpdateParamsLineStartsAtLineEndsAt" + ] + """ + The timestamp the given line ends at. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp. + """ + type: Literal[ + "discount_end", + "line_ends_at", + "now", + "quote_acceptance_date", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] + """ + Select a way to pass in `starts_at`. + """ + + class UpdateParamsLineStartsAtDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class UpdateParamsLineStartsAtLineEndsAt(TypedDict): + id: NotRequired[str] + """ + The ID of a quote line. + """ + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class UpdateParamsLineTrialSettings(TypedDict): + end_behavior: NotRequired[ + "QuoteService.UpdateParamsLineTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class UpdateParamsLineTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class UpdateParamsSubscriptionData(TypedDict): + bill_on_acceptance: NotRequired[ + "Literal['']|QuoteService.UpdateParamsSubscriptionDataBillOnAcceptance" + ] + """ + Describes the period to bill for upon accepting the quote. + """ + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_cycle_anchor: NotRequired["Literal['']|Literal['reset']"] + """ + When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. + """ + description: NotRequired["Literal['']|str"] + """ + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + """ + effective_date: NotRequired[ + "Literal['']|Literal['current_period_end']|int" + ] + """ + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + """ + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/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. + """ + prebilling: NotRequired[ + "Literal['']|QuoteService.UpdateParamsSubscriptionDataPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. + """ + trial_period_days: NotRequired["Literal['']|int"] + """ + Integer representing the number of trial period days before the customer is charged for the first time. + """ + + class UpdateParamsSubscriptionDataBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataBillOnAcceptanceBillFrom" + ] + """ + The start of the period to bill from when the Quote is accepted. + """ + bill_until: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataBillOnAcceptanceBillUntil" + ] + """ + The end of the period to bill until when the Quote is accepted. """ - invoice_settings: NotRequired[ - "QuoteService.UpdateParamsInvoiceSettings" + + class UpdateParamsSubscriptionDataBillOnAcceptanceBillFrom(TypedDict): + line_starts_at: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt" ] """ - All invoices will be billed using the specified settings. + Details of a Quote line to start the bill period from. """ - line_items: NotRequired[List["QuoteService.UpdateParamsLineItem"]] + timestamp: NotRequired[int] """ - A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + A precise Unix timestamp. """ - metadata: NotRequired[Dict[str, str]] + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] """ - Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + The type of method to specify the `bill_from` time. """ - on_behalf_of: NotRequired["Literal['']|str"] + + class UpdateParamsSubscriptionDataBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] """ - The account on behalf of which to charge. + The ID of a quote line. """ - subscription_data: NotRequired[ - "QuoteService.UpdateParamsSubscriptionData" + index: NotRequired[int] + """ + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. + """ + + class UpdateParamsSubscriptionDataBillOnAcceptanceBillUntil(TypedDict): + duration: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration" ] """ - When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + Details of the duration over which to bill. """ - transfer_data: NotRequired[ - "Literal['']|QuoteService.UpdateParamsTransferData" + line_ends_at: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt" ] """ - The data with which to automatically create a Transfer for each of the invoices. + Details of a Quote line item from which to bill until. """ - - class UpdateParamsAutomaticTax(TypedDict): - enabled: bool + timestamp: NotRequired[int] """ - Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + A precise Unix timestamp. """ - liability: NotRequired[ - "QuoteService.UpdateParamsAutomaticTaxLiability" + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", ] """ - The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + The type of method to specify the `bill_until` time. """ - class UpdateParamsAutomaticTaxLiability(TypedDict): - account: NotRequired[str] + class UpdateParamsSubscriptionDataBillOnAcceptanceBillUntilDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] """ - The connected account being referenced when `type` is `account`. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - type: Literal["account", "self"] + interval_count: int """ - Type of the account referenced in the request. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - class UpdateParamsDiscount(TypedDict): - coupon: NotRequired[str] + class UpdateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] """ - ID of the coupon to create a new discount for. + The ID of a quote line. """ - discount: NotRequired[str] + index: NotRequired[int] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. """ - promotion_code: NotRequired[str] + + class UpdateParamsSubscriptionDataOverride(TypedDict): + applies_to: ( + "QuoteService.UpdateParamsSubscriptionDataOverrideAppliesTo" + ) """ - ID of the promotion code to create a new discount for. + Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule. """ - - class UpdateParamsInvoiceSettings(TypedDict): - days_until_due: NotRequired[int] + bill_on_acceptance: NotRequired[ + "Literal['']|QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptance" + ] """ - Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + Describes the period to bill for upon accepting the quote. """ - issuer: NotRequired["QuoteService.UpdateParamsInvoiceSettingsIssuer"] + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] """ - The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - - class UpdateParamsInvoiceSettingsIssuer(TypedDict): - account: NotRequired[str] + customer: NotRequired[str] """ - The connected account being referenced when `type` is `account`. + The customer the Subscription Data override applies to. """ - type: Literal["account", "self"] + description: NotRequired["Literal['']|str"] """ - Type of the account referenced in the request. + The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ - - class UpdateParamsLineItem(TypedDict): - discounts: NotRequired[ - "Literal['']|List[QuoteService.UpdateParamsLineItemDiscount]" + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] ] """ - The discounts applied to this line item. + Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`. + + When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`. + + Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`. + + Prorations can be disabled by passing `none`. """ - id: NotRequired[str] + + class UpdateParamsSubscriptionDataOverrideAppliesTo(TypedDict): + new_reference: NotRequired[str] """ - The ID of an existing line item on the quote. + A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. """ - price: NotRequired[str] + subscription_schedule: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. + The ID of the schedule the line applies to. """ - price_data: NotRequired["QuoteService.UpdateParamsLineItemPriceData"] + type: Literal["new_reference", "subscription_schedule"] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + Describes whether the quote line is affecting a new schedule or an existing schedule. """ - quantity: NotRequired[int] + + class UpdateParamsSubscriptionDataOverrideBillOnAcceptance(TypedDict): + bill_from: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom" + ] """ - The quantity of the line item. + The start of the period to bill from when the Quote is accepted. """ - tax_rates: NotRequired["Literal['']|List[str]"] + bill_until: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil" + ] """ - The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + The end of the period to bill until when the Quote is accepted. """ - class UpdateParamsLineItemDiscount(TypedDict): - coupon: NotRequired[str] + class UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillFrom( + TypedDict, + ): + line_starts_at: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt" + ] """ - ID of the coupon to create a new discount for. + Details of a Quote line to start the bill period from. """ - discount: NotRequired[str] + timestamp: NotRequired[int] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + A precise Unix timestamp. """ - promotion_code: NotRequired[str] + type: Literal[ + "line_starts_at", + "now", + "pause_collection_start", + "quote_acceptance_date", + "timestamp", + ] """ - ID of the promotion code to create a new discount for. + The type of method to specify the `bill_from` time. """ - class UpdateParamsLineItemPriceData(TypedDict): - currency: str + class UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillFromLineStartsAt( + TypedDict, + ): + id: NotRequired[str] """ - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + The ID of a quote line. """ - product: str + index: NotRequired[int] """ - The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. """ - recurring: NotRequired[ - "QuoteService.UpdateParamsLineItemPriceDataRecurring" + + class UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntil( + TypedDict, + ): + duration: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration" ] """ - The recurring components of a price such as `interval` and `interval_count`. + Details of the duration over which to bill. """ - tax_behavior: NotRequired[ - Literal["exclusive", "inclusive", "unspecified"] + line_ends_at: NotRequired[ + "QuoteService.UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt" ] """ - Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + Details of a Quote line item from which to bill until. """ - unit_amount: NotRequired[int] + timestamp: NotRequired[int] """ - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + A precise Unix timestamp. """ - unit_amount_decimal: NotRequired[str] + type: Literal[ + "duration", + "line_ends_at", + "schedule_end", + "timestamp", + "upcoming_invoice", + ] """ - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + The type of method to specify the `bill_until` time. """ - class UpdateParamsLineItemPriceDataRecurring(TypedDict): + class UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilDuration( + TypedDict, + ): interval: Literal["day", "month", "week", "year"] """ - Specifies billing frequency. Either `day`, `week`, `month` or `year`. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - interval_count: NotRequired[int] + interval_count: int """ - The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ - class UpdateParamsSubscriptionData(TypedDict): - description: NotRequired["Literal['']|str"] - """ - The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - """ - effective_date: NotRequired[ - "Literal['']|Literal['current_period_end']|int" - ] + class UpdateParamsSubscriptionDataOverrideBillOnAcceptanceBillUntilLineEndsAt( + TypedDict, + ): + id: NotRequired[str] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + The ID of a quote line. """ - metadata: NotRequired[Dict[str, str]] + index: NotRequired[int] """ - Set of [key-value pairs](https://stripe.com/docs/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. + The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. """ - trial_period_days: NotRequired["Literal['']|int"] + + class UpdateParamsSubscriptionDataPrebilling(TypedDict): + iterations: int """ - Integer representing the number of trial period days before the customer is charged for the first time. + This is used to determine the number of billing cycles to prebill. """ class UpdateParamsTransferData(TypedDict): @@ -889,6 +2734,138 @@ async def finalize_quote_async( ), ) + def mark_draft( + self, + quote: str, + params: "QuoteService.MarkDraftParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Converts a stale quote to draft. + """ + return cast( + Quote, + self._request( + "post", + "/v1/quotes/{quote}/mark_draft".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def mark_draft_async( + self, + quote: str, + params: "QuoteService.MarkDraftParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Converts a stale quote to draft. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/mark_draft".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def mark_stale( + self, + quote: str, + params: "QuoteService.MarkStaleParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Converts a draft or open quote to stale. + """ + return cast( + Quote, + self._request( + "post", + "/v1/quotes/{quote}/mark_stale".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def mark_stale_async( + self, + quote: str, + params: "QuoteService.MarkStaleParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Converts a draft or open quote to stale. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/mark_stale".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def reestimate( + self, + quote: str, + params: "QuoteService.ReestimateParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + Quote, + self._request( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def reestimate_async( + self, + quote: str, + params: "QuoteService.ReestimateParams" = {}, + options: RequestOptions = {}, + ) -> Quote: + """ + Recompute the upcoming invoice estimate for the quote. + """ + return cast( + Quote, + await self._request_async( + "post", + "/v1/quotes/{quote}/reestimate".format( + quote=sanitize_id(quote), + ), + base_address="api", + params=params, + options=options, + ), + ) + def pdf( self, quote: str, @@ -928,3 +2905,51 @@ async def pdf_async( options=options, ), ) + + def list_preview_invoice_lines( + self, + quote: str, + preview_invoice: str, + params: "QuoteService.ListPreviewInvoiceLinesParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceLineItem]: + """ + Preview the invoice line items that would be generated by accepting the quote. + """ + return cast( + ListObject[InvoiceLineItem], + self._request( + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(quote), + preview_invoice=sanitize_id(preview_invoice), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_preview_invoice_lines_async( + self, + quote: str, + preview_invoice: str, + params: "QuoteService.ListPreviewInvoiceLinesParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InvoiceLineItem]: + """ + Preview the invoice line items that would be generated by accepting the quote. + """ + return cast( + ListObject[InvoiceLineItem], + await self._request_async( + "get", + "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( + quote=sanitize_id(quote), + preview_invoice=sanitize_id(preview_invoice), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_refund.py b/stripe/_refund.py index 37044b0be..c2e6602e6 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -137,6 +137,16 @@ class Giropay(StripeObject): class Grabpay(StripeObject): pass + class IdBankTransfer(StripeObject): + reference: Optional[str] + """ + The reference assigned to the refund. + """ + reference_status: Optional[str] + """ + Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + """ + class JpBankTransfer(StripeObject): reference: Optional[str] """ @@ -257,6 +267,7 @@ class Zip(StripeObject): gb_bank_transfer: Optional[GbBankTransfer] giropay: Optional[Giropay] grabpay: Optional[Grabpay] + id_bank_transfer: Optional[IdBankTransfer] jp_bank_transfer: Optional[JpBankTransfer] klarna: Optional[Klarna] multibanco: Optional[Multibanco] @@ -294,6 +305,7 @@ class Zip(StripeObject): "gb_bank_transfer": GbBankTransfer, "giropay": Giropay, "grabpay": Grabpay, + "id_bank_transfer": IdBankTransfer, "jp_bank_transfer": JpBankTransfer, "klarna": Klarna, "multibanco": Multibanco, diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index e80374a63..d97411cf8 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -263,6 +263,24 @@ class Offline(StripeObject): class Cashapp(StripeObject): pass + class IdBankTransfer(StripeObject): + bank: Optional[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is located. + """ + bank_code: Optional[str] + """ + Local bank code of the bank. + """ + bank_name: Optional[str] + """ + Name of the bank associated with the bank account. + """ + display_name: Optional[str] + """ + Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + """ + class Ideal(StripeObject): bank: Optional[ Literal[ @@ -353,6 +371,9 @@ class NzBankAccount(StripeObject): class Paypal(StripeObject): pass + class Payto(StripeObject): + pass + class RevolutPay(StripeObject): pass @@ -395,6 +416,9 @@ class Sofort(StripeObject): (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + class StripeBalance(StripeObject): + pass + class UsBankAccount(StripeObject): pass @@ -407,6 +431,7 @@ class UsBankAccount(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + id_bank_transfer: Optional[IdBankTransfer] ideal: Optional[Ideal] kakao_pay: Optional[KakaoPay] klarna: Optional[Klarna] @@ -415,9 +440,11 @@ class UsBankAccount(StripeObject): naver_pay: Optional[NaverPay] nz_bank_account: Optional[NzBankAccount] paypal: Optional[Paypal] + payto: Optional[Payto] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + stripe_balance: Optional[StripeBalance] type: str """ The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. @@ -433,6 +460,7 @@ class UsBankAccount(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "id_bank_transfer": IdBankTransfer, "ideal": Ideal, "kakao_pay": KakaoPay, "klarna": Klarna, @@ -441,9 +469,11 @@ class UsBankAccount(StripeObject): "naver_pay": NaverPay, "nz_bank_account": NzBankAccount, "paypal": Paypal, + "payto": Payto, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, + "stripe_balance": StripeBalance, "us_bank_account": UsBankAccount, } @@ -506,6 +536,7 @@ class SetupError(StripeObject): "email_invalid", "expired_card", "financial_connections_account_inactive", + "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", @@ -602,6 +633,7 @@ class SetupError(StripeObject): "return_intent_already_processed", "routing_number_invalid", "secret_key_required", + "sensitive_data_access_expired", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", @@ -621,6 +653,7 @@ class SetupError(StripeObject): "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", + "terminal_reader_collected_data_invalid", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", @@ -634,6 +667,8 @@ class SetupError(StripeObject): "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", + "v2_account_disconnection_unsupported", + "v2_account_missing_configuration", ] ] """ @@ -795,6 +830,10 @@ class ListParamsCreated(TypedDict): """ The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. """ + customer_account: Optional[str] + """ + The value of [customer_account](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer_account) on the SetupIntent at the time of this confirmation. + """ flow_directions: Optional[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 080caf3ba..e3775427f 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -132,6 +132,7 @@ class LastSetupError(StripeObject): "email_invalid", "expired_card", "financial_connections_account_inactive", + "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", @@ -228,6 +229,7 @@ class LastSetupError(StripeObject): "return_intent_already_processed", "routing_number_invalid", "secret_key_required", + "sensitive_data_access_expired", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", @@ -247,6 +249,7 @@ class LastSetupError(StripeObject): "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", + "terminal_reader_collected_data_invalid", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", @@ -260,6 +263,8 @@ class LastSetupError(StripeObject): "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", + "v2_account_disconnection_unsupported", + "v2_account_missing_configuration", ] ] """ @@ -577,6 +582,73 @@ class Paypal(StripeObject): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: Optional[str] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + subsellers: Optional[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class Payto(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Optional[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: Optional[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} class SepaDebit(StripeObject): class MandateOptions(StripeObject): @@ -597,8 +669,19 @@ class Filters(StripeObject): """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ + + class ManualEntry(StripeObject): + mode: Optional[Literal["automatic", "custom"]] + """ + Settings for configuring manual entry of account details. + """ filters: Optional[Filters] + manual_entry: Optional[ManualEntry] permissions: Optional[ List[ Literal[ @@ -613,7 +696,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -622,7 +712,10 @@ class Filters(StripeObject): """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ - _inner_class_types = {"filters": Filters} + _inner_class_types = { + "filters": Filters, + "manual_entry": ManualEntry, + } class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] @@ -650,6 +743,7 @@ class MandateOptions(StripeObject): card_present: Optional[CardPresent] link: Optional[Link] paypal: Optional[Paypal] + payto: Optional[Payto] sepa_debit: Optional[SepaDebit] us_bank_account: Optional[UsBankAccount] _inner_class_types = { @@ -660,6 +754,7 @@ class MandateOptions(StripeObject): "card_present": CardPresent, "link": Link, "paypal": Paypal, + "payto": Payto, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } @@ -860,12 +955,22 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -902,6 +1007,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -956,6 +1065,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -966,12 +1079,22 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataRevolutPay" ] @@ -996,10 +1119,22 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -1026,13 +1161,16 @@ class ConfirmParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -1043,13 +1181,18 @@ class ConfirmParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -1269,9 +1412,18 @@ class ConfirmParamsPaymentMethodDataFpx(TypedDict): class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass + class ConfirmParamsPaymentMethodDataGopay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -1332,6 +1484,9 @@ class ConfirmParamsPaymentMethodDataKrCard(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMbWay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -1417,18 +1572,55 @@ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass + class ConfirmParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataQris(TypedDict): + pass + class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class ConfirmParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntent.ConfirmParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class ConfirmParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -1444,12 +1636,25 @@ class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class ConfirmParamsPaymentMethodDataShopeepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass @@ -1523,6 +1728,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" ] @@ -1776,6 +1987,74 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class ConfirmParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -1826,6 +2105,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -1837,7 +2122,14 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1856,6 +2148,18 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -1900,6 +2204,12 @@ class CreateParams(RequestOptions): If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ + customer_account: NotRequired[str] + """ + ID of the Account this SetupIntent belongs to, if one exists. + + If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -2126,12 +2436,22 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["SetupIntent.CreateParamsPaymentMethodDataGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.CreateParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -2166,6 +2486,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["SetupIntent.CreateParamsPaymentMethodDataMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -2220,6 +2544,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -2230,12 +2558,22 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["SetupIntent.CreateParamsPaymentMethodDataQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataRevolutPay" ] @@ -2260,10 +2598,22 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired["SetupIntent.CreateParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["SetupIntent.CreateParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -2290,13 +2640,16 @@ class CreateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -2307,13 +2660,18 @@ class CreateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -2533,9 +2891,18 @@ class CreateParamsPaymentMethodDataFpx(TypedDict): class CreateParamsPaymentMethodDataGiropay(TypedDict): pass + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2596,6 +2963,9 @@ class CreateParamsPaymentMethodDataKrCard(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -2681,18 +3051,55 @@ class CreateParamsPaymentMethodDataPaynow(TypedDict): class CreateParamsPaymentMethodDataPaypal(TypedDict): pass + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntent.CreateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -2708,12 +3115,25 @@ class CreateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsPaymentMethodDataSwish(TypedDict): pass @@ -2787,6 +3207,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsPayto"] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -3040,6 +3464,74 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -3090,6 +3582,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -3101,7 +3599,14 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -3120,6 +3625,18 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -3160,6 +3677,10 @@ class ListParams(RequestOptions): """ Only return SetupIntents for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return SetupIntents for the account specified by this customer ID. + """ 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. @@ -3212,6 +3733,12 @@ class ModifyParams(RequestOptions): If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ + customer_account: NotRequired[str] + """ + ID of the Account this SetupIntent belongs to, if one exists. + + If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -3355,12 +3882,22 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataGopay"] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. @@ -3395,6 +3932,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataMbWay"] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -3449,6 +3990,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPayto"] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -3459,12 +4004,22 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataQris"] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataRevolutPay" ] @@ -3489,10 +4044,22 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @@ -3519,13 +4086,16 @@ class ModifyParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -3536,13 +4106,18 @@ class ModifyParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -3762,9 +4337,18 @@ class ModifyParamsPaymentMethodDataFpx(TypedDict): class ModifyParamsPaymentMethodDataGiropay(TypedDict): pass + class ModifyParamsPaymentMethodDataGopay(TypedDict): + pass + class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass + class ModifyParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -3825,6 +4409,9 @@ class ModifyParamsPaymentMethodDataKrCard(TypedDict): class ModifyParamsPaymentMethodDataLink(TypedDict): pass + class ModifyParamsPaymentMethodDataMbWay(TypedDict): + pass + class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -3910,18 +4497,55 @@ class ModifyParamsPaymentMethodDataPaynow(TypedDict): class ModifyParamsPaymentMethodDataPaypal(TypedDict): pass + class ModifyParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class ModifyParamsPaymentMethodDataPix(TypedDict): pass class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass + class ModifyParamsPaymentMethodDataQris(TypedDict): + pass + class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class ModifyParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntent.ModifyParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class ModifyParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -3937,12 +4561,25 @@ class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class ModifyParamsPaymentMethodDataShopeepay(TypedDict): + pass + class ModifyParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class ModifyParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class ModifyParamsPaymentMethodDataSwish(TypedDict): pass @@ -4016,6 +4653,10 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsPayto"] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsSepaDebit" ] @@ -4269,6 +4910,74 @@ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ModifyParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class ModifyParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -4319,6 +5028,12 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -4330,7 +5045,14 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -4349,6 +5071,18 @@ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -4424,6 +5158,12 @@ class VerifyMicrodepositsParams(RequestOptions): If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ + customer_account: Optional[str] + """ + ID of the Account this SetupIntent belongs to, if one exists. + + If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent. + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 19b5f052c..b9eb59fa8 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -222,12 +222,24 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataIdeal" ] @@ -270,6 +282,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -334,6 +352,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPix" ] @@ -346,12 +370,24 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataRevolutPay" ] @@ -376,12 +412,24 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSwish" ] @@ -412,13 +460,16 @@ class ConfirmParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -429,13 +480,18 @@ class ConfirmParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -657,9 +713,18 @@ class ConfirmParamsPaymentMethodDataFpx(TypedDict): class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass + class ConfirmParamsPaymentMethodDataGopay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -722,6 +787,9 @@ class ConfirmParamsPaymentMethodDataKrCard(TypedDict): class ConfirmParamsPaymentMethodDataLink(TypedDict): pass + class ConfirmParamsPaymentMethodDataMbWay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -807,18 +875,55 @@ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass + class ConfirmParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass + class ConfirmParamsPaymentMethodDataQris(TypedDict): + pass + class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class ConfirmParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntentService.ConfirmParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class ConfirmParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -834,12 +939,25 @@ class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class ConfirmParamsPaymentMethodDataShopeepay(TypedDict): + pass + class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class ConfirmParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass @@ -917,6 +1035,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" ] @@ -1170,6 +1294,74 @@ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class ConfirmParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class ConfirmParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -1220,6 +1412,12 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -1231,7 +1429,14 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1250,6 +1455,18 @@ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -1294,6 +1511,12 @@ class CreateParams(TypedDict): If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ + customer_account: NotRequired[str] + """ + ID of the Account this SetupIntent belongs to, if one exists. + + If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -1532,12 +1755,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataIdeal" ] @@ -1580,6 +1815,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -1642,6 +1883,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -1652,12 +1899,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataRevolutPay" ] @@ -1682,12 +1941,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSwish" ] @@ -1718,13 +1989,16 @@ class CreateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -1735,13 +2009,18 @@ class CreateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -1961,9 +2240,18 @@ class CreateParamsPaymentMethodDataFpx(TypedDict): class CreateParamsPaymentMethodDataGiropay(TypedDict): pass + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -2026,6 +2314,9 @@ class CreateParamsPaymentMethodDataKrCard(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -2111,18 +2402,55 @@ class CreateParamsPaymentMethodDataPaynow(TypedDict): class CreateParamsPaymentMethodDataPaypal(TypedDict): pass + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntentService.CreateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -2138,12 +2466,25 @@ class CreateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsPaymentMethodDataSwish(TypedDict): pass @@ -2221,6 +2562,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsSepaDebit" ] @@ -2474,6 +2821,74 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -2524,6 +2939,12 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -2535,7 +2956,14 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -2554,6 +2982,18 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, @@ -2594,6 +3034,10 @@ class ListParams(TypedDict): """ Only return SetupIntents for the customer specified by this customer ID. """ + customer_account: NotRequired[str] + """ + Only return SetupIntents for the account specified by this customer ID. + """ 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. @@ -2656,6 +3100,12 @@ class UpdateParams(TypedDict): If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ + customer_account: NotRequired[str] + """ + ID of the Account this SetupIntent belongs to, if one exists. + + If present, the SetupIntent's payment method will be attached to the Account on successful setup. Payment methods attached to other Accounts cannot be used with this SetupIntent. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -2811,12 +3261,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataIdeal" ] @@ -2859,6 +3321,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -2921,6 +3389,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @@ -2931,12 +3405,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataRevolutPay" ] @@ -2961,12 +3447,24 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSwish" ] @@ -2997,13 +3495,16 @@ class UpdateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -3014,13 +3515,18 @@ class UpdateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -3240,9 +3746,18 @@ class UpdateParamsPaymentMethodDataFpx(TypedDict): class UpdateParamsPaymentMethodDataGiropay(TypedDict): pass + class UpdateParamsPaymentMethodDataGopay(TypedDict): + pass + class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass + class UpdateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -3305,6 +3820,9 @@ class UpdateParamsPaymentMethodDataKrCard(TypedDict): class UpdateParamsPaymentMethodDataLink(TypedDict): pass + class UpdateParamsPaymentMethodDataMbWay(TypedDict): + pass + class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -3390,18 +3908,55 @@ class UpdateParamsPaymentMethodDataPaynow(TypedDict): class UpdateParamsPaymentMethodDataPaypal(TypedDict): pass + class UpdateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class UpdateParamsPaymentMethodDataPix(TypedDict): pass class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass + class UpdateParamsPaymentMethodDataQris(TypedDict): + pass + class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class UpdateParamsPaymentMethodDataRechnung(TypedDict): + dob: "SetupIntentService.UpdateParamsPaymentMethodDataRechnungDob" + """ + Customer's date of birth + """ + + class UpdateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -3417,12 +3972,25 @@ class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class UpdateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class UpdateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class UpdateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class UpdateParamsPaymentMethodDataSwish(TypedDict): pass @@ -3500,6 +4068,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ + payto: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsPayto" + ] + """ + If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options. + """ sepa_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsSepaDebit" ] @@ -3753,6 +4327,74 @@ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ + currency: NotRequired[str] + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class UpdateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation. + """ + + class UpdateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ @@ -3803,6 +4445,12 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( """ Provide filters for the linked accounts that the customer can select for the payment method. """ + manual_entry: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry" + ] + """ + Customize manual entry behavior + """ permissions: NotRequired[ List[ Literal[ @@ -3814,7 +4462,14 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -3833,6 +4488,18 @@ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ + + class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsManualEntry( + TypedDict, + ): + mode: Literal["automatic", "custom"] + """ + Settings for configuring manual entry of account details. + """ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, diff --git a/stripe/_source.py b/stripe/_source.py index 2354113dc..6b79a933b 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -89,6 +89,7 @@ class Card(StripeObject): address_line1_check: Optional[str] address_zip_check: Optional[str] brand: Optional[str] + brand_product: Optional[str] country: Optional[str] cvc_check: Optional[str] description: Optional[str] @@ -110,6 +111,7 @@ class CardPresent(StripeObject): authorization_code: Optional[str] authorization_response_code: Optional[str] brand: Optional[str] + brand_product: Optional[str] country: Optional[str] cvm_type: Optional[str] data_type: Optional[str] @@ -291,6 +293,17 @@ class VerifiedAddress(StripeObject): class P24(StripeObject): reference: Optional[str] + class Paypal(StripeObject): + billing_agreement: Optional[str] + fingerprint: Optional[str] + payer_id: Optional[str] + reference_id: Optional[str] + reference_transaction_amount: Optional[str] + reference_transaction_charged: Optional[bool] + statement_descriptor: Optional[str] + transaction_id: Optional[str] + verified_email: Optional[str] + class Receiver(StripeObject): address: Optional[str] """ @@ -463,6 +476,7 @@ class ThreeDSecure(StripeObject): address_zip_check: Optional[str] authenticated: Optional[bool] brand: Optional[str] + brand_product: Optional[str] card: Optional[str] country: Optional[str] customer: Optional[str] @@ -1072,6 +1086,7 @@ class VerifyParams(RequestOptions): Information about the owner of the payment instrument that may be used or required by particular source types. """ p24: Optional[P24] + paypal: Optional[Paypal] receiver: Optional[Receiver] redirect: Optional[Redirect] sepa_credit_transfer: Optional[SepaCreditTransfer] @@ -1102,6 +1117,7 @@ class VerifyParams(RequestOptions): "klarna", "multibanco", "p24", + "paypal", "sepa_credit_transfer", "sepa_debit", "sofort", @@ -1466,6 +1482,7 @@ def detach(self, **params) -> "Source": "multibanco": Multibanco, "owner": Owner, "p24": P24, + "paypal": Paypal, "receiver": Receiver, "redirect": Redirect, "sepa_credit_transfer": SepaCreditTransfer, diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index b0c20dbde..7d775ce43 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -24,7 +24,7 @@ from stripe._api_version import _ApiVersion from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse -from stripe._util import _convert_to_stripe_object, get_api_mode +from stripe._util import _convert_to_stripe_object, get_api_mode, deprecated from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event from stripe.v2._event import ThinEvent @@ -37,14 +37,17 @@ # services: The beginning of the section generated from our OpenAPI spec from stripe._account_service import AccountService from stripe._account_link_service import AccountLinkService +from stripe._account_notice_service import AccountNoticeService from stripe._account_session_service import AccountSessionService from stripe._apple_pay_domain_service import ApplePayDomainService from stripe._application_fee_service import ApplicationFeeService from stripe._apps_service import AppsService from stripe._balance_service import BalanceService +from stripe._balance_settings_service import BalanceSettingsService from stripe._balance_transaction_service import BalanceTransactionService from stripe._billing_service import BillingService from stripe._billing_portal_service import BillingPortalService +from stripe._capital_service import CapitalService from stripe._charge_service import ChargeService from stripe._checkout_service import CheckoutService from stripe._climate_service import ClimateService @@ -64,15 +67,18 @@ from stripe._file_link_service import FileLinkService from stripe._financial_connections_service import FinancialConnectionsService from stripe._forwarding_service import ForwardingService +from stripe._fx_quote_service import FxQuoteService from stripe._identity_service import IdentityService from stripe._invoice_service import InvoiceService -from stripe._invoice_payment_service import InvoicePaymentService from stripe._invoice_rendering_template_service import ( InvoiceRenderingTemplateService, ) from stripe._invoice_item_service import InvoiceItemService from stripe._issuing_service import IssuingService from stripe._mandate_service import MandateService +from stripe._margin_service import MarginService +from stripe._order_service import OrderService +from stripe._payment_attempt_record_service import PaymentAttemptRecordService from stripe._payment_intent_service import PaymentIntentService from stripe._payment_link_service import PaymentLinkService from stripe._payment_method_service import PaymentMethodService @@ -80,9 +86,11 @@ PaymentMethodConfigurationService, ) from stripe._payment_method_domain_service import PaymentMethodDomainService +from stripe._payment_record_service import PaymentRecordService from stripe._payout_service import PayoutService from stripe._plan_service import PlanService from stripe._price_service import PriceService +from stripe._privacy_service import PrivacyService from stripe._product_service import ProductService from stripe._promotion_code_service import PromotionCodeService from stripe._quote_service import QuoteService @@ -108,6 +116,7 @@ from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService +from stripe._external_account_service import ExternalAccountService from stripe._v2_services import V2Services # services: The end of the section generated from our OpenAPI spec @@ -188,14 +197,17 @@ def __init__( # top-level services: The beginning of the section generated from our OpenAPI spec self.accounts = AccountService(self._requestor) self.account_links = AccountLinkService(self._requestor) + self.account_notices = AccountNoticeService(self._requestor) self.account_sessions = AccountSessionService(self._requestor) self.apple_pay_domains = ApplePayDomainService(self._requestor) self.application_fees = ApplicationFeeService(self._requestor) self.apps = AppsService(self._requestor) self.balance = BalanceService(self._requestor) + self.balance_settings = BalanceSettingsService(self._requestor) self.balance_transactions = BalanceTransactionService(self._requestor) self.billing = BillingService(self._requestor) self.billing_portal = BillingPortalService(self._requestor) + self.capital = CapitalService(self._requestor) self.charges = ChargeService(self._requestor) self.checkout = CheckoutService(self._requestor) self.climate = ClimateService(self._requestor) @@ -217,15 +229,20 @@ def __init__( self._requestor ) self.forwarding = ForwardingService(self._requestor) + self.fx_quotes = FxQuoteService(self._requestor) self.identity = IdentityService(self._requestor) self.invoices = InvoiceService(self._requestor) - self.invoice_payments = InvoicePaymentService(self._requestor) self.invoice_rendering_templates = InvoiceRenderingTemplateService( self._requestor, ) self.invoice_items = InvoiceItemService(self._requestor) self.issuing = IssuingService(self._requestor) self.mandates = MandateService(self._requestor) + self.margins = MarginService(self._requestor) + self.orders = OrderService(self._requestor) + self.payment_attempt_records = PaymentAttemptRecordService( + self._requestor + ) self.payment_intents = PaymentIntentService(self._requestor) self.payment_links = PaymentLinkService(self._requestor) self.payment_methods = PaymentMethodService(self._requestor) @@ -235,9 +252,11 @@ def __init__( self.payment_method_domains = PaymentMethodDomainService( self._requestor ) + self.payment_records = PaymentRecordService(self._requestor) self.payouts = PayoutService(self._requestor) self.plans = PlanService(self._requestor) self.prices = PriceService(self._requestor) + self.privacy = PrivacyService(self._requestor) self.products = ProductService(self._requestor) self.promotion_codes = PromotionCodeService(self._requestor) self.quotes = QuoteService(self._requestor) @@ -265,6 +284,7 @@ def __init__( self.transfers = TransferService(self._requestor) self.treasury = TreasuryService(self._requestor) self.webhook_endpoints = WebhookEndpointService(self._requestor) + self.external_accounts = ExternalAccountService(self._requestor) self.v2 = V2Services(self._requestor) # top-level services: The end of the section generated from our OpenAPI spec diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 65600714c..3045590a6 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -110,6 +110,12 @@ class BillingCycleAnchorConfig(StripeObject): The second of the minute of the billing_cycle_anchor. """ + class BillingModeDetails(StripeObject): + updated_at: Optional[int] + """ + Details on when the current billing_mode was adopted. + """ + class BillingThresholds(StripeObject): amount_gte: Optional[int] """ @@ -167,6 +173,31 @@ class Issuer(StripeObject): issuer: Issuer _inner_class_types = {"issuer": Issuer} + class LastPriceMigrationError(StripeObject): + class FailedTransition(StripeObject): + source_price: str + """ + The original price to be migrated. + """ + target_price: str + """ + The intended resulting price of the migration. + """ + + errored_at: int + """ + The time at which the price migration encountered an error. + """ + failed_transitions: List[FailedTransition] + """ + The involved price pairs in each failed transition. + """ + type: Literal["price_uniqueness_violation"] + """ + The type of error encountered by the price migration. + """ + _inner_class_types = {"failed_transitions": FailedTransition} + class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ @@ -267,6 +298,9 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class IdBankTransfer(StripeObject): + pass + class Konbini(StripeObject): pass @@ -282,6 +316,10 @@ class Filters(StripeObject): """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ filters: Optional[Filters] permissions: Optional[ @@ -298,7 +336,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -332,6 +377,10 @@ class Filters(StripeObject): """ This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. """ + id_bank_transfer: Optional[IdBankTransfer] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to invoices created by the subscription. + """ konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. @@ -349,6 +398,7 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "id_bank_transfer": IdBankTransfer, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, @@ -372,11 +422,13 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", + "id_bank_transfer", "ideal", "jp_credit_transfer", "kakao_pay", @@ -396,6 +448,7 @@ class Filters(StripeObject): "sepa_credit_transfer", "sepa_debit", "sofort", + "stripe_balance", "swish", "us_bank_account", "wechat_pay", @@ -432,6 +485,10 @@ class PendingUpdate(StripeObject): """ The point after which the changes reflected by this update will be discarded and no longer applied. """ + prebilling_iterations: Optional[int] + """ + The number of iterations of prebilling to apply. + """ subscription_items: Optional[List["SubscriptionItem"]] """ List of subscription items, each with an attached plan, that will be set if the update is applied. @@ -445,6 +502,24 @@ class PendingUpdate(StripeObject): Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ + class Prebilling(StripeObject): + invoice: ExpandableField["Invoice"] + """ + ID of the prebilling invoice. + """ + period_end: int + """ + The end of the last period for which the invoice pre-bills. + """ + period_start: int + """ + The start of the first period for which the invoice pre-bills. + """ + update_behavior: Optional[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + """ + class TransferData(StripeObject): amount_percent: Optional[float] """ @@ -531,13 +606,19 @@ class CreateParams(RequestOptions): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|Subscription.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - cancel_at: NotRequired[int] + cancel_at: NotRequired[ + "int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -555,10 +636,14 @@ class CreateParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - customer: str + customer: NotRequired[str] """ The identifier of the customer to subscribe. """ + customer_account: NotRequired[str] + """ + The identifier of the account to subscribe. + """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. @@ -644,6 +729,10 @@ class CreateParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ + prebilling: NotRequired["Subscription.CreateParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -706,11 +795,43 @@ class CreateParamsAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.CreateParamsAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.CreateParamsAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsAddInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -798,11 +919,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -860,6 +1013,10 @@ class CreateParamsItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["Subscription.CreateParamsItemTrial"] + """ + Define options to configure the trial on the subscription item. + """ class CreateParamsItemBillingThresholds(TypedDict): usage_gte: int @@ -876,11 +1033,43 @@ class CreateParamsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.CreateParamsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.CreateParamsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsItemPriceData(TypedDict): currency: str """ @@ -919,6 +1108,16 @@ class CreateParamsItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + class CreateParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptions" @@ -927,7 +1126,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -964,6 +1163,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1097,6 +1302,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -1139,7 +1349,14 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1154,6 +1371,10 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] @@ -1165,6 +1386,16 @@ class CreateParamsPendingInvoiceItemInterval(TypedDict): The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ + class CreateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class CreateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -1221,6 +1452,10 @@ class ListParams(RequestOptions): """ The ID of the customer whose subscriptions will be retrieved. """ + customer_account: NotRequired[str] + """ + The ID of the account whose subscriptions will be retrieved. + """ 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. @@ -1327,6 +1562,16 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(RequestOptions): + billing_mode: Literal["flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class ModifyParams(RequestOptions): add_invoice_items: NotRequired[ List["Subscription.ModifyParamsAddInvoiceItem"] @@ -1352,7 +1597,9 @@ class ModifyParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - cancel_at: NotRequired["Literal['']|int"] + cancel_at: NotRequired[ + "Literal['']|int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -1459,6 +1706,10 @@ class ModifyParams(RequestOptions): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ + prebilling: NotRequired["Subscription.ModifyParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1523,11 +1774,43 @@ class ModifyParamsAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.ModifyParamsAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.ModifyParamsAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsAddInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1605,11 +1888,43 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.ModifyParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.ModifyParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1695,11 +2010,43 @@ class ModifyParamsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "Subscription.ModifyParamsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "Subscription.ModifyParamsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsItemPriceData(TypedDict): currency: str """ @@ -1756,7 +2103,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1793,6 +2140,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1926,6 +2279,11 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class ModifyParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -1968,7 +2326,14 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1983,6 +2348,10 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class ModifyParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] @@ -1994,6 +2363,16 @@ class ModifyParamsPendingInvoiceItemInterval(TypedDict): The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ + class ModifyParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class ModifyParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -2077,6 +2456,14 @@ class SearchParams(RequestOptions): """ The fixed values used to calculate the `billing_cycle_anchor`. """ + billing_mode: Optional[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + billing_mode_details: Optional[BillingModeDetails] + """ + Details about when the current billing_mode was updated. + """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period @@ -2113,6 +2500,10 @@ class SearchParams(RequestOptions): """ ID of the customer who owns the subscription. """ + customer_account: Optional[str] + """ + ID of the account who owns the subscription. + """ days_until_due: Optional[int] """ Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`. @@ -2154,6 +2545,10 @@ class SearchParams(RequestOptions): """ List of subscription items, each with an attached price. """ + last_price_migration_error: Optional[LastPriceMigrationError] + """ + Details of the most recent price migration that failed for the subscription. + """ latest_invoice: Optional[ExpandableField["Invoice"]] """ The most recent invoice this subscription has generated. @@ -2198,6 +2593,10 @@ class SearchParams(RequestOptions): """ If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. """ + prebilling: Optional[Prebilling] + """ + Time period and invoice for a Subscription billed in advance. + """ schedule: Optional[ExpandableField["SubscriptionSchedule"]] """ The schedule attached to the subscription @@ -2606,6 +3005,116 @@ async def list_async( return result + @classmethod + def _cls_migrate( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + cls._static_request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + def migrate( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + def migrate( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate") + def migrate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_migrate_async( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await cls._static_request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def migrate_async( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + async def migrate_async( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate_async") + async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Subscription.ModifyParams"] @@ -2855,13 +3364,16 @@ async def search_auto_paging_iter_async( _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, + "billing_mode_details": BillingModeDetails, "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, "invoice_settings": InvoiceSettings, + "last_price_migration_error": LastPriceMigrationError, "pause_collection": PauseCollection, "payment_settings": PaymentSettings, "pending_invoice_item_interval": PendingInvoiceItemInterval, "pending_update": PendingUpdate, + "prebilling": Prebilling, "transfer_data": TransferData, "trial_settings": TrialSettings, } diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 173c230aa..641cd24a6 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -44,6 +44,16 @@ class BillingThresholds(StripeObject): Usage threshold that triggers the subscription to create an invoice """ + class Trial(StripeObject): + converts_to: Optional[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + class CreateParams(RequestOptions): billing_thresholds: NotRequired[ "Literal['']|SubscriptionItem.CreateParamsBillingThresholds" @@ -116,6 +126,10 @@ class CreateParams(RequestOptions): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["SubscriptionItem.CreateParamsTrial"] + """ + Options that configure the trial on the subscription item. + """ class CreateParamsBillingThresholds(TypedDict): usage_gte: int @@ -132,11 +146,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionItem.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionItem.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPriceData(TypedDict): currency: str """ @@ -175,6 +221,16 @@ class CreateParamsPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + class DeleteParams(RequestOptions): clear_usage: NotRequired[bool] """ @@ -301,11 +357,43 @@ class ModifyParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionItem.ModifyParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionItem.ModifyParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPriceData(TypedDict): currency: str """ @@ -414,6 +502,10 @@ class RetrieveParams(RequestOptions): """ The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. """ + trial: Optional[Trial] + """ + Options that configure the trial on the subscription item. + """ deleted: Optional[Literal[True]] """ Always true for a deleted object @@ -645,4 +737,7 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"billing_thresholds": BillingThresholds} + _inner_class_types = { + "billing_thresholds": BillingThresholds, + "trial": Trial, + } diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 1823cfc68..5ecfa7156 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -84,6 +84,10 @@ class CreateParams(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["SubscriptionItemService.CreateParamsTrial"] + """ + Options that configure the trial on the subscription item. + """ class CreateParamsBillingThresholds(TypedDict): usage_gte: int @@ -100,11 +104,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionItemService.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionItemService.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPriceData(TypedDict): currency: str """ @@ -143,6 +179,16 @@ class CreateParamsPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + class DeleteParams(TypedDict): clear_usage: NotRequired[bool] """ @@ -277,11 +323,43 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionItemService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionItemService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPriceData(TypedDict): currency: str """ diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 8142d9c0e..5e578833c 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -23,6 +23,7 @@ from stripe._coupon import Coupon from stripe._customer import Customer from stripe._discount import Discount as DiscountResource + from stripe._invoice import Invoice from stripe._payment_method import PaymentMethod from stripe._plan import Plan from stripe._price import Price @@ -169,9 +170,44 @@ class TransferData(StripeObject): "transfer_data": TransferData, } + class LastPriceMigrationError(StripeObject): + class FailedTransition(StripeObject): + source_price: str + """ + The original price to be migrated. + """ + target_price: str + """ + The intended resulting price of the migration. + """ + + errored_at: int + """ + The time at which the price migration encountered an error. + """ + failed_transitions: List[FailedTransition] + """ + The involved price pairs in each failed transition. + """ + type: Literal["price_uniqueness_violation"] + """ + The type of error encountered by the price migration. + """ + _inner_class_types = {"failed_transitions": FailedTransition} + class Phase(StripeObject): class AddInvoiceItem(StripeObject): class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. @@ -180,10 +216,15 @@ class Discount(StripeObject): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ + _inner_class_types = {"discount_end": DiscountEnd} discounts: List[Discount] """ @@ -239,6 +280,16 @@ class BillingThresholds(StripeObject): """ class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. @@ -247,10 +298,15 @@ class Discount(StripeObject): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ + _inner_class_types = {"discount_end": DiscountEnd} class InvoiceSettings(StripeObject): class Issuer(StripeObject): @@ -285,6 +341,16 @@ class BillingThresholds(StripeObject): """ class Discount(StripeObject): + class DiscountEnd(StripeObject): + timestamp: Optional[int] + """ + The discount end timestamp. + """ + type: Literal["timestamp"] + """ + The discount end type. + """ + coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. @@ -293,10 +359,25 @@ class Discount(StripeObject): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: Optional[DiscountEnd] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ + _inner_class_types = {"discount_end": DiscountEnd} + + class Trial(StripeObject): + converts_to: Optional[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ billing_thresholds: Optional[BillingThresholds] """ @@ -326,11 +407,22 @@ class Discount(StripeObject): """ The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. """ + trial: Optional[Trial] + """ + Options that configure the trial on the subscription item. + """ _inner_class_types = { "billing_thresholds": BillingThresholds, "discounts": Discount, + "trial": Trial, } + class PauseCollection(StripeObject): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class TransferData(StripeObject): amount_percent: Optional[float] """ @@ -341,6 +433,19 @@ class TransferData(StripeObject): The account where funds from the payment will be transferred to upon payment success. """ + class TrialSettings(StripeObject): + class EndBehavior(StripeObject): + prorate_up_front: Optional[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + end_behavior: Optional[EndBehavior] + """ + Defines how the subscription should behave when a trial ends. + """ + _inner_class_types = {"end_behavior": EndBehavior} + add_invoice_items: List[AddInvoiceItem] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. @@ -404,6 +509,10 @@ class TransferData(StripeObject): """ The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. """ + pause_collection: Optional[PauseCollection] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ proration_behavior: Literal[ "always_invoice", "create_prorations", "none" ] @@ -418,10 +527,18 @@ class TransferData(StripeObject): """ The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. """ + trial_continuation: Optional[Literal["continue", "none"]] + """ + Specify behavior of the trial when crossing schedule phase boundaries + """ trial_end: Optional[int] """ When the trial ends within the phase. """ + trial_settings: Optional[TrialSettings] + """ + Settings related to any trials on the subscription during this phase. + """ _inner_class_types = { "add_invoice_items": AddInvoiceItem, "automatic_tax": AutomaticTax, @@ -429,9 +546,641 @@ class TransferData(StripeObject): "discounts": Discount, "invoice_settings": InvoiceSettings, "items": Item, + "pause_collection": PauseCollection, "transfer_data": TransferData, + "trial_settings": TrialSettings, } + class Prebilling(StripeObject): + invoice: ExpandableField["Invoice"] + """ + ID of the prebilling invoice. + """ + period_end: int + """ + The end of the last period for which the invoice pre-bills. + """ + period_start: int + """ + The start of the first period for which the invoice pre-bills. + """ + update_behavior: Optional[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + """ + + class AmendParams(RequestOptions): + amendments: NotRequired[ + List["SubscriptionSchedule.AmendParamsAmendment"] + ] + """ + Changes to apply to the phases of the subscription schedule, in the order provided. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + prebilling: NotRequired[ + "Literal['']|List[SubscriptionSchedule.AmendParamsPrebilling]" + ] + """ + Provide any time periods to bill in advance. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the amendment changes the currently active phase, + specifies if and how to prorate at the time of the request. + """ + schedule_settings: NotRequired[ + "SubscriptionSchedule.AmendParamsScheduleSettings" + ] + """ + Changes to apply to the subscription schedule. + """ + + class AmendParamsAmendment(TypedDict): + amendment_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentAmendmentEnd" + ] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment. + """ + amendment_start: ( + "SubscriptionSchedule.AmendParamsAmendmentAmendmentStart" + ) + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + billing_cycle_anchor: NotRequired[ + Literal["amendment_start", "automatic"] + ] + """ + For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment. + """ + discount_actions: NotRequired[ + List["SubscriptionSchedule.AmendParamsAmendmentDiscountAction"] + ] + """ + Changes to the coupons being redeemed or discounts being applied during the amendment time span. + """ + item_actions: NotRequired[ + List["SubscriptionSchedule.AmendParamsAmendmentItemAction"] + ] + """ + Changes to the subscription items during the amendment time span. + """ + metadata_actions: NotRequired[ + List["SubscriptionSchedule.AmendParamsAmendmentMetadataAction"] + ] + """ + Instructions for how to modify phase metadata + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`. + """ + set_pause_collection: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentSetPauseCollection" + ] + """ + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. + """ + set_schedule_end: NotRequired[ + Literal["amendment_end", "amendment_start"] + ] + """ + Ends the subscription schedule early as dictated by either the accompanying amendment's start or end. + """ + trial_settings: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class AmendParamsAmendmentAmendmentEnd(TypedDict): + discount_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentAmendmentEndDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + duration: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentAmendmentEndDuration" + ] + """ + Time span for the amendment starting from the `amendment_start`. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`. + """ + type: Literal[ + "discount_end", + "duration", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] + """ + Select one of three ways to pass the `amendment_end`. + """ + + class AmendParamsAmendmentAmendmentEndDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class AmendParamsAmendmentAmendmentEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentAmendmentStart(TypedDict): + amendment_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentAmendmentStartAmendmentEnd" + ] + """ + Details of another amendment in the same array, immediately after which this amendment should begin. + """ + discount_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentAmendmentStartDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the amendment to start. + """ + type: Literal[ + "amendment_end", + "discount_end", + "now", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] + """ + Select one of three ways to pass the `amendment_start`. + """ + + class AmendParamsAmendmentAmendmentStartAmendmentEnd(TypedDict): + index: int + """ + The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array. + """ + + class AmendParamsAmendmentAmendmentStartDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class AmendParamsAmendmentDiscountAction(TypedDict): + add: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentDiscountActionAdd" + ] + """ + Details of the discount to add. + """ + remove: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentDiscountActionRemove" + ] + """ + Details of the discount to remove. + """ + set: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentDiscountActionSet" + ] + """ + Details of the discount to replace the existing discounts with. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of discount action. + """ + + class AmendParamsAmendmentDiscountActionAdd(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentDiscountActionAddDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class AmendParamsAmendmentDiscountActionAddDiscountEnd(TypedDict): + type: Literal["amendment_end"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentDiscountActionRemove(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class AmendParamsAmendmentDiscountActionSet(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class AmendParamsAmendmentItemAction(TypedDict): + add: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionAdd" + ] + """ + Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item. + """ + remove: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionRemove" + ] + """ + Details of the subscription item to remove. + """ + set: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionSet" + ] + """ + Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of item action. + """ + + class AmendParamsAmendmentItemActionAdd(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionAddDiscount" + ] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionAddTrial" + ] + """ + Options that configure the trial on the subscription item. + """ + + class AmendParamsAmendmentItemActionAddDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AmendParamsAmendmentItemActionAddDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionAddDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentItemActionAddDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentItemActionAddTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class AmendParamsAmendmentItemActionRemove(TypedDict): + price: str + """ + ID of a price to remove. + """ + + class AmendParamsAmendmentItemActionSet(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionSetDiscount" + ] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionSetTrial" + ] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class AmendParamsAmendmentItemActionSetDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionSetDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AmendParamsAmendmentItemActionSetDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentItemActionSetDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentItemActionSetDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentItemActionSetTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class AmendParamsAmendmentMetadataAction(TypedDict): + add: NotRequired[Dict[str, str]] + """ + Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata. + """ + remove: NotRequired[List[str]] + """ + Keys to remove from schedule phase metadata. + """ + set: NotRequired["Literal['']|Dict[str, str]"] + """ + Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten. + """ + type: Literal["add", "remove", "set"] + """ + Select one of three ways to update phase-level `metadata` on subscription schedules. + """ + + class AmendParamsAmendmentSetPauseCollection(TypedDict): + set: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentSetPauseCollectionSet" + ] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class AmendParamsAmendmentSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class AmendParamsAmendmentTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionSchedule.AmendParamsAmendmentTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class AmendParamsAmendmentTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class AmendParamsPrebilling(TypedDict): + bill_from: NotRequired[ + "SubscriptionSchedule.AmendParamsPrebillingBillFrom" + ] + """ + The beginning of the prebilled time period. The default value is `now`. + """ + bill_until: NotRequired[ + "SubscriptionSchedule.AmendParamsPrebillingBillUntil" + ] + """ + The end of the prebilled time period. + """ + invoice_at: NotRequired[Literal["now"]] + """ + When the prebilling invoice should be created. The default value is `now`. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + + class AmendParamsPrebillingBillFrom(TypedDict): + amendment_start: NotRequired[ + "SubscriptionSchedule.AmendParamsPrebillingBillFromAmendmentStart" + ] + """ + Start the prebilled period when a specified amendment begins. + """ + timestamp: NotRequired[int] + """ + Start the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_start", "now", "timestamp"] + """ + Select one of several ways to pass the `bill_from` value. + """ + + class AmendParamsPrebillingBillFromAmendmentStart(TypedDict): + index: int + """ + The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class AmendParamsPrebillingBillUntil(TypedDict): + amendment_end: NotRequired[ + "SubscriptionSchedule.AmendParamsPrebillingBillUntilAmendmentEnd" + ] + """ + End the prebilled period when a specified amendment ends. + """ + duration: NotRequired[ + "SubscriptionSchedule.AmendParamsPrebillingBillUntilDuration" + ] + """ + Time span for prebilling, starting from `bill_from`. + """ + timestamp: NotRequired[int] + """ + End the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_end", "duration", "schedule_end", "timestamp"] + """ + Select one of several ways to pass the `bill_until` value. + """ + + class AmendParamsPrebillingBillUntilAmendmentEnd(TypedDict): + index: int + """ + The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class AmendParamsPrebillingBillUntilDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsScheduleSettings(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -447,10 +1196,24 @@ class CancelParams(RequestOptions): """ class CreateParams(RequestOptions): + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ + customer_account: NotRequired[str] + """ + The identifier of the account to create the subscription schedule for. + """ default_settings: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettings" ] @@ -479,6 +1242,10 @@ class CreateParams(RequestOptions): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ + prebilling: NotRequired["SubscriptionSchedule.CreateParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ start_date: NotRequired["int|Literal['now']"] """ When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. @@ -685,6 +1452,12 @@ class CreateParamsPhase(TypedDict): """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ + pause_collection: NotRequired[ + "SubscriptionSchedule.CreateParamsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -701,10 +1474,20 @@ class CreateParamsPhase(TypedDict): """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + trial_settings: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ class CreateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ @@ -723,29 +1506,63 @@ class CreateParamsPhaseAddInvoiceItem(TypedDict): "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemPriceData" ] """ - Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + """ + quantity: NotRequired[int] + """ + Quantity for this item. Defaults to 1. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + """ + + class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class CreateParamsPhaseAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. """ - quantity: NotRequired[int] + timestamp: NotRequired[int] """ - Quantity for this item. Defaults to 1. + A precise Unix timestamp for the discount to end. Must be in the future. """ - tax_rates: NotRequired["Literal['']|List[str]"] + type: Literal["duration", "timestamp"] """ - The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + The type of calculation made to determine when the discount ends. """ - class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): - coupon: NotRequired[str] - """ - ID of the coupon to create a new discount for. - """ - discount: NotRequired[str] + class CreateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict + ): + interval: Literal["day", "month", "week", "year"] """ - ID of an existing discount on the object (or one of its ancestors) to reuse. + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. """ - promotion_code: NotRequired[str] + interval_count: int """ - ID of the promotion code to create a new discount for. + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. """ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): @@ -813,11 +1630,43 @@ class CreateParamsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsPhaseDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsPhaseDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -883,6 +1732,10 @@ class CreateParamsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["SubscriptionSchedule.CreateParamsPhaseItemTrial"] + """ + Options that configure the trial on the subscription item. + """ class CreateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int @@ -899,11 +1752,43 @@ class CreateParamsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsPhaseItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsPhaseItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -944,6 +1829,22 @@ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreateParamsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class CreateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -954,6 +1855,30 @@ class CreateParamsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class CreateParamsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionSchedule.CreateParamsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreateParamsPhaseTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class ListParams(RequestOptions): canceled_at: NotRequired[ "SubscriptionSchedule.ListParamsCanceledAt|int" @@ -975,6 +1900,10 @@ class ListParams(RequestOptions): """ Only return subscription schedules for the given customer. """ + customer_account: NotRequired[str] + """ + Only return subscription schedules for the given account. + """ 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. @@ -1075,6 +2004,12 @@ class ListParamsReleasedAt(TypedDict): """ class ModifyParams(RequestOptions): + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ default_settings: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettings" ] @@ -1099,6 +2034,10 @@ class ModifyParams(RequestOptions): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ + prebilling: NotRequired["SubscriptionSchedule.ModifyParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1307,6 +2246,12 @@ class ModifyParamsPhase(TypedDict): """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ + pause_collection: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1327,10 +2272,20 @@ class ModifyParamsPhase(TypedDict): """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + trial_settings: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ class ModifyParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ @@ -1369,11 +2324,45 @@ class ModifyParamsPhaseAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsPhaseAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1439,11 +2428,43 @@ class ModifyParamsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsPhaseDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsPhaseDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1509,6 +2530,10 @@ class ModifyParamsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["SubscriptionSchedule.ModifyParamsPhaseItemTrial"] + """ + Options that configure the trial on the subscription item. + """ class ModifyParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int @@ -1525,11 +2550,43 @@ class ModifyParamsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class ModifyParamsPhaseItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class ModifyParamsPhaseItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class ModifyParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -1570,6 +2627,22 @@ class ModifyParamsPhaseItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class ModifyParamsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class ModifyParamsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class ModifyParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -1580,6 +2653,30 @@ class ModifyParamsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class ModifyParamsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionSchedule.ModifyParamsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class ModifyParamsPhaseTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class ModifyParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class ReleaseParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1600,6 +2697,16 @@ class RetrieveParams(RequestOptions): """ ID of the Connect Application that created the schedule. """ + billing_behavior: Optional[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: Optional[Literal["classic", "flexible"]] + """ + The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + """ canceled_at: Optional[int] """ Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. @@ -1620,6 +2727,10 @@ class RetrieveParams(RequestOptions): """ ID of the customer who owns the subscription schedule. """ + customer_account: Optional[str] + """ + ID of the account who owns the subscription schedule. + """ default_settings: DefaultSettings end_behavior: Literal["cancel", "none", "release", "renew"] """ @@ -1629,6 +2740,10 @@ class RetrieveParams(RequestOptions): """ Unique identifier for the object. """ + last_price_migration_error: Optional[LastPriceMigrationError] + """ + Details of the most recent price migration that failed for the subscription schedule. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. @@ -1645,6 +2760,10 @@ class RetrieveParams(RequestOptions): """ Configuration for the subscription schedule's phases. """ + prebilling: Optional[Prebilling] + """ + Time period and invoice for a Subscription billed in advance. + """ released_at: Optional[int] """ Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. @@ -1668,6 +2787,120 @@ class RetrieveParams(RequestOptions): ID of the test clock this subscription schedule belongs to. """ + @classmethod + def _cls_amend( + cls, + schedule: str, + **params: Unpack["SubscriptionSchedule.AmendParams"], + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + return cast( + "SubscriptionSchedule", + cls._static_request( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(schedule) + ), + params=params, + ), + ) + + @overload + @staticmethod + def amend( + schedule: str, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + ... + + @overload + def amend( + self, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + ... + + @class_method_variant("_cls_amend") + def amend( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + return cast( + "SubscriptionSchedule", + self._request( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_amend_async( + cls, + schedule: str, + **params: Unpack["SubscriptionSchedule.AmendParams"], + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + return cast( + "SubscriptionSchedule", + await cls._static_request_async( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(schedule) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def amend_async( + schedule: str, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + ... + + @overload + async def amend_async( + self, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + ... + + @class_method_variant("_cls_amend_async") + async def amend_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["SubscriptionSchedule.AmendParams"] + ) -> "SubscriptionSchedule": + """ + Amends an existing subscription schedule. + """ + return cast( + "SubscriptionSchedule", + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def _cls_cancel( cls, @@ -2027,5 +3260,7 @@ async def retrieve_async( _inner_class_types = { "current_phase": CurrentPhase, "default_settings": DefaultSettings, + "last_price_migration_error": LastPriceMigrationError, "phases": Phase, + "prebilling": Prebilling, } diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 05fb42f95..7ac574518 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -10,6 +10,622 @@ class SubscriptionScheduleService(StripeService): + class AmendParams(TypedDict): + amendments: NotRequired[ + List["SubscriptionScheduleService.AmendParamsAmendment"] + ] + """ + Changes to apply to the phases of the subscription schedule, in the order provided. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + prebilling: NotRequired[ + "Literal['']|List[SubscriptionScheduleService.AmendParamsPrebilling]" + ] + """ + Provide any time periods to bill in advance. + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + In cases where the amendment changes the currently active phase, + specifies if and how to prorate at the time of the request. + """ + schedule_settings: NotRequired[ + "SubscriptionScheduleService.AmendParamsScheduleSettings" + ] + """ + Changes to apply to the subscription schedule. + """ + + class AmendParamsAmendment(TypedDict): + amendment_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentEnd" + ] + """ + Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment. + """ + amendment_start: ( + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentStart" + ) + """ + Details to identify the earliest timestamp where the proposed change should take effect. + """ + billing_cycle_anchor: NotRequired[ + Literal["amendment_start", "automatic"] + ] + """ + For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment. + """ + discount_actions: NotRequired[ + List[ + "SubscriptionScheduleService.AmendParamsAmendmentDiscountAction" + ] + ] + """ + Changes to the coupons being redeemed or discounts being applied during the amendment time span. + """ + item_actions: NotRequired[ + List["SubscriptionScheduleService.AmendParamsAmendmentItemAction"] + ] + """ + Changes to the subscription items during the amendment time span. + """ + metadata_actions: NotRequired[ + List[ + "SubscriptionScheduleService.AmendParamsAmendmentMetadataAction" + ] + ] + """ + Instructions for how to modify phase metadata + """ + proration_behavior: NotRequired[ + Literal["always_invoice", "create_prorations", "none"] + ] + """ + Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`. + """ + set_pause_collection: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentSetPauseCollection" + ] + """ + Defines how to pause collection for the underlying subscription throughout the duration of the amendment. + """ + set_schedule_end: NotRequired[ + Literal["amendment_end", "amendment_start"] + ] + """ + Ends the subscription schedule early as dictated by either the accompanying amendment's start or end. + """ + trial_settings: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentTrialSettings" + ] + """ + Settings related to subscription trials. + """ + + class AmendParamsAmendmentAmendmentEnd(TypedDict): + discount_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentEndDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + duration: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentEndDuration" + ] + """ + Time span for the amendment starting from the `amendment_start`. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`. + """ + type: Literal[ + "discount_end", + "duration", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] + """ + Select one of three ways to pass the `amendment_end`. + """ + + class AmendParamsAmendmentAmendmentEndDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class AmendParamsAmendmentAmendmentEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentAmendmentStart(TypedDict): + amendment_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentStartAmendmentEnd" + ] + """ + Details of another amendment in the same array, immediately after which this amendment should begin. + """ + discount_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentAmendmentStartDiscountEnd" + ] + """ + Use the `end` time of a given discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the amendment to start. + """ + type: Literal[ + "amendment_end", + "discount_end", + "now", + "schedule_end", + "timestamp", + "trial_end", + "trial_start", + "upcoming_invoice", + ] + """ + Select one of three ways to pass the `amendment_start`. + """ + + class AmendParamsAmendmentAmendmentStartAmendmentEnd(TypedDict): + index: int + """ + The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array. + """ + + class AmendParamsAmendmentAmendmentStartDiscountEnd(TypedDict): + discount: str + """ + The ID of a specific discount. + """ + + class AmendParamsAmendmentDiscountAction(TypedDict): + add: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentDiscountActionAdd" + ] + """ + Details of the discount to add. + """ + remove: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentDiscountActionRemove" + ] + """ + Details of the discount to remove. + """ + set: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentDiscountActionSet" + ] + """ + Details of the discount to replace the existing discounts with. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of discount action. + """ + + class AmendParamsAmendmentDiscountActionAdd(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to redeem. + """ + discount: NotRequired[str] + """ + An ID of an existing discount for a coupon that was already redeemed. + """ + discount_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentDiscountActionAddDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + index: NotRequired[int] + """ + The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The promotion code to redeem. + """ + + class AmendParamsAmendmentDiscountActionAddDiscountEnd(TypedDict): + type: Literal["amendment_end"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentDiscountActionRemove(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to remove from the `discounts` array. + """ + discount: NotRequired[str] + """ + The ID of a discount to remove from the `discounts` array. + """ + promotion_code: NotRequired[str] + """ + The ID of a promotion code to remove from the `discounts` array. + """ + + class AmendParamsAmendmentDiscountActionSet(TypedDict): + coupon: NotRequired[str] + """ + The coupon code to replace the `discounts` array with. + """ + discount: NotRequired[str] + """ + An ID of an existing discount to replace the `discounts` array with. + """ + promotion_code: NotRequired[str] + """ + An ID of an existing promotion code to replace the `discounts` array with. + """ + + class AmendParamsAmendmentItemAction(TypedDict): + add: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionAdd" + ] + """ + Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item. + """ + remove: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionRemove" + ] + """ + Details of the subscription item to remove. + """ + set: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionSet" + ] + """ + Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item. + """ + type: Literal["add", "remove", "set"] + """ + Determines the type of item action. + """ + + class AmendParamsAmendmentItemActionAdd(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionAddDiscount" + ] + ] + """ + The discounts applied to the item. Subscription item discounts are applied before subscription discounts. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + Quantity for this item. + """ + tax_rates: NotRequired[List[str]] + """ + The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + """ + trial: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionAddTrial" + ] + """ + Options that configure the trial on the subscription item. + """ + + class AmendParamsAmendmentItemActionAddDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionAddDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AmendParamsAmendmentItemActionAddDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionAddDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentItemActionAddDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentItemActionAddTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class AmendParamsAmendmentItemActionRemove(TypedDict): + price: str + """ + ID of a price to remove. + """ + + class AmendParamsAmendmentItemActionSet(TypedDict): + discounts: NotRequired[ + List[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionSetDiscount" + ] + ] + """ + If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`. + """ + metadata: NotRequired[Dict[str, str]] + """ + If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`. + """ + price: str + """ + The ID of the price object. + """ + quantity: NotRequired[int] + """ + If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`. + """ + tax_rates: NotRequired[List[str]] + """ + If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`. + """ + trial: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionSetTrial" + ] + """ + If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. + """ + + class AmendParamsAmendmentItemActionSetDiscount(TypedDict): + coupon: NotRequired[str] + """ + ID of the coupon to create a new discount for. + """ + discount: NotRequired[str] + """ + ID of an existing discount on the object (or one of its ancestors) to reuse. + """ + discount_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionSetDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ + promotion_code: NotRequired[str] + """ + ID of the promotion code to create a new discount for. + """ + + class AmendParamsAmendmentItemActionSetDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentItemActionSetDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class AmendParamsAmendmentItemActionSetDiscountDiscountEndDuration( + TypedDict, + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsAmendmentItemActionSetTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class AmendParamsAmendmentMetadataAction(TypedDict): + add: NotRequired[Dict[str, str]] + """ + Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata. + """ + remove: NotRequired[List[str]] + """ + Keys to remove from schedule phase metadata. + """ + set: NotRequired["Literal['']|Dict[str, str]"] + """ + Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten. + """ + type: Literal["add", "remove", "set"] + """ + Select one of three ways to update phase-level `metadata` on subscription schedules. + """ + + class AmendParamsAmendmentSetPauseCollection(TypedDict): + set: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentSetPauseCollectionSet" + ] + """ + Details of the pause_collection behavior to apply to the amendment. + """ + type: Literal["remove", "set"] + """ + Determines the type of the pause_collection amendment. + """ + + class AmendParamsAmendmentSetPauseCollectionSet(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + + class AmendParamsAmendmentTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionScheduleService.AmendParamsAmendmentTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class AmendParamsAmendmentTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class AmendParamsPrebilling(TypedDict): + bill_from: NotRequired[ + "SubscriptionScheduleService.AmendParamsPrebillingBillFrom" + ] + """ + The beginning of the prebilled time period. The default value is `now`. + """ + bill_until: NotRequired[ + "SubscriptionScheduleService.AmendParamsPrebillingBillUntil" + ] + """ + The end of the prebilled time period. + """ + invoice_at: NotRequired[Literal["now"]] + """ + When the prebilling invoice should be created. The default value is `now`. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + + class AmendParamsPrebillingBillFrom(TypedDict): + amendment_start: NotRequired[ + "SubscriptionScheduleService.AmendParamsPrebillingBillFromAmendmentStart" + ] + """ + Start the prebilled period when a specified amendment begins. + """ + timestamp: NotRequired[int] + """ + Start the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_start", "now", "timestamp"] + """ + Select one of several ways to pass the `bill_from` value. + """ + + class AmendParamsPrebillingBillFromAmendmentStart(TypedDict): + index: int + """ + The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class AmendParamsPrebillingBillUntil(TypedDict): + amendment_end: NotRequired[ + "SubscriptionScheduleService.AmendParamsPrebillingBillUntilAmendmentEnd" + ] + """ + End the prebilled period when a specified amendment ends. + """ + duration: NotRequired[ + "SubscriptionScheduleService.AmendParamsPrebillingBillUntilDuration" + ] + """ + Time span for prebilling, starting from `bill_from`. + """ + timestamp: NotRequired[int] + """ + End the prebilled period at a precise integer timestamp, starting from the Unix epoch. + """ + type: Literal["amendment_end", "duration", "schedule_end", "timestamp"] + """ + Select one of several ways to pass the `bill_until` value. + """ + + class AmendParamsPrebillingBillUntilAmendmentEnd(TypedDict): + index: int + """ + The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments. + """ + + class AmendParamsPrebillingBillUntilDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + + class AmendParamsScheduleSettings(TypedDict): + end_behavior: NotRequired[Literal["cancel", "release"]] + """ + Behavior of the subscription schedule and underlying subscription when it ends. + """ + class CancelParams(TypedDict): expand: NotRequired[List[str]] """ @@ -25,10 +641,24 @@ class CancelParams(TypedDict): """ class CreateParams(TypedDict): + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ + customer_account: NotRequired[str] + """ + The identifier of the account to create the subscription schedule for. + """ default_settings: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettings" ] @@ -59,6 +689,12 @@ class CreateParams(TypedDict): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ + prebilling: NotRequired[ + "SubscriptionScheduleService.CreateParamsPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ start_date: NotRequired["int|Literal['now']"] """ When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. @@ -265,6 +901,12 @@ class CreateParamsPhase(TypedDict): """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ + pause_collection: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -281,10 +923,20 @@ class CreateParamsPhase(TypedDict): """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + trial_settings: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ class CreateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ @@ -323,11 +975,45 @@ class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsPhaseAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -393,11 +1079,43 @@ class CreateParamsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsPhaseDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsPhaseDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -463,6 +1181,12 @@ class CreateParamsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseItemTrial" + ] + """ + Options that configure the trial on the subscription item. + """ class CreateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int @@ -479,11 +1203,43 @@ class CreateParamsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsPhaseItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsPhaseItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -522,6 +1278,22 @@ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class CreateParamsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class CreateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -532,6 +1304,30 @@ class CreateParamsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class CreateParamsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionScheduleService.CreateParamsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class CreateParamsPhaseTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class CreateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class ListParams(TypedDict): canceled_at: NotRequired[ "SubscriptionScheduleService.ListParamsCanceledAt|int" @@ -555,6 +1351,10 @@ class ListParams(TypedDict): """ Only return subscription schedules for the given customer. """ + customer_account: NotRequired[str] + """ + Only return subscription schedules for the given account. + """ 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. @@ -671,6 +1471,12 @@ class RetrieveParams(TypedDict): """ class UpdateParams(TypedDict): + billing_behavior: NotRequired[ + Literal["prorate_on_next_phase", "prorate_up_front"] + ] + """ + Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + """ default_settings: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettings" ] @@ -697,6 +1503,12 @@ class UpdateParams(TypedDict): """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ + prebilling: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPrebilling" + ] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -905,6 +1717,12 @@ class UpdateParamsPhase(TypedDict): """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ + pause_collection: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhasePauseCollection" + ] + """ + If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -925,10 +1743,20 @@ class UpdateParamsPhase(TypedDict): """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ + trial_continuation: NotRequired[Literal["continue", "none"]] + """ + Specify trial behavior when crossing phase boundaries + """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ + trial_settings: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseTrialSettings" + ] + """ + Settings related to subscription trials. + """ class UpdateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ @@ -967,11 +1795,45 @@ class UpdateParamsPhaseAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsPhaseAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsPhaseAddInvoiceItemDiscountDiscountEndDuration( + TypedDict + ): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1037,11 +1899,43 @@ class UpdateParamsPhaseDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsPhaseDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsPhaseDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1107,6 +2001,12 @@ class UpdateParamsPhaseItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseItemTrial" + ] + """ + Options that configure the trial on the subscription item. + """ class UpdateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int @@ -1123,11 +2023,43 @@ class UpdateParamsPhaseItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsPhaseItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsPhaseItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsPhaseItemPriceData(TypedDict): currency: str """ @@ -1166,6 +2098,22 @@ class UpdateParamsPhaseItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class UpdateParamsPhaseItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + + class UpdateParamsPhasePauseCollection(TypedDict): + behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] + """ + The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + """ + class UpdateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -1176,6 +2124,30 @@ class UpdateParamsPhaseTransferData(TypedDict): ID of an existing, connected Stripe account. """ + class UpdateParamsPhaseTrialSettings(TypedDict): + end_behavior: NotRequired[ + "SubscriptionScheduleService.UpdateParamsPhaseTrialSettingsEndBehavior" + ] + """ + Defines how the subscription should behave when a trial ends. + """ + + class UpdateParamsPhaseTrialSettingsEndBehavior(TypedDict): + prorate_up_front: NotRequired[Literal["defer", "include"]] + """ + Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + """ + + class UpdateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + def list( self, params: "SubscriptionScheduleService.ListParams" = {}, @@ -1340,6 +2312,50 @@ async def update_async( ), ) + def amend( + self, + schedule: str, + params: "SubscriptionScheduleService.AmendParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Amends an existing subscription schedule. + """ + return cast( + SubscriptionSchedule, + self._request( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(schedule), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def amend_async( + self, + schedule: str, + params: "SubscriptionScheduleService.AmendParams" = {}, + options: RequestOptions = {}, + ) -> SubscriptionSchedule: + """ + Amends an existing subscription schedule. + """ + return cast( + SubscriptionSchedule, + await self._request_async( + "post", + "/v1/subscription_schedules/{schedule}/amend".format( + schedule=sanitize_id(schedule), + ), + base_address="api", + params=params, + options=options, + ), + ) + def cancel( self, schedule: str, diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 84d636370..68abb5bc6 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -75,13 +75,19 @@ class CreateParams(TypedDict): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - cancel_at: NotRequired[int] + cancel_at: NotRequired[ + "int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -99,10 +105,14 @@ class CreateParams(TypedDict): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - customer: str + customer: NotRequired[str] """ The identifier of the customer to subscribe. """ + customer_account: NotRequired[str] + """ + The identifier of the account to subscribe. + """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. @@ -188,6 +198,10 @@ class CreateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ + prebilling: NotRequired["SubscriptionService.CreateParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -254,11 +268,43 @@ class CreateParamsAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.CreateParamsAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.CreateParamsAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsAddInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -346,11 +392,43 @@ class CreateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.CreateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.CreateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -412,6 +490,10 @@ class CreateParamsItem(TypedDict): """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ + trial: NotRequired["SubscriptionService.CreateParamsItemTrial"] + """ + Define options to configure the trial on the subscription item. + """ class CreateParamsItemBillingThresholds(TypedDict): usage_gte: int @@ -428,11 +510,43 @@ class CreateParamsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.CreateParamsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class CreateParamsItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.CreateParamsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class CreateParamsItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class CreateParamsItemPriceData(TypedDict): currency: str """ @@ -471,6 +585,16 @@ class CreateParamsItemPriceDataRecurring(TypedDict): The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ + class CreateParamsItemTrial(TypedDict): + converts_to: NotRequired[List[str]] + """ + List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID. + """ + type: Literal["free", "paid"] + """ + Determines the type of trial for this item. + """ + class CreateParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions" @@ -479,7 +603,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -516,6 +640,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -649,6 +779,11 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class CreateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -691,7 +826,14 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -706,6 +848,10 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] @@ -717,6 +863,16 @@ class CreateParamsPendingInvoiceItemInterval(TypedDict): The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ + class CreateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class CreateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -777,6 +933,10 @@ class ListParams(TypedDict): """ The ID of the customer whose subscriptions will be retrieved. """ + customer_account: NotRequired[str] + """ + The ID of the account whose subscriptions will be retrieved. + """ 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. @@ -883,6 +1043,16 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(TypedDict): + billing_mode: Literal["flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + class ResumeParams(TypedDict): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ @@ -954,7 +1124,9 @@ class UpdateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ - cancel_at: NotRequired["Literal['']|int"] + cancel_at: NotRequired[ + "Literal['']|int|Literal['max_period_end', 'min_period_end']" + ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ @@ -1061,6 +1233,10 @@ class UpdateParams(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ + prebilling: NotRequired["SubscriptionService.UpdateParamsPrebilling"] + """ + If specified, the invoicing for the given billing cycle iterations will be processed now. + """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] @@ -1127,11 +1303,43 @@ class UpdateParamsAddInvoiceItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.UpdateParamsAddInvoiceItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsAddInvoiceItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.UpdateParamsAddInvoiceItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsAddInvoiceItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsAddInvoiceItemPriceData(TypedDict): currency: str """ @@ -1209,11 +1417,43 @@ class UpdateParamsDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.UpdateParamsDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.UpdateParamsDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ @@ -1303,11 +1543,43 @@ class UpdateParamsItemDiscount(TypedDict): """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ + discount_end: NotRequired[ + "SubscriptionService.UpdateParamsItemDiscountDiscountEnd" + ] + """ + Details to determine how long the discount should be applied for. + """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ + class UpdateParamsItemDiscountDiscountEnd(TypedDict): + duration: NotRequired[ + "SubscriptionService.UpdateParamsItemDiscountDiscountEndDuration" + ] + """ + Time span for the redeemed discount. + """ + timestamp: NotRequired[int] + """ + A precise Unix timestamp for the discount to end. Must be in the future. + """ + type: Literal["duration", "timestamp"] + """ + The type of calculation made to determine when the discount ends. + """ + + class UpdateParamsItemDiscountDiscountEndDuration(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + """ + interval_count: int + """ + The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + """ + class UpdateParamsItemPriceData(TypedDict): currency: str """ @@ -1364,7 +1636,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1401,6 +1673,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ + id_bank_transfer: NotRequired[ + "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer" + ] + """ + This sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice's PaymentIntent. + """ konbini: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] @@ -1534,6 +1812,11 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ + class UpdateParamsPaymentSettingsPaymentMethodOptionsIdBankTransfer( + TypedDict, + ): + pass + class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass @@ -1576,7 +1859,14 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1591,6 +1881,10 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConne """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ + institution: NotRequired[str] + """ + ID of the institution to use to filter for selectable accounts. + """ class UpdateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] @@ -1602,6 +1896,16 @@ class UpdateParamsPendingInvoiceItemInterval(TypedDict): The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ + class UpdateParamsPrebilling(TypedDict): + iterations: int + """ + This is used to determine the number of billing cycles to prebill. + """ + update_behavior: NotRequired[Literal["prebill", "reset"]] + """ + Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`. + """ + class UpdateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ @@ -1906,7 +2210,7 @@ async def list_async( def create( self, - params: "SubscriptionService.CreateParams", + params: "SubscriptionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ @@ -1931,7 +2235,7 @@ def create( async def create_async( self, - params: "SubscriptionService.CreateParams", + params: "SubscriptionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ @@ -1998,6 +2302,50 @@ async def search_async( ), ) + def migrate( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def migrate_async( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + def resume( self, subscription: str, diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 89125eded..f29852534 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -50,6 +50,10 @@ class Owner(StripeObject): """ The customer being referenced when `type` is `customer`. """ + customer_account: Optional[str] + """ + The account being referenced when `type` is `customer`. + """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. @@ -207,6 +211,10 @@ class CreateParamsOwner(TypedDict): """ Customer the tax ID belongs to. Required when `type=customer` """ + customer_account: NotRequired[str] + """ + v2 Account the tax ID belongs to. Can be used in place of `customer` when `type=customer` + """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. @@ -246,6 +254,10 @@ class ListParamsOwner(TypedDict): """ Customer the tax ID belongs to. Required when `type=customer` """ + customer_account: NotRequired[str] + """ + v2 Account the tax ID belongs to. Can be used in place of `customer` when `type=customer` + """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. @@ -269,6 +281,10 @@ class RetrieveParams(RequestOptions): """ ID of the customer. """ + customer_account: Optional[str] + """ + ID of the account. + """ id: str """ Unique identifier for the object. diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index f46d65ebf..4e48d1206 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -148,6 +148,10 @@ class CreateParamsOwner(TypedDict): """ Customer the tax ID belongs to. Required when `type=customer` """ + customer_account: NotRequired[str] + """ + v2 Account the tax ID belongs to. Can be used in place of `customer` when `type=customer` + """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. @@ -187,6 +191,10 @@ class ListParamsOwner(TypedDict): """ Customer the tax ID belongs to. Required when `type=customer` """ + customer_account: NotRequired[str] + """ + v2 Account the tax ID belongs to. Can be used in place of `customer` when `type=customer` + """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. diff --git a/stripe/_tax_service.py b/stripe/_tax_service.py index 05b45e4fd..cb484eb2a 100644 --- a/stripe/_tax_service.py +++ b/stripe/_tax_service.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.tax._association_service import AssociationService from stripe.tax._calculation_service import CalculationService +from stripe.tax._form_service import FormService from stripe.tax._registration_service import RegistrationService from stripe.tax._settings_service import SettingsService from stripe.tax._transaction_service import TransactionService @@ -10,7 +12,9 @@ class TaxService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.associations = AssociationService(self._requestor) self.calculations = CalculationService(self._requestor) + self.forms = FormService(self._requestor) self.registrations = RegistrationService(self._requestor) self.settings = SettingsService(self._requestor) self.transactions = TransactionService(self._requestor) diff --git a/stripe/_terminal_service.py b/stripe/_terminal_service.py index a7dc46543..d960ac18e 100644 --- a/stripe/_terminal_service.py +++ b/stripe/_terminal_service.py @@ -4,6 +4,9 @@ from stripe.terminal._configuration_service import ConfigurationService from stripe.terminal._connection_token_service import ConnectionTokenService from stripe.terminal._location_service import LocationService +from stripe.terminal._reader_collected_data_service import ( + ReaderCollectedDataService, +) from stripe.terminal._reader_service import ReaderService @@ -14,3 +17,6 @@ def __init__(self, requestor): self.connection_tokens = ConnectionTokenService(self._requestor) self.locations = LocationService(self._requestor) self.readers = ReaderService(self._requestor) + self.reader_collected_data = ReaderCollectedDataService( + self._requestor + ) diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 93daa6844..124c1b11f 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -66,6 +66,10 @@ class CreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + fx_quote: NotRequired[str] + """ + The FX rate in the quote is validated and used to convert the transfer amount to the destination currency. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -239,6 +243,10 @@ class RetrieveReversalParams(RequestOptions): """ If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. """ + fx_quote: Optional[str] + """ + The FX Quote used for the transfer. + """ id: str """ Unique identifier for the object. diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index 2cc43856a..7d38a79e9 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -36,6 +36,10 @@ class CreateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + fx_quote: NotRequired[str] + """ + The FX rate in the quote is validated and used to convert the transfer amount to the destination currency. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. diff --git a/stripe/_util.py b/stripe/_util.py index 2ef97e7c2..48c42dd77 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -9,7 +9,7 @@ from stripe._api_mode import ApiMode -from urllib.parse import parse_qsl, quote_plus # noqa: F401 +from urllib.parse import quote_plus # noqa: F401 from typing_extensions import Type, TYPE_CHECKING from typing import ( diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index 93e3e7064..df809f2e4 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -3,10 +3,16 @@ from stripe._stripe_service import StripeService from stripe.v2._billing_service import BillingService from stripe.v2._core_service import CoreService +from stripe.v2._money_management_service import MoneyManagementService +from stripe.v2._payment_service import PaymentService +from stripe.v2._test_helper_service import TestHelperService class V2Services(StripeService): def __init__(self, requestor): super().__init__(requestor) - self.billing = BillingService(self._requestor) self.core = CoreService(self._requestor) + self.money_management = MoneyManagementService(self._requestor) + self.billing = BillingService(self._requestor) + self.test_helpers = TestHelperService(self._requestor) + self.payments = PaymentService(self._requestor) diff --git a/stripe/_version.py b/stripe/_version.py index e77ed636d..d4515e5e7 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "12.2.0" +VERSION = "12.3.0b1" diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 046ea196f..842ef75e5 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -166,15 +166,27 @@ class CreateParams(RequestOptions): "account.external_account.deleted", "account.external_account.updated", "account.updated", + "account_notice.created", + "account_notice.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "balance_settings.updated", "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", + "capital.financing_offer.accepted", + "capital.financing_offer.canceled", + "capital.financing_offer.created", + "capital.financing_offer.expired", + "capital.financing_offer.fully_repaid", + "capital.financing_offer.paid_out", + "capital.financing_offer.rejected", + "capital.financing_offer.replacement_created", + "capital.financing_transaction.created", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", @@ -215,11 +227,15 @@ class CreateParams(RequestOptions): "customer.source.deleted", "customer.source.expiring", "customer.source.updated", + "customer.subscription.collection_paused", + "customer.subscription.collection_resumed", "customer.subscription.created", + "customer.subscription.custom_event", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", + "customer.subscription.price_migration_failed", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", @@ -235,8 +251,11 @@ class CreateParams(RequestOptions): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_inferred_balances", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.session.updated", + "fx_quote.expired", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", @@ -251,7 +270,9 @@ class CreateParams(RequestOptions): "invoice.overdue", "invoice.overpaid", "invoice.paid", + "invoice.payment.overpaid", "invoice.payment_action_required", + "invoice.payment_attempt_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", @@ -275,10 +296,15 @@ class CreateParams(RequestOptions): "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_dispute_settlement_detail.created", + "issuing_dispute_settlement_detail.updated", + "issuing_fraud_liability_debit.created", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", + "issuing_settlement.created", + "issuing_settlement.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -314,15 +340,26 @@ class CreateParams(RequestOptions): "price.created", "price.deleted", "price.updated", + "privacy.redaction_job.canceled", + "privacy.redaction_job.created", + "privacy.redaction_job.ready", + "privacy.redaction_job.succeeded", + "privacy.redaction_job.validation_error", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", + "quote.accept_failed", "quote.accepted", + "quote.accepting", "quote.canceled", "quote.created", + "quote.draft", "quote.finalized", + "quote.reestimate_failed", + "quote.reestimated", + "quote.stale", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", @@ -351,13 +388,16 @@ class CreateParams(RequestOptions): "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", + "subscription_schedule.price_migration_failed", "subscription_schedule.released", "subscription_schedule.updated", + "tax.form.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -466,15 +506,27 @@ class ModifyParams(RequestOptions): "account.external_account.deleted", "account.external_account.updated", "account.updated", + "account_notice.created", + "account_notice.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "balance_settings.updated", "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", + "capital.financing_offer.accepted", + "capital.financing_offer.canceled", + "capital.financing_offer.created", + "capital.financing_offer.expired", + "capital.financing_offer.fully_repaid", + "capital.financing_offer.paid_out", + "capital.financing_offer.rejected", + "capital.financing_offer.replacement_created", + "capital.financing_transaction.created", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", @@ -515,11 +567,15 @@ class ModifyParams(RequestOptions): "customer.source.deleted", "customer.source.expiring", "customer.source.updated", + "customer.subscription.collection_paused", + "customer.subscription.collection_resumed", "customer.subscription.created", + "customer.subscription.custom_event", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", + "customer.subscription.price_migration_failed", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", @@ -535,8 +591,11 @@ class ModifyParams(RequestOptions): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_inferred_balances", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.session.updated", + "fx_quote.expired", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", @@ -551,7 +610,9 @@ class ModifyParams(RequestOptions): "invoice.overdue", "invoice.overpaid", "invoice.paid", + "invoice.payment.overpaid", "invoice.payment_action_required", + "invoice.payment_attempt_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", @@ -575,10 +636,15 @@ class ModifyParams(RequestOptions): "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_dispute_settlement_detail.created", + "issuing_dispute_settlement_detail.updated", + "issuing_fraud_liability_debit.created", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", + "issuing_settlement.created", + "issuing_settlement.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -614,15 +680,26 @@ class ModifyParams(RequestOptions): "price.created", "price.deleted", "price.updated", + "privacy.redaction_job.canceled", + "privacy.redaction_job.created", + "privacy.redaction_job.ready", + "privacy.redaction_job.succeeded", + "privacy.redaction_job.validation_error", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", + "quote.accept_failed", "quote.accepted", + "quote.accepting", "quote.canceled", "quote.created", + "quote.draft", "quote.finalized", + "quote.reestimate_failed", + "quote.reestimated", + "quote.stale", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", @@ -651,13 +728,16 @@ class ModifyParams(RequestOptions): "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", + "subscription_schedule.price_migration_failed", "subscription_schedule.released", "subscription_schedule.updated", + "tax.form.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index c541ef7af..17b4aaf7a 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -147,15 +147,27 @@ class CreateParams(TypedDict): "account.external_account.deleted", "account.external_account.updated", "account.updated", + "account_notice.created", + "account_notice.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "balance_settings.updated", "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", + "capital.financing_offer.accepted", + "capital.financing_offer.canceled", + "capital.financing_offer.created", + "capital.financing_offer.expired", + "capital.financing_offer.fully_repaid", + "capital.financing_offer.paid_out", + "capital.financing_offer.rejected", + "capital.financing_offer.replacement_created", + "capital.financing_transaction.created", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", @@ -196,11 +208,15 @@ class CreateParams(TypedDict): "customer.source.deleted", "customer.source.expiring", "customer.source.updated", + "customer.subscription.collection_paused", + "customer.subscription.collection_resumed", "customer.subscription.created", + "customer.subscription.custom_event", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", + "customer.subscription.price_migration_failed", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", @@ -216,8 +232,11 @@ class CreateParams(TypedDict): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_inferred_balances", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.session.updated", + "fx_quote.expired", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", @@ -232,7 +251,9 @@ class CreateParams(TypedDict): "invoice.overdue", "invoice.overpaid", "invoice.paid", + "invoice.payment.overpaid", "invoice.payment_action_required", + "invoice.payment_attempt_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", @@ -256,10 +277,15 @@ class CreateParams(TypedDict): "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_dispute_settlement_detail.created", + "issuing_dispute_settlement_detail.updated", + "issuing_fraud_liability_debit.created", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", + "issuing_settlement.created", + "issuing_settlement.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -295,15 +321,26 @@ class CreateParams(TypedDict): "price.created", "price.deleted", "price.updated", + "privacy.redaction_job.canceled", + "privacy.redaction_job.created", + "privacy.redaction_job.ready", + "privacy.redaction_job.succeeded", + "privacy.redaction_job.validation_error", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", + "quote.accept_failed", "quote.accepted", + "quote.accepting", "quote.canceled", "quote.created", + "quote.draft", "quote.finalized", + "quote.reestimate_failed", + "quote.reestimated", + "quote.stale", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", @@ -332,13 +369,16 @@ class CreateParams(TypedDict): "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", + "subscription_schedule.price_migration_failed", "subscription_schedule.released", "subscription_schedule.updated", + "tax.form.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -453,15 +493,27 @@ class UpdateParams(TypedDict): "account.external_account.deleted", "account.external_account.updated", "account.updated", + "account_notice.created", + "account_notice.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", + "balance_settings.updated", "billing.alert.triggered", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", + "capital.financing_offer.accepted", + "capital.financing_offer.canceled", + "capital.financing_offer.created", + "capital.financing_offer.expired", + "capital.financing_offer.fully_repaid", + "capital.financing_offer.paid_out", + "capital.financing_offer.rejected", + "capital.financing_offer.replacement_created", + "capital.financing_transaction.created", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", @@ -502,11 +554,15 @@ class UpdateParams(TypedDict): "customer.source.deleted", "customer.source.expiring", "customer.source.updated", + "customer.subscription.collection_paused", + "customer.subscription.collection_resumed", "customer.subscription.created", + "customer.subscription.custom_event", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", + "customer.subscription.price_migration_failed", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", @@ -522,8 +578,11 @@ class UpdateParams(TypedDict): "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_inferred_balances", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.session.updated", + "fx_quote.expired", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", @@ -538,7 +597,9 @@ class UpdateParams(TypedDict): "invoice.overdue", "invoice.overpaid", "invoice.paid", + "invoice.payment.overpaid", "invoice.payment_action_required", + "invoice.payment_attempt_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", @@ -562,10 +623,15 @@ class UpdateParams(TypedDict): "issuing_dispute.funds_rescinded", "issuing_dispute.submitted", "issuing_dispute.updated", + "issuing_dispute_settlement_detail.created", + "issuing_dispute_settlement_detail.updated", + "issuing_fraud_liability_debit.created", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", + "issuing_settlement.created", + "issuing_settlement.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", @@ -601,15 +667,26 @@ class UpdateParams(TypedDict): "price.created", "price.deleted", "price.updated", + "privacy.redaction_job.canceled", + "privacy.redaction_job.created", + "privacy.redaction_job.ready", + "privacy.redaction_job.succeeded", + "privacy.redaction_job.validation_error", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", + "quote.accept_failed", "quote.accepted", + "quote.accepting", "quote.canceled", "quote.created", + "quote.draft", "quote.finalized", + "quote.reestimate_failed", + "quote.reestimated", + "quote.stale", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", @@ -638,13 +715,16 @@ class UpdateParams(TypedDict): "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", + "subscription_schedule.price_migration_failed", "subscription_schedule.released", "subscription_schedule.updated", + "tax.form.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index a6c38ca89..76f81f148 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -20,6 +20,7 @@ apps, billing, billing_portal, + capital, checkout, climate, entitlements, @@ -27,6 +28,7 @@ forwarding, identity, issuing, + privacy, radar, reporting, sigma, @@ -37,6 +39,7 @@ ) from stripe.api_resources.account import Account from stripe.api_resources.account_link import AccountLink + from stripe.api_resources.account_notice import AccountNotice from stripe.api_resources.account_session import AccountSession from stripe.api_resources.apple_pay_domain import ApplePayDomain from stripe.api_resources.application import Application @@ -45,6 +48,7 @@ ApplicationFeeRefund, ) from stripe.api_resources.balance import Balance + from stripe.api_resources.balance_settings import BalanceSettings from stripe.api_resources.balance_transaction import BalanceTransaction from stripe.api_resources.bank_account import BankAccount from stripe.api_resources.capability import Capability @@ -75,6 +79,7 @@ from stripe.api_resources.file import File from stripe.api_resources.file_link import FileLink from stripe.api_resources.funding_instructions import FundingInstructions + from stripe.api_resources.fx_quote import FxQuote from stripe.api_resources.invoice import Invoice from stripe.api_resources.invoice_item import InvoiceItem from stripe.api_resources.invoice_line_item import InvoiceLineItem @@ -86,13 +91,22 @@ from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink from stripe.api_resources.mandate import Mandate + from stripe.api_resources.margin import Margin + from stripe.api_resources.order import Order + from stripe.api_resources.payment_attempt_record import ( + PaymentAttemptRecord, + ) from stripe.api_resources.payment_intent import PaymentIntent + from stripe.api_resources.payment_intent_amount_details_line_item import ( + PaymentIntentAmountDetailsLineItem, + ) from stripe.api_resources.payment_link import PaymentLink from stripe.api_resources.payment_method import PaymentMethod from stripe.api_resources.payment_method_configuration import ( PaymentMethodConfiguration, ) from stripe.api_resources.payment_method_domain import PaymentMethodDomain + from stripe.api_resources.payment_record import PaymentRecord from stripe.api_resources.payout import Payout from stripe.api_resources.person import Person from stripe.api_resources.plan import Plan @@ -101,6 +115,11 @@ from stripe.api_resources.product_feature import ProductFeature from stripe.api_resources.promotion_code import PromotionCode from stripe.api_resources.quote import Quote + from stripe.api_resources.quote_line import QuoteLine + from stripe.api_resources.quote_preview_invoice import QuotePreviewInvoice + from stripe.api_resources.quote_preview_subscription_schedule import ( + QuotePreviewSubscriptionSchedule, + ) from stripe.api_resources.refund import Refund from stripe.api_resources.reserve_transaction import ReserveTransaction from stripe.api_resources.reversal import Reversal diff --git a/stripe/api_resources/account_notice.py b/stripe/api_resources/account_notice.py new file mode 100644 index 000000000..5e2b3be80 --- /dev/null +++ b/stripe/api_resources/account_notice.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.account_notice package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.account_notice import AccountNotice + To: + from stripe import AccountNotice + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._account_notice import ( # noqa + AccountNotice, + ) diff --git a/stripe/api_resources/balance_settings.py b/stripe/api_resources/balance_settings.py new file mode 100644 index 000000000..8a0fa0311 --- /dev/null +++ b/stripe/api_resources/balance_settings.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.balance_settings package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.balance_settings import BalanceSettings + To: + from stripe import BalanceSettings + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._balance_settings import ( # noqa + BalanceSettings, + ) diff --git a/stripe/api_resources/capital/__init__.py b/stripe/api_resources/capital/__init__.py new file mode 100644 index 000000000..04241cada --- /dev/null +++ b/stripe/api_resources/capital/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.capital package is deprecated, please change your + imports to import from stripe.capital directly. + From: + from stripe.api_resources.capital import ... + To: + from stripe.capital import ... + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.api_resources.capital.financing_offer import FinancingOffer + from stripe.api_resources.capital.financing_summary import FinancingSummary + from stripe.api_resources.capital.financing_transaction import ( + FinancingTransaction, + ) diff --git a/stripe/api_resources/capital/financing_offer.py b/stripe/api_resources/capital/financing_offer.py new file mode 100644 index 000000000..711d0409d --- /dev/null +++ b/stripe/api_resources/capital/financing_offer.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.capital.financing_offer package is deprecated, please change your + imports to import from stripe.capital directly. + From: + from stripe.api_resources.capital.financing_offer import FinancingOffer + To: + from stripe.capital import FinancingOffer + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.capital._financing_offer import ( # noqa + FinancingOffer, + ) diff --git a/stripe/api_resources/capital/financing_summary.py b/stripe/api_resources/capital/financing_summary.py new file mode 100644 index 000000000..7c84ec7b6 --- /dev/null +++ b/stripe/api_resources/capital/financing_summary.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.capital.financing_summary package is deprecated, please change your + imports to import from stripe.capital directly. + From: + from stripe.api_resources.capital.financing_summary import FinancingSummary + To: + from stripe.capital import FinancingSummary + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.capital._financing_summary import ( # noqa + FinancingSummary, + ) diff --git a/stripe/api_resources/capital/financing_transaction.py b/stripe/api_resources/capital/financing_transaction.py new file mode 100644 index 000000000..c49a3596c --- /dev/null +++ b/stripe/api_resources/capital/financing_transaction.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.capital.financing_transaction package is deprecated, please change your + imports to import from stripe.capital directly. + From: + from stripe.api_resources.capital.financing_transaction import FinancingTransaction + To: + from stripe.capital import FinancingTransaction + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.capital._financing_transaction import ( # noqa + FinancingTransaction, + ) diff --git a/stripe/api_resources/financial_connections/__init__.py b/stripe/api_resources/financial_connections/__init__.py index cb37648dd..3f95fee9c 100644 --- a/stripe/api_resources/financial_connections/__init__.py +++ b/stripe/api_resources/financial_connections/__init__.py @@ -17,12 +17,18 @@ ) if not TYPE_CHECKING: from stripe.api_resources.financial_connections.account import Account + from stripe.api_resources.financial_connections.account_inferred_balance import ( + AccountInferredBalance, + ) from stripe.api_resources.financial_connections.account_owner import ( AccountOwner, ) from stripe.api_resources.financial_connections.account_ownership import ( AccountOwnership, ) + from stripe.api_resources.financial_connections.institution import ( + Institution, + ) from stripe.api_resources.financial_connections.session import Session from stripe.api_resources.financial_connections.transaction import ( Transaction, diff --git a/stripe/api_resources/financial_connections/account_inferred_balance.py b/stripe/api_resources/financial_connections/account_inferred_balance.py new file mode 100644 index 000000000..4a4e1a9ce --- /dev/null +++ b/stripe/api_resources/financial_connections/account_inferred_balance.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.financial_connections.account_inferred_balance package is deprecated, please change your + imports to import from stripe.financial_connections directly. + From: + from stripe.api_resources.financial_connections.account_inferred_balance import AccountInferredBalance + To: + from stripe.financial_connections import AccountInferredBalance + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.financial_connections._account_inferred_balance import ( # noqa + AccountInferredBalance, + ) diff --git a/stripe/api_resources/financial_connections/institution.py b/stripe/api_resources/financial_connections/institution.py new file mode 100644 index 000000000..6f5598aa6 --- /dev/null +++ b/stripe/api_resources/financial_connections/institution.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.financial_connections.institution package is deprecated, please change your + imports to import from stripe.financial_connections directly. + From: + from stripe.api_resources.financial_connections.institution import Institution + To: + from stripe.financial_connections import Institution + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.financial_connections._institution import ( # noqa + Institution, + ) diff --git a/stripe/api_resources/fx_quote.py b/stripe/api_resources/fx_quote.py new file mode 100644 index 000000000..f7b67a25d --- /dev/null +++ b/stripe/api_resources/fx_quote.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.fx_quote package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.fx_quote import FxQuote + To: + from stripe import FxQuote + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._fx_quote import ( # noqa + FxQuote, + ) diff --git a/stripe/api_resources/issuing/__init__.py b/stripe/api_resources/issuing/__init__.py index 33190567e..eb7e8c0eb 100644 --- a/stripe/api_resources/issuing/__init__.py +++ b/stripe/api_resources/issuing/__init__.py @@ -19,10 +19,20 @@ from stripe.api_resources.issuing.authorization import Authorization from stripe.api_resources.issuing.card import Card from stripe.api_resources.issuing.cardholder import Cardholder + from stripe.api_resources.issuing.credit_underwriting_record import ( + CreditUnderwritingRecord, + ) from stripe.api_resources.issuing.dispute import Dispute + from stripe.api_resources.issuing.dispute_settlement_detail import ( + DisputeSettlementDetail, + ) + from stripe.api_resources.issuing.fraud_liability_debit import ( + FraudLiabilityDebit, + ) from stripe.api_resources.issuing.personalization_design import ( PersonalizationDesign, ) from stripe.api_resources.issuing.physical_bundle import PhysicalBundle + from stripe.api_resources.issuing.settlement import Settlement from stripe.api_resources.issuing.token import Token from stripe.api_resources.issuing.transaction import Transaction diff --git a/stripe/api_resources/issuing/credit_underwriting_record.py b/stripe/api_resources/issuing/credit_underwriting_record.py new file mode 100644 index 000000000..e267c197c --- /dev/null +++ b/stripe/api_resources/issuing/credit_underwriting_record.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.credit_underwriting_record package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.credit_underwriting_record import CreditUnderwritingRecord + To: + from stripe.issuing import CreditUnderwritingRecord + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._credit_underwriting_record import ( # noqa + CreditUnderwritingRecord, + ) diff --git a/stripe/api_resources/issuing/dispute_settlement_detail.py b/stripe/api_resources/issuing/dispute_settlement_detail.py new file mode 100644 index 000000000..73b932877 --- /dev/null +++ b/stripe/api_resources/issuing/dispute_settlement_detail.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.dispute_settlement_detail package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.dispute_settlement_detail import DisputeSettlementDetail + To: + from stripe.issuing import DisputeSettlementDetail + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._dispute_settlement_detail import ( # noqa + DisputeSettlementDetail, + ) diff --git a/stripe/api_resources/issuing/fraud_liability_debit.py b/stripe/api_resources/issuing/fraud_liability_debit.py new file mode 100644 index 000000000..024b2e904 --- /dev/null +++ b/stripe/api_resources/issuing/fraud_liability_debit.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.fraud_liability_debit package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.fraud_liability_debit import FraudLiabilityDebit + To: + from stripe.issuing import FraudLiabilityDebit + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._fraud_liability_debit import ( # noqa + FraudLiabilityDebit, + ) diff --git a/stripe/api_resources/issuing/settlement.py b/stripe/api_resources/issuing/settlement.py new file mode 100644 index 000000000..54e88615d --- /dev/null +++ b/stripe/api_resources/issuing/settlement.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.issuing.settlement package is deprecated, please change your + imports to import from stripe.issuing directly. + From: + from stripe.api_resources.issuing.settlement import Settlement + To: + from stripe.issuing import Settlement + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.issuing._settlement import ( # noqa + Settlement, + ) diff --git a/stripe/api_resources/margin.py b/stripe/api_resources/margin.py new file mode 100644 index 000000000..2a94240be --- /dev/null +++ b/stripe/api_resources/margin.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.margin package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.margin import Margin + To: + from stripe import Margin + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._margin import ( # noqa + Margin, + ) diff --git a/stripe/api_resources/order.py b/stripe/api_resources/order.py new file mode 100644 index 000000000..559962f48 --- /dev/null +++ b/stripe/api_resources/order.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.order package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.order import Order + To: + from stripe import Order + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._order import ( # noqa + Order, + ) diff --git a/stripe/api_resources/payment_attempt_record.py b/stripe/api_resources/payment_attempt_record.py new file mode 100644 index 000000000..5c6a86fe8 --- /dev/null +++ b/stripe/api_resources/payment_attempt_record.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.payment_attempt_record package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.payment_attempt_record import PaymentAttemptRecord + To: + from stripe import PaymentAttemptRecord + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._payment_attempt_record import ( # noqa + PaymentAttemptRecord, + ) diff --git a/stripe/api_resources/payment_intent_amount_details_line_item.py b/stripe/api_resources/payment_intent_amount_details_line_item.py new file mode 100644 index 000000000..8e2a1545e --- /dev/null +++ b/stripe/api_resources/payment_intent_amount_details_line_item.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.payment_intent_amount_details_line_item package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.payment_intent_amount_details_line_item import PaymentIntentAmountDetailsLineItem + To: + from stripe import PaymentIntentAmountDetailsLineItem + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._payment_intent_amount_details_line_item import ( # noqa + PaymentIntentAmountDetailsLineItem, + ) diff --git a/stripe/api_resources/payment_record.py b/stripe/api_resources/payment_record.py new file mode 100644 index 000000000..7e72b796a --- /dev/null +++ b/stripe/api_resources/payment_record.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.payment_record package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.payment_record import PaymentRecord + To: + from stripe import PaymentRecord + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._payment_record import ( # noqa + PaymentRecord, + ) diff --git a/stripe/api_resources/privacy/__init__.py b/stripe/api_resources/privacy/__init__.py new file mode 100644 index 000000000..9366d685f --- /dev/null +++ b/stripe/api_resources/privacy/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.privacy package is deprecated, please change your + imports to import from stripe.privacy directly. + From: + from stripe.api_resources.privacy import ... + To: + from stripe.privacy import ... + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.api_resources.privacy.redaction_job import RedactionJob + from stripe.api_resources.privacy.redaction_job_validation_error import ( + RedactionJobValidationError, + ) diff --git a/stripe/api_resources/privacy/redaction_job.py b/stripe/api_resources/privacy/redaction_job.py new file mode 100644 index 000000000..2cacf908e --- /dev/null +++ b/stripe/api_resources/privacy/redaction_job.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.privacy.redaction_job package is deprecated, please change your + imports to import from stripe.privacy directly. + From: + from stripe.api_resources.privacy.redaction_job import RedactionJob + To: + from stripe.privacy import RedactionJob + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.privacy._redaction_job import ( # noqa + RedactionJob, + ) diff --git a/stripe/api_resources/privacy/redaction_job_validation_error.py b/stripe/api_resources/privacy/redaction_job_validation_error.py new file mode 100644 index 000000000..bc0630cea --- /dev/null +++ b/stripe/api_resources/privacy/redaction_job_validation_error.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.privacy.redaction_job_validation_error package is deprecated, please change your + imports to import from stripe.privacy directly. + From: + from stripe.api_resources.privacy.redaction_job_validation_error import RedactionJobValidationError + To: + from stripe.privacy import RedactionJobValidationError + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.privacy._redaction_job_validation_error import ( # noqa + RedactionJobValidationError, + ) diff --git a/stripe/api_resources/quote_line.py b/stripe/api_resources/quote_line.py new file mode 100644 index 000000000..fbca0c6cd --- /dev/null +++ b/stripe/api_resources/quote_line.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.quote_line package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.quote_line import QuoteLine + To: + from stripe import QuoteLine + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._quote_line import ( # noqa + QuoteLine, + ) diff --git a/stripe/api_resources/quote_preview_invoice.py b/stripe/api_resources/quote_preview_invoice.py new file mode 100644 index 000000000..4f4fda381 --- /dev/null +++ b/stripe/api_resources/quote_preview_invoice.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.quote_preview_invoice package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.quote_preview_invoice import QuotePreviewInvoice + To: + from stripe import QuotePreviewInvoice + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._quote_preview_invoice import ( # noqa + QuotePreviewInvoice, + ) diff --git a/stripe/api_resources/quote_preview_subscription_schedule.py b/stripe/api_resources/quote_preview_subscription_schedule.py new file mode 100644 index 000000000..97390da55 --- /dev/null +++ b/stripe/api_resources/quote_preview_subscription_schedule.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.quote_preview_subscription_schedule package is deprecated, please change your + imports to import from stripe directly. + From: + from stripe.api_resources.quote_preview_subscription_schedule import QuotePreviewSubscriptionSchedule + To: + from stripe import QuotePreviewSubscriptionSchedule + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe._quote_preview_subscription_schedule import ( # noqa + QuotePreviewSubscriptionSchedule, + ) diff --git a/stripe/api_resources/tax/__init__.py b/stripe/api_resources/tax/__init__.py index aba7ea025..404b94134 100644 --- a/stripe/api_resources/tax/__init__.py +++ b/stripe/api_resources/tax/__init__.py @@ -16,10 +16,12 @@ stacklevel=2, ) if not TYPE_CHECKING: + from stripe.api_resources.tax.association import Association from stripe.api_resources.tax.calculation import Calculation from stripe.api_resources.tax.calculation_line_item import ( CalculationLineItem, ) + from stripe.api_resources.tax.form import Form from stripe.api_resources.tax.registration import Registration from stripe.api_resources.tax.settings import Settings from stripe.api_resources.tax.transaction import Transaction diff --git a/stripe/api_resources/tax/association.py b/stripe/api_resources/tax/association.py new file mode 100644 index 000000000..d050740d9 --- /dev/null +++ b/stripe/api_resources/tax/association.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.tax.association package is deprecated, please change your + imports to import from stripe.tax directly. + From: + from stripe.api_resources.tax.association import Association + To: + from stripe.tax import Association + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.tax._association import ( # noqa + Association, + ) diff --git a/stripe/api_resources/tax/form.py b/stripe/api_resources/tax/form.py new file mode 100644 index 000000000..8f5ae4fc8 --- /dev/null +++ b/stripe/api_resources/tax/form.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.tax.form package is deprecated, please change your + imports to import from stripe.tax directly. + From: + from stripe.api_resources.tax.form import Form + To: + from stripe.tax import Form + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.tax._form import ( # noqa + Form, + ) diff --git a/stripe/api_resources/terminal/__init__.py b/stripe/api_resources/terminal/__init__.py index 7e4cab631..e19cc7ac5 100644 --- a/stripe/api_resources/terminal/__init__.py +++ b/stripe/api_resources/terminal/__init__.py @@ -20,3 +20,6 @@ from stripe.api_resources.terminal.connection_token import ConnectionToken from stripe.api_resources.terminal.location import Location from stripe.api_resources.terminal.reader import Reader + from stripe.api_resources.terminal.reader_collected_data import ( + ReaderCollectedData, + ) diff --git a/stripe/api_resources/terminal/reader_collected_data.py b/stripe/api_resources/terminal/reader_collected_data.py new file mode 100644 index 000000000..e25ac2207 --- /dev/null +++ b/stripe/api_resources/terminal/reader_collected_data.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TYPE_CHECKING +from warnings import warn + +warn( + """ + The stripe.api_resources.terminal.reader_collected_data package is deprecated, please change your + imports to import from stripe.terminal directly. + From: + from stripe.api_resources.terminal.reader_collected_data import ReaderCollectedData + To: + from stripe.terminal import ReaderCollectedData + """, + DeprecationWarning, + stacklevel=2, +) +if not TYPE_CHECKING: + from stripe.terminal._reader_collected_data import ( # noqa + ReaderCollectedData, + ) diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index e94dc59dd..488c4340e 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -77,10 +77,14 @@ class Monetary(StripeObject): } class RetrieveParams(RequestOptions): - customer: str + customer: NotRequired[str] """ The customer for which to fetch credit balance summary. """ + customer_account: NotRequired[str] + """ + The account for which to fetch credit balance summary. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -134,6 +138,10 @@ class RetrieveParamsFilterApplicabilityScopePrice(TypedDict): """ The customer the balance is for. """ + customer_account: Optional[str] + """ + The account the balance is for. + """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. diff --git a/stripe/billing/_credit_balance_summary_service.py b/stripe/billing/_credit_balance_summary_service.py index 0f6b85720..ed0c29fd4 100644 --- a/stripe/billing/_credit_balance_summary_service.py +++ b/stripe/billing/_credit_balance_summary_service.py @@ -9,10 +9,14 @@ class CreditBalanceSummaryService(StripeService): class RetrieveParams(TypedDict): - customer: str + customer: NotRequired[str] """ The customer for which to fetch credit balance summary. """ + customer_account: NotRequired[str] + """ + The account for which to fetch credit balance summary. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py index 630cb3693..2e381d9a5 100644 --- a/stripe/billing/_credit_balance_transaction.py +++ b/stripe/billing/_credit_balance_transaction.py @@ -124,10 +124,14 @@ class ListParams(RequestOptions): """ The credit grant for which to fetch credit balance transactions. """ - customer: str + customer: NotRequired[str] """ The customer for which to fetch credit balance transactions. """ + customer_account: NotRequired[str] + """ + The account for which to fetch credit balance transactions. + """ 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. diff --git a/stripe/billing/_credit_balance_transaction_service.py b/stripe/billing/_credit_balance_transaction_service.py index 4aa061ffb..88b6b5c7f 100644 --- a/stripe/billing/_credit_balance_transaction_service.py +++ b/stripe/billing/_credit_balance_transaction_service.py @@ -15,10 +15,14 @@ class ListParams(TypedDict): """ The credit grant for which to fetch credit balance transactions. """ - customer: str + customer: NotRequired[str] """ The customer for which to fetch credit balance transactions. """ + customer_account: NotRequired[str] + """ + The account for which to fetch credit balance transactions. + """ 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. @@ -44,7 +48,7 @@ class RetrieveParams(TypedDict): def list( self, - params: "CreditBalanceTransactionService.ListParams", + params: "CreditBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditBalanceTransaction]: """ @@ -63,7 +67,7 @@ def list( async def list_async( self, - params: "CreditBalanceTransactionService.ListParams", + params: "CreditBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditBalanceTransaction]: """ diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 2d2f52c92..ea5aa83a9 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -92,10 +92,14 @@ class CreateParams(RequestOptions): """ The category of this credit grant. """ - customer: str + customer: NotRequired[str] """ ID of the customer to receive the billing credits. """ + customer_account: NotRequired[str] + """ + ID of the account to receive the billing credits. + """ effective_at: NotRequired[int] """ The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified. @@ -176,6 +180,10 @@ class ListParams(RequestOptions): """ Only return credit grants for this customer. """ + customer_account: NotRequired[str] + """ + Only return credit grants for this account. + """ 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. @@ -233,6 +241,10 @@ class VoidGrantParams(RequestOptions): """ ID of the customer receiving the billing credits. """ + customer_account: Optional[str] + """ + ID of the account receiving the billing credits + """ effective_at: Optional[int] """ The time when the billing credits become effective-when they're eligible for use. diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index 4ebbe19e9..2b3617adb 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -25,10 +25,14 @@ class CreateParams(TypedDict): """ The category of this credit grant. """ - customer: str + customer: NotRequired[str] """ ID of the customer to receive the billing credits. """ + customer_account: NotRequired[str] + """ + ID of the account to receive the billing credits. + """ effective_at: NotRequired[int] """ The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified. @@ -111,6 +115,10 @@ class ListParams(TypedDict): """ Only return credit grants for this customer. """ + customer_account: NotRequired[str] + """ + Only return credit grants for this account. + """ 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. diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index a55fcde2d..81d44cb26 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -177,10 +177,14 @@ class CreateParams(RequestOptions): """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ - customer: str + customer: NotRequired[str] """ The ID of an existing customer. """ + customer_account: NotRequired[str] + """ + The ID of an existing account. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -409,6 +413,10 @@ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): """ The ID of the customer for this session. """ + customer_account: Optional[str] + """ + The ID of the account for this session. + """ flow: Optional[Flow] """ Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index d06d54667..21ce06da5 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -13,10 +13,14 @@ class CreateParams(TypedDict): """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ - customer: str + customer: NotRequired[str] """ The ID of an existing customer. """ + customer_account: NotRequired[str] + """ + The ID of an existing account. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -235,7 +239,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): def create( self, - params: "SessionService.CreateParams", + params: "SessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Session: """ @@ -254,7 +258,7 @@ def create( async def create_async( self, - params: "SessionService.CreateParams", + params: "SessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Session: """ diff --git a/stripe/capital/__init__.py b/stripe/capital/__init__.py new file mode 100644 index 000000000..10da75b7d --- /dev/null +++ b/stripe/capital/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.capital._financing_offer import FinancingOffer as FinancingOffer +from stripe.capital._financing_offer_service import ( + FinancingOfferService as FinancingOfferService, +) +from stripe.capital._financing_summary import ( + FinancingSummary as FinancingSummary, +) +from stripe.capital._financing_summary_service import ( + FinancingSummaryService as FinancingSummaryService, +) +from stripe.capital._financing_transaction import ( + FinancingTransaction as FinancingTransaction, +) +from stripe.capital._financing_transaction_service import ( + FinancingTransactionService as FinancingTransactionService, +) diff --git a/stripe/capital/_financing_offer.py b/stripe/capital/_financing_offer.py new file mode 100644 index 000000000..12ba9a8d1 --- /dev/null +++ b/stripe/capital/_financing_offer.py @@ -0,0 +1,419 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class FinancingOffer(ListableAPIResource["FinancingOffer"]): + """ + This is an object representing an offer of financing from + Stripe Capital to a Connect subaccount. + """ + + OBJECT_NAME: ClassVar[Literal["capital.financing_offer"]] = ( + "capital.financing_offer" + ) + + class AcceptedTerms(StripeObject): + advance_amount: int + """ + Amount of financing offered, in minor units. For example, $1,000 USD will be represented as 100000. + """ + currency: str + """ + Currency that the financing offer is transacted in. For example, `usd`. + """ + fee_amount: int + """ + Fixed fee amount, in minor units. For example, $100 USD will be represented as 10000. + """ + previous_financing_fee_discount_amount: Optional[int] + """ + Populated when the `product_type` of the `financingoffer` is `refill`. + Represents the discount amount on remaining premium for the existing loan at payout time. + """ + withhold_rate: float + """ + Per-transaction rate at which Stripe will withhold funds to repay the financing. + """ + + class OfferedTerms(StripeObject): + advance_amount: int + """ + Amount of financing offered, in minor units. For example, $1,000 USD will be represented as 100000. + """ + campaign_type: Literal[ + "newly_eligible_user", "previously_eligible_user", "repeat_user" + ] + """ + Describes the type of user the offer is being extended to. + """ + currency: str + """ + Currency that the financing offer is transacted in. For example, `usd`. + """ + fee_amount: int + """ + Fixed fee amount, in minor units. For example, $100 USD will be represented as 10000. + """ + previous_financing_fee_discount_rate: Optional[float] + """ + Populated when the `product_type` of the `financingoffer` is `refill`. + Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer` + is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate + and the remaining fee. + """ + withhold_rate: float + """ + Per-transaction rate at which Stripe will withhold funds to repay the financing. + """ + + class ListParams(RequestOptions): + connected_account: NotRequired[str] + """ + limit list to offers belonging to given connected account + """ + created: NotRequired["FinancingOffer.ListParamsCreated|int"] + """ + Only return offers that were created during the given date interval. + """ + 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. + """ + status: NotRequired[ + Literal[ + "accepted", + "canceled", + "completed", + "delivered", + "expired", + "fully_repaid", + "paid_out", + "rejected", + "revoked", + "undelivered", + ] + ] + """ + limit list to offers with given status + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class MarkDeliveredParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + accepted_terms: Optional[AcceptedTerms] + """ + This is an object representing the terms of an offer of financing from + Stripe Capital to a Connected account. This resource represents + the terms accepted by the Connected account, which may differ from those + offered. + """ + account: str + """ + The ID of the merchant associated with this financing object. + """ + charged_off_at: Optional[int] + """ + The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch. + """ + created: int + """ + Time at which the offer was created. Given in seconds since unix epoch. + """ + expires_after: float + """ + Time at which the offer expires. Given in seconds since unix epoch. + """ + financing_type: Optional[Literal["cash_advance", "flex_loan"]] + """ + The type of financing being offered. + """ + id: str + """ + A unique identifier for the financing object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["capital.financing_offer"] + """ + The object type: financing_offer. + """ + offered_terms: Optional[OfferedTerms] + """ + This is an object representing the terms of an offer of financing from + Stripe Capital to a Connected account. This resource represents + both the terms offered to the Connected account. + """ + product_type: Optional[Literal["refill", "standard"]] + """ + Financing product identifier. + """ + replacement: Optional[str] + """ + The ID of the financing offer that replaced this offer. + """ + replacement_for: Optional[str] + """ + The ID of the financing offer that this offer is a replacement for. + """ + status: Literal[ + "accepted", + "canceled", + "completed", + "delivered", + "expired", + "fully_repaid", + "paid_out", + "rejected", + "replaced", + "undelivered", + ] + """ + The current status of the offer. + """ + type: Optional[Literal["cash_advance", "fixed_term_loan", "flex_loan"]] + """ + See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type). + """ + + @classmethod + def list( + cls, **params: Unpack["FinancingOffer.ListParams"] + ) -> ListObject["FinancingOffer"]: + """ + Retrieves the financing offers available for Connected accounts that belong to your platform. + """ + 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["FinancingOffer.ListParams"] + ) -> ListObject["FinancingOffer"]: + """ + Retrieves the financing offers available for Connected accounts that belong to your platform. + """ + 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 _cls_mark_delivered( + cls, + financing_offer: str, + **params: Unpack["FinancingOffer.MarkDeliveredParams"], + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + "FinancingOffer", + cls._static_request( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(financing_offer) + ), + params=params, + ), + ) + + @overload + @staticmethod + def mark_delivered( + financing_offer: str, + **params: Unpack["FinancingOffer.MarkDeliveredParams"], + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + ... + + @overload + def mark_delivered( + self, **params: Unpack["FinancingOffer.MarkDeliveredParams"] + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + ... + + @class_method_variant("_cls_mark_delivered") + def mark_delivered( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancingOffer.MarkDeliveredParams"] + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + "FinancingOffer", + self._request( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_mark_delivered_async( + cls, + financing_offer: str, + **params: Unpack["FinancingOffer.MarkDeliveredParams"], + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + "FinancingOffer", + await cls._static_request_async( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(financing_offer) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def mark_delivered_async( + financing_offer: str, + **params: Unpack["FinancingOffer.MarkDeliveredParams"], + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + ... + + @overload + async def mark_delivered_async( + self, **params: Unpack["FinancingOffer.MarkDeliveredParams"] + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + ... + + @class_method_variant("_cls_mark_delivered_async") + async def mark_delivered_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancingOffer.MarkDeliveredParams"] + ) -> "FinancingOffer": + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + "FinancingOffer", + await self._request_async( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["FinancingOffer.RetrieveParams"] + ) -> "FinancingOffer": + """ + Get the details of the financing offer + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FinancingOffer.RetrieveParams"] + ) -> "FinancingOffer": + """ + Get the details of the financing offer + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "accepted_terms": AcceptedTerms, + "offered_terms": OfferedTerms, + } diff --git a/stripe/capital/_financing_offer_service.py b/stripe/capital/_financing_offer_service.py new file mode 100644 index 000000000..192569bbb --- /dev/null +++ b/stripe/capital/_financing_offer_service.py @@ -0,0 +1,212 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.capital._financing_offer import FinancingOffer +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class FinancingOfferService(StripeService): + class ListParams(TypedDict): + connected_account: NotRequired[str] + """ + limit list to offers belonging to given connected account + """ + created: NotRequired["FinancingOfferService.ListParamsCreated|int"] + """ + Only return offers that were created during the given date interval. + """ + 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. + """ + status: NotRequired[ + Literal[ + "accepted", + "canceled", + "completed", + "delivered", + "expired", + "fully_repaid", + "paid_out", + "rejected", + "revoked", + "undelivered", + ] + ] + """ + limit list to offers with given status + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class MarkDeliveredParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "FinancingOfferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancingOffer]: + """ + Retrieves the financing offers available for Connected accounts that belong to your platform. + """ + return cast( + ListObject[FinancingOffer], + self._request( + "get", + "/v1/capital/financing_offers", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FinancingOfferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancingOffer]: + """ + Retrieves the financing offers available for Connected accounts that belong to your platform. + """ + return cast( + ListObject[FinancingOffer], + await self._request_async( + "get", + "/v1/capital/financing_offers", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + financing_offer: str, + params: "FinancingOfferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingOffer: + """ + Get the details of the financing offer + """ + return cast( + FinancingOffer, + self._request( + "get", + "/v1/capital/financing_offers/{financing_offer}".format( + financing_offer=sanitize_id(financing_offer), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + financing_offer: str, + params: "FinancingOfferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingOffer: + """ + Get the details of the financing offer + """ + return cast( + FinancingOffer, + await self._request_async( + "get", + "/v1/capital/financing_offers/{financing_offer}".format( + financing_offer=sanitize_id(financing_offer), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def mark_delivered( + self, + financing_offer: str, + params: "FinancingOfferService.MarkDeliveredParams" = {}, + options: RequestOptions = {}, + ) -> FinancingOffer: + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + FinancingOffer, + self._request( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(financing_offer), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def mark_delivered_async( + self, + financing_offer: str, + params: "FinancingOfferService.MarkDeliveredParams" = {}, + options: RequestOptions = {}, + ) -> FinancingOffer: + """ + Acknowledges that platform has received and delivered the financing_offer to + the intended merchant recipient. + """ + return cast( + FinancingOffer, + await self._request_async( + "post", + "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( + financing_offer=sanitize_id(financing_offer), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/capital/_financing_summary.py b/stripe/capital/_financing_summary.py new file mode 100644 index 000000000..92db68015 --- /dev/null +++ b/stripe/capital/_financing_summary.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._singleton_api_resource import SingletonAPIResource +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class FinancingSummary(SingletonAPIResource["FinancingSummary"]): + """ + A financing object describes an account's current financing state. Used by Connect + platforms to read the state of Capital offered to their connected accounts. + """ + + OBJECT_NAME: ClassVar[Literal["capital.financing_summary"]] = ( + "capital.financing_summary" + ) + + class Details(StripeObject): + class CurrentRepaymentInterval(StripeObject): + due_at: float + """ + The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited. + Given in seconds since unix epoch. + """ + paid_amount: Optional[int] + """ + The amount that has already been paid in the current repayment interval, in minor units. For example, $100 USD will be represented as 10000. + """ + remaining_amount: int + """ + The amount that is yet to be paid in the current repayment interval, in minor units. For example, $100 USD will be represented as 10000. + """ + + advance_amount: int + """ + Amount of financing offered, in minor units. For example, $1,000 USD will be represented as 100000. + """ + advance_paid_out_at: Optional[float] + """ + The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch. + """ + currency: str + """ + Currency that the financing offer is transacted in. For example, `usd`. + """ + current_repayment_interval: Optional[CurrentRepaymentInterval] + """ + The chronologically current repayment interval for the financing offer. + """ + fee_amount: int + """ + Fixed fee amount, in minor units. For example, $100 USD will be represented as 10000. + """ + paid_amount: int + """ + The amount the Connected account has paid toward the financing debt so far, in minor units. For example, $1,000 USD will be represented as 100000. + """ + remaining_amount: int + """ + The balance remaining to be paid on the financing, in minor units. For example, $1,000 USD will be represented as 100000. + """ + repayments_begin_at: Optional[float] + """ + The time at which Capital will begin withholding from payments. Given in seconds since unix epoch. + """ + withhold_rate: float + """ + Per-transaction rate at which Stripe will withhold funds to repay the financing. + """ + _inner_class_types = { + "current_repayment_interval": CurrentRepaymentInterval, + } + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + details: Optional[Details] + """ + Additional information about the financing summary. Describes currency, advance amount, + fee amount, withhold rate, remaining amount, paid amount, current repayment interval, + repayment start date, and advance payout date. + """ + financing_offer: Optional[str] + """ + The Financing Offer ID this Financing Summary corresponds to + """ + object: Literal["capital.financing_summary"] + """ + The object type: financing_summary + """ + status: Optional[Literal["accepted", "delivered", "none"]] + """ + Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing. + """ + + @classmethod + def retrieve( + cls, **params: Unpack["FinancingSummary.RetrieveParams"] + ) -> "FinancingSummary": + """ + Retrieve the financing state for the account that was authenticated in the request. + """ + instance = cls(None, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, **params: Unpack["FinancingSummary.RetrieveParams"] + ) -> "FinancingSummary": + """ + Retrieve the financing state for the account that was authenticated in the request. + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/capital/financing_summary" + + _inner_class_types = {"details": Details} diff --git a/stripe/capital/_financing_summary_service.py b/stripe/capital/_financing_summary_service.py new file mode 100644 index 000000000..0cc994302 --- /dev/null +++ b/stripe/capital/_financing_summary_service.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.capital._financing_summary import FinancingSummary +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class FinancingSummaryService(StripeService): + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def retrieve( + self, + params: "FinancingSummaryService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingSummary: + """ + Retrieve the financing state for the account that was authenticated in the request. + """ + return cast( + FinancingSummary, + self._request( + "get", + "/v1/capital/financing_summary", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: "FinancingSummaryService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingSummary: + """ + Retrieve the financing state for the account that was authenticated in the request. + """ + return cast( + FinancingSummary, + await self._request_async( + "get", + "/v1/capital/financing_summary", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/capital/_financing_transaction.py b/stripe/capital/_financing_transaction.py new file mode 100644 index 000000000..d28a26098 --- /dev/null +++ b/stripe/capital/_financing_transaction.py @@ -0,0 +1,224 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class FinancingTransaction(ListableAPIResource["FinancingTransaction"]): + """ + This is an object representing the details of a transaction on a Capital financing object. + """ + + OBJECT_NAME: ClassVar[Literal["capital.financing_transaction"]] = ( + "capital.financing_transaction" + ) + + class Details(StripeObject): + class Transaction(StripeObject): + charge: Optional[str] + """ + The linked payment ID. + """ + treasury_transaction: Optional[str] + """ + The linked Treasury Financing Transaction ID. + """ + + advance_amount: int + """ + The advance amount being repaid, paid out, or reversed in minor units. + """ + currency: str + """ + The currency of the financing transaction. + """ + fee_amount: int + """ + The fee amount being repaid, paid out, or reversed in minor units. + """ + linked_payment: Optional[str] + """ + The linked payment for the transaction. This field only applies to financing transactions of type `paydown` and reason `automatic_withholding`. + """ + reason: Optional[ + Literal[ + "automatic_withholding", + "automatic_withholding_refund", + "collection", + "collection_failure", + "financing_cancellation", + "refill", + "requested_by_user", + "user_initiated", + ] + ] + """ + The reason for the financing transaction (if applicable). + """ + reversed_transaction: Optional[str] + """ + The reversed transaction. This field only applies to financing + transactions of type `reversal`. + """ + total_amount: int + """ + The advance and fee amount being repaid, paid out, or reversed in minor units. + """ + transaction: Optional[Transaction] + """ + This is an object representing a linked transaction on a Capital Financing Transaction. + """ + _inner_class_types = {"transaction": Transaction} + + class ListParams(RequestOptions): + charge: NotRequired[str] + """ + For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge. + """ + 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. + """ + financing_offer: NotRequired[str] + """ + Returns transactions that were created that apply to this financing offer ID. + """ + 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. + """ + reversed_transaction: NotRequired[str] + """ + Only returns transactions that are responsible for reversing this financing transaction ID. + """ + 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. + """ + treasury_transaction: NotRequired[str] + """ + For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this Treasury Transaction. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + account: str + """ + The ID of the merchant associated with this financing transaction. + """ + created_at: int + """ + Time at which the financing transaction was created. Given in seconds since unix epoch. + """ + details: Details + """ + This is an object representing a transaction on a Capital financing offer. + """ + financing_offer: Optional[str] + """ + The Capital financing offer for this financing transaction. + """ + id: str + """ + A unique identifier for the financing transaction object. + """ + legacy_balance_transaction_source: Optional[str] + """ + The Capital transaction object that predates the Financing Transactions API and + corresponds with the balance transaction that was created as a result of this + financing transaction. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["capital.financing_transaction"] + """ + The object type: financing_transaction + """ + type: Literal["payment", "payout", "reversal"] + """ + The type of the financing transaction. + """ + user_facing_description: Optional[str] + """ + A human-friendly description of the financing transaction. + """ + + @classmethod + def list( + cls, **params: Unpack["FinancingTransaction.ListParams"] + ) -> ListObject["FinancingTransaction"]: + """ + Returns a list of financing transactions. The transactions are returned in sorted order, + with the most recent transactions appearing first. + """ + 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["FinancingTransaction.ListParams"] + ) -> ListObject["FinancingTransaction"]: + """ + Returns a list of financing transactions. The transactions are returned in sorted order, + with the most recent transactions appearing first. + """ + 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["FinancingTransaction.RetrieveParams"] + ) -> "FinancingTransaction": + """ + Retrieves a financing transaction for a financing offer. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FinancingTransaction.RetrieveParams"] + ) -> "FinancingTransaction": + """ + Retrieves a financing transaction for a financing offer. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"details": Details} diff --git a/stripe/capital/_financing_transaction_service.py b/stripe/capital/_financing_transaction_service.py new file mode 100644 index 000000000..4e99288db --- /dev/null +++ b/stripe/capital/_financing_transaction_service.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.capital._financing_transaction import FinancingTransaction +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class FinancingTransactionService(StripeService): + class ListParams(TypedDict): + charge: NotRequired[str] + """ + For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge. + """ + 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. + """ + financing_offer: NotRequired[str] + """ + Returns transactions that were created that apply to this financing offer ID. + """ + 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. + """ + reversed_transaction: NotRequired[str] + """ + Only returns transactions that are responsible for reversing this financing transaction ID. + """ + 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. + """ + treasury_transaction: NotRequired[str] + """ + For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this Treasury Transaction. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "FinancingTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancingTransaction]: + """ + Returns a list of financing transactions. The transactions are returned in sorted order, + with the most recent transactions appearing first. + """ + return cast( + ListObject[FinancingTransaction], + self._request( + "get", + "/v1/capital/financing_transactions", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FinancingTransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancingTransaction]: + """ + Returns a list of financing transactions. The transactions are returned in sorted order, + with the most recent transactions appearing first. + """ + return cast( + ListObject[FinancingTransaction], + await self._request_async( + "get", + "/v1/capital/financing_transactions", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + financing_transaction: str, + params: "FinancingTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingTransaction: + """ + Retrieves a financing transaction for a financing offer. + """ + return cast( + FinancingTransaction, + self._request( + "get", + "/v1/capital/financing_transactions/{financing_transaction}".format( + financing_transaction=sanitize_id(financing_transaction), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + financing_transaction: str, + params: "FinancingTransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancingTransaction: + """ + Retrieves a financing transaction for a financing offer. + """ + return cast( + FinancingTransaction, + await self._request_async( + "get", + "/v1/capital/financing_transactions/{financing_transaction}".format( + financing_transaction=sanitize_id(financing_transaction), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 820edd5fd..2ce9d1c84 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -157,11 +157,152 @@ class Address(StripeObject): """ _inner_class_types = {"address": Address} + class TaxId(StripeObject): + type: Literal[ + "ad_nrt", + "ae_trn", + "al_tin", + "am_tin", + "ao_tin", + "ar_cuit", + "au_abn", + "au_arn", + "aw_tin", + "az_tin", + "ba_tin", + "bb_tin", + "bd_bin", + "bf_ifu", + "bg_uic", + "bh_vat", + "bj_ifu", + "bo_tin", + "br_cnpj", + "br_cpf", + "bs_tin", + "by_tin", + "ca_bn", + "ca_gst_hst", + "ca_pst_bc", + "ca_pst_mb", + "ca_pst_sk", + "ca_qst", + "cd_nif", + "ch_uid", + "ch_vat", + "cl_tin", + "cm_niu", + "cn_tin", + "co_nit", + "cr_tin", + "cv_nif", + "de_stn", + "do_rcn", + "ec_ruc", + "eg_tin", + "es_cif", + "et_tin", + "eu_oss_vat", + "eu_vat", + "gb_vat", + "ge_vat", + "gn_nif", + "hk_br", + "hr_oib", + "hu_tin", + "id_npwp", + "il_vat", + "in_gst", + "is_vat", + "jp_cn", + "jp_rn", + "jp_trn", + "ke_pin", + "kg_tin", + "kh_tin", + "kr_brn", + "kz_bin", + "la_tin", + "li_uid", + "li_vat", + "ma_vat", + "md_vat", + "me_pib", + "mk_vat", + "mr_nif", + "mx_rfc", + "my_frp", + "my_itn", + "my_sst", + "ng_tin", + "no_vat", + "no_voec", + "np_pan", + "nz_gst", + "om_vat", + "pe_ruc", + "ph_tin", + "ro_tin", + "rs_pib", + "ru_inn", + "ru_kpp", + "sa_vat", + "sg_gst", + "sg_uen", + "si_tin", + "sn_ninea", + "sr_fin", + "sv_nit", + "th_vat", + "tj_tin", + "tr_tin", + "tw_vat", + "tz_vat", + "ua_vat", + "ug_tin", + "unknown", + "us_ein", + "uy_ruc", + "uz_tin", + "uz_vat", + "ve_rif", + "vn_tin", + "za_vat", + "zm_tin", + "zw_tin", + ] + """ + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + """ + value: Optional[str] + """ + The value of the tax ID. + """ + + business_name: Optional[str] + """ + Customer's business name for this Checkout Session + """ + email: Optional[str] + """ + Customer's email for this Checkout Session + """ + phone: Optional[str] + """ + Customer's phone number for this Checkout Session + """ shipping_details: Optional[ShippingDetails] """ Shipping information for this Checkout Session. """ - _inner_class_types = {"shipping_details": ShippingDetails} + tax_ids: Optional[List[TaxId]] + """ + Customer's tax ids for this Checkout Session. + """ + _inner_class_types = { + "shipping_details": ShippingDetails, + "tax_ids": TaxId, + } class Consent(StripeObject): promotions: Optional[Literal["opt_in", "opt_out"]] @@ -845,6 +986,12 @@ class Restrictions(StripeObject): """ installments: Optional[Installments] + request_decremental_authorization: Optional[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this CheckoutSession. + """ request_extended_authorization: Optional[ Literal["if_available", "never"] ] @@ -1208,6 +1355,79 @@ class Paypal(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + subsellers: Optional[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class Payto(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: Optional[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: Optional[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: Optional[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: Optional[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: Optional[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + _inner_class_types = {"mandate_options": MandateOptions} class Pix(StripeObject): expires_after_seconds: Optional[int] @@ -1286,8 +1506,19 @@ class Filters(StripeObject): """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ + institution: Optional[str] + """ + The institution to use to filter for possible accounts to link. + """ + + class ManualEntry(StripeObject): + mode: Optional[Literal["automatic", "custom"]] + """ + Settings for configuring manual entry of account details. + """ filters: Optional[Filters] + manual_entry: Optional[ManualEntry] permissions: Optional[ List[ Literal[ @@ -1302,7 +1533,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -1311,7 +1549,10 @@ class Filters(StripeObject): """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ - _inner_class_types = {"filters": Filters} + _inner_class_types = { + "filters": Filters, + "manual_entry": ManualEntry, + } financial_connections: Optional[FinancialConnections] setup_future_usage: Optional[ @@ -1368,6 +1609,7 @@ class Filters(StripeObject): payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] + payto: Optional[Payto] pix: Optional[Pix] revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] @@ -1406,6 +1648,7 @@ class Filters(StripeObject): "payco": Payco, "paynow": Paynow, "paypal": Paypal, + "payto": Payto, "pix": Pix, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, @@ -1416,6 +1659,36 @@ class Filters(StripeObject): } class Permissions(StripeObject): + class Update(StripeObject): + line_items: Optional[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ + shipping_details: Optional[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + + update: Optional[Update] + """ + Permissions for updating the Checkout Session. + """ + update_line_items: Optional[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ update_shipping_details: Optional[ Literal["client_only", "server_only"] ] @@ -1426,6 +1699,7 @@ class Permissions(StripeObject): When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. """ + _inner_class_types = {"update": Update} class PhoneNumberCollection(StripeObject): enabled: bool @@ -1939,6 +2213,10 @@ class CreateParams(RequestOptions): You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ + customer_account: NotRequired[str] + """ + ID of an existing Account, if one exists. Has the same behavior as `customer`. + """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. @@ -2107,6 +2385,7 @@ class CreateParams(RequestOptions): "eps", "fpx", "giropay", + "gopay", "grabpay", "ideal", "kakao_pay", @@ -2114,6 +2393,7 @@ class CreateParams(RequestOptions): "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -2123,12 +2403,16 @@ class CreateParams(RequestOptions): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", "swish", "twint", @@ -2555,6 +2839,10 @@ class CreateParamsLineItem(TypedDict): """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. @@ -2980,6 +3268,10 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the PayPal payment method options. """ + payto: NotRequired["Session.CreateParamsPaymentMethodOptionsPayto"] + """ + contains details about the PayTo payment method options. + """ pix: NotRequired["Session.CreateParamsPaymentMethodOptionsPix"] """ contains details about the Pix payment method options. @@ -3214,6 +3506,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this CheckoutSession. + """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] @@ -3631,6 +3929,10 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. @@ -3649,6 +3951,83 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] @@ -3764,7 +4143,14 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -3791,6 +4177,18 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ class CreateParamsPermissions(TypedDict): + update: NotRequired["Session.CreateParamsPermissionsUpdate"] + """ + Permissions for updating the Checkout Session. + """ + update_line_items: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ update_shipping_details: NotRequired[ Literal["client_only", "server_only"] ] @@ -3802,6 +4200,24 @@ class CreateParamsPermissions(TypedDict): When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. """ + class CreateParamsPermissionsUpdate(TypedDict): + line_items: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ + shipping_details: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ @@ -4218,6 +4634,10 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -4369,6 +4789,10 @@ class ListParams(RequestOptions): """ Only return the Checkout Sessions for the Customer specified. """ + customer_account: NotRequired[str] + """ + Only return the Checkout Sessions for the Account specified. + """ customer_details: NotRequired["Session.ListParamsCustomerDetails"] """ Only return the Checkout Sessions for the Customer details specified. @@ -4441,6 +4865,22 @@ class ModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + line_items: NotRequired[List["Session.ModifyParamsLineItem"]] + """ + A list of items the customer is purchasing. + + When updating line items, you must retransmit the entire array of line items. + + To retain an existing line item, specify its `id`. + + To update an existing line item, specify its `id` along with the new values of the fields to update. + + To add a new line item, specify one of `price` or `price_data` and `quantity`. + + To remove an existing line item, omit the line item's ID from the retransmitted array. + + To reorder a line item, specify it at the desired position in the retransmitted array. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -4498,6 +4938,120 @@ class ModifyParamsCollectedInformationShippingDetailsAddress(TypedDict): State, county, province, or region. """ + class ModifyParamsLineItem(TypedDict): + adjustable_quantity: NotRequired[ + "Session.ModifyParamsLineItemAdjustableQuantity" + ] + """ + When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. + """ + id: NotRequired[str] + """ + ID of an existing line item. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: NotRequired[str] + """ + The ID of the [Price](https://stripe.com/docs/api/prices). One of `price` or `price_data` is required when creating a new line item. + """ + price_data: NotRequired["Session.ModifyParamsLineItemPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required when creating a new line item. + """ + quantity: NotRequired[int] + """ + The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. + """ + + class ModifyParamsLineItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any positive integer. Setting to false will remove any previously specified constraints on quantity. + """ + maximum: NotRequired[int] + """ + The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. + """ + minimum: NotRequired[int] + """ + The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. + """ + + class ModifyParamsLineItemPriceData(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "Session.ModifyParamsLineItemPriceDataProductData" + ] + """ + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. + """ + recurring: NotRequired[ + "Session.ModifyParamsLineItemPriceDataRecurring" + ] + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class ModifyParamsLineItemPriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class ModifyParamsLineItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + class ModifyParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ @@ -4702,6 +5256,10 @@ class RetrieveParams(RequestOptions): during the payment flow unless an existing customer was provided when the Session was created. """ + customer_account: Optional[str] + """ + The ID of the account for this Session. + """ customer_creation: Optional[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a Customer when the Checkout Session completes. diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 90df0d46c..6cf2d51e7 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -84,6 +84,10 @@ class CreateParams(TypedDict): You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ + customer_account: NotRequired[str] + """ + ID of an existing Account, if one exists. Has the same behavior as `customer`. + """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. @@ -258,6 +262,7 @@ class CreateParams(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", "ideal", "kakao_pay", @@ -265,6 +270,7 @@ class CreateParams(TypedDict): "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -274,12 +280,16 @@ class CreateParams(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", "swish", "twint", @@ -718,6 +728,10 @@ class CreateParamsLineItem(TypedDict): """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. @@ -1177,6 +1191,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the PayPal payment method options. """ + payto: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPayto" + ] + """ + contains details about the PayTo payment method options. + """ pix: NotRequired["SessionService.CreateParamsPaymentMethodOptionsPix"] """ contains details about the Pix payment method options. @@ -1415,6 +1435,12 @@ class CreateParamsPaymentMethodOptionsCard(TypedDict): """ Installment options for card payments """ + request_decremental_authorization: NotRequired[ + Literal["if_available", "never"] + ] + """ + Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this CheckoutSession. + """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] @@ -1832,6 +1858,10 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ + reference_id: NotRequired[str] + """ + A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. @@ -1850,6 +1880,83 @@ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subsellers: NotRequired[List[str]] + """ + The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + """ + + class CreateParamsPaymentMethodOptionsPayto(TypedDict): + mandate_options: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPaytoMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[Literal["none", "off_session"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class CreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount that will be collected. It is required when `amount_type` is `fixed`. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + """ + end_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + """ + payment_schedule: NotRequired[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ] + ] + """ + The periodicity at which payments will be collected. + """ + payments_per_period: NotRequired[int] + """ + The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + """ + purpose: NotRequired[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ] + ] + """ + The purpose for which payments are made. Defaults to retail. + """ + start_date: NotRequired[str] + """ + Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] @@ -1965,7 +2072,14 @@ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -1992,6 +2106,18 @@ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ class CreateParamsPermissions(TypedDict): + update: NotRequired["SessionService.CreateParamsPermissionsUpdate"] + """ + Permissions for updating the Checkout Session. + """ + update_line_items: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ update_shipping_details: NotRequired[ Literal["client_only", "server_only"] ] @@ -2003,6 +2129,24 @@ class CreateParamsPermissions(TypedDict): When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. """ + class CreateParamsPermissionsUpdate(TypedDict): + line_items: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the line items. + + Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + + When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + """ + shipping_details: NotRequired[Literal["client_only", "server_only"]] + """ + Determines which entity is allowed to update the shipping details. + + Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + + When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + """ + class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ @@ -2419,6 +2563,10 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[Literal["classic", "flexible"]] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -2550,6 +2698,10 @@ class ListParams(TypedDict): """ Only return the Checkout Sessions for the Customer specified. """ + customer_account: NotRequired[str] + """ + Only return the Checkout Sessions for the Account specified. + """ customer_details: NotRequired[ "SessionService.ListParamsCustomerDetails" ] @@ -2630,6 +2782,22 @@ class UpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + line_items: NotRequired[List["SessionService.UpdateParamsLineItem"]] + """ + A list of items the customer is purchasing. + + When updating line items, you must retransmit the entire array of line items. + + To retain an existing line item, specify its `id`. + + To update an existing line item, specify its `id` along with the new values of the fields to update. + + To add a new line item, specify one of `price` or `price_data` and `quantity`. + + To remove an existing line item, omit the line item's ID from the retransmitted array. + + To reorder a line item, specify it at the desired position in the retransmitted array. + """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -2685,6 +2853,120 @@ class UpdateParamsCollectedInformationShippingDetailsAddress(TypedDict): State, county, province, or region. """ + class UpdateParamsLineItem(TypedDict): + adjustable_quantity: NotRequired[ + "SessionService.UpdateParamsLineItemAdjustableQuantity" + ] + """ + When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. + """ + id: NotRequired[str] + """ + ID of an existing line item. + """ + metadata: NotRequired["Literal['']|Dict[str, str]"] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + price: NotRequired[str] + """ + The ID of the [Price](https://stripe.com/docs/api/prices). One of `price` or `price_data` is required when creating a new line item. + """ + price_data: NotRequired["SessionService.UpdateParamsLineItemPriceData"] + """ + Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required when creating a new line item. + """ + quantity: NotRequired[int] + """ + The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. + """ + tax_rates: NotRequired["Literal['']|List[str]"] + """ + The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. + """ + + class UpdateParamsLineItemAdjustableQuantity(TypedDict): + enabled: bool + """ + Set to true if the quantity can be adjusted to any positive integer. Setting to false will remove any previously specified constraints on quantity. + """ + maximum: NotRequired[int] + """ + The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. + """ + minimum: NotRequired[int] + """ + The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. + """ + + class UpdateParamsLineItemPriceData(TypedDict): + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + product: NotRequired[str] + """ + The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required. + """ + product_data: NotRequired[ + "SessionService.UpdateParamsLineItemPriceDataProductData" + ] + """ + Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required. + """ + recurring: NotRequired[ + "SessionService.UpdateParamsLineItemPriceDataRecurring" + ] + """ + The recurring components of a price such as `interval` and `interval_count`. + """ + tax_behavior: NotRequired[ + Literal["exclusive", "inclusive", "unspecified"] + ] + """ + Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + """ + unit_amount: NotRequired[int] + """ + A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + """ + unit_amount_decimal: NotRequired[str] + """ + Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + """ + + class UpdateParamsLineItemPriceDataProductData(TypedDict): + description: NotRequired[str] + """ + The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + """ + images: NotRequired[List[str]] + """ + A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + name: str + """ + The product's name, meant to be displayable to the customer. + """ + tax_code: NotRequired[str] + """ + A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + """ + + class UpdateParamsLineItemPriceDataRecurring(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies billing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + """ + class UpdateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index efa6bc4d5..705304e6f 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -6,6 +6,177 @@ from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, ) +from stripe.events._v2_core_account_closed_event import ( + V2CoreAccountClosedEvent as V2CoreAccountClosedEvent, +) +from stripe.events._v2_core_account_created_event import ( + V2CoreAccountCreatedEvent as V2CoreAccountCreatedEvent, +) +from stripe.events._v2_core_account_including_configuration_customer_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_customer_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent as V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_merchant_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_merchant_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent as V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_recipient_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_recipient_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent as V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, +) +from stripe.events._v2_core_account_including_defaults_updated_event import ( + V2CoreAccountIncludingDefaultsUpdatedEvent as V2CoreAccountIncludingDefaultsUpdatedEvent, +) +from stripe.events._v2_core_account_including_identity_updated_event import ( + V2CoreAccountIncludingIdentityUpdatedEvent as V2CoreAccountIncludingIdentityUpdatedEvent, +) +from stripe.events._v2_core_account_including_requirements_updated_event import ( + V2CoreAccountIncludingRequirementsUpdatedEvent as V2CoreAccountIncludingRequirementsUpdatedEvent, +) +from stripe.events._v2_core_account_link_completed_event import ( + V2CoreAccountLinkCompletedEvent as V2CoreAccountLinkCompletedEvent, +) +from stripe.events._v2_core_account_person_created_event import ( + V2CoreAccountPersonCreatedEvent as V2CoreAccountPersonCreatedEvent, +) +from stripe.events._v2_core_account_person_deleted_event import ( + V2CoreAccountPersonDeletedEvent as V2CoreAccountPersonDeletedEvent, +) +from stripe.events._v2_core_account_person_updated_event import ( + V2CoreAccountPersonUpdatedEvent as V2CoreAccountPersonUpdatedEvent, +) +from stripe.events._v2_core_account_updated_event import ( + V2CoreAccountUpdatedEvent as V2CoreAccountUpdatedEvent, +) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEvent as V2CoreEventDestinationPingEvent, ) +from stripe.events._v2_money_management_adjustment_created_event import ( + V2MoneyManagementAdjustmentCreatedEvent as V2MoneyManagementAdjustmentCreatedEvent, +) +from stripe.events._v2_money_management_financial_account_created_event import ( + V2MoneyManagementFinancialAccountCreatedEvent as V2MoneyManagementFinancialAccountCreatedEvent, +) +from stripe.events._v2_money_management_financial_account_updated_event import ( + V2MoneyManagementFinancialAccountUpdatedEvent as V2MoneyManagementFinancialAccountUpdatedEvent, +) +from stripe.events._v2_money_management_financial_address_activated_event import ( + V2MoneyManagementFinancialAddressActivatedEvent as V2MoneyManagementFinancialAddressActivatedEvent, +) +from stripe.events._v2_money_management_financial_address_failed_event import ( + V2MoneyManagementFinancialAddressFailedEvent as V2MoneyManagementFinancialAddressFailedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_available_event import ( + V2MoneyManagementInboundTransferAvailableEvent as V2MoneyManagementInboundTransferAvailableEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_failed_event import ( + V2MoneyManagementInboundTransferBankDebitFailedEvent as V2MoneyManagementInboundTransferBankDebitFailedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_processing_event import ( + V2MoneyManagementInboundTransferBankDebitProcessingEvent as V2MoneyManagementInboundTransferBankDebitProcessingEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_queued_event import ( + V2MoneyManagementInboundTransferBankDebitQueuedEvent as V2MoneyManagementInboundTransferBankDebitQueuedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_returned_event import ( + V2MoneyManagementInboundTransferBankDebitReturnedEvent as V2MoneyManagementInboundTransferBankDebitReturnedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_succeeded_event import ( + V2MoneyManagementInboundTransferBankDebitSucceededEvent as V2MoneyManagementInboundTransferBankDebitSucceededEvent, +) +from stripe.events._v2_money_management_outbound_payment_canceled_event import ( + V2MoneyManagementOutboundPaymentCanceledEvent as V2MoneyManagementOutboundPaymentCanceledEvent, +) +from stripe.events._v2_money_management_outbound_payment_created_event import ( + V2MoneyManagementOutboundPaymentCreatedEvent as V2MoneyManagementOutboundPaymentCreatedEvent, +) +from stripe.events._v2_money_management_outbound_payment_failed_event import ( + V2MoneyManagementOutboundPaymentFailedEvent as V2MoneyManagementOutboundPaymentFailedEvent, +) +from stripe.events._v2_money_management_outbound_payment_posted_event import ( + V2MoneyManagementOutboundPaymentPostedEvent as V2MoneyManagementOutboundPaymentPostedEvent, +) +from stripe.events._v2_money_management_outbound_payment_returned_event import ( + V2MoneyManagementOutboundPaymentReturnedEvent as V2MoneyManagementOutboundPaymentReturnedEvent, +) +from stripe.events._v2_money_management_outbound_payment_updated_event import ( + V2MoneyManagementOutboundPaymentUpdatedEvent as V2MoneyManagementOutboundPaymentUpdatedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_canceled_event import ( + V2MoneyManagementOutboundTransferCanceledEvent as V2MoneyManagementOutboundTransferCanceledEvent, +) +from stripe.events._v2_money_management_outbound_transfer_created_event import ( + V2MoneyManagementOutboundTransferCreatedEvent as V2MoneyManagementOutboundTransferCreatedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_failed_event import ( + V2MoneyManagementOutboundTransferFailedEvent as V2MoneyManagementOutboundTransferFailedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_posted_event import ( + V2MoneyManagementOutboundTransferPostedEvent as V2MoneyManagementOutboundTransferPostedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_returned_event import ( + V2MoneyManagementOutboundTransferReturnedEvent as V2MoneyManagementOutboundTransferReturnedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_updated_event import ( + V2MoneyManagementOutboundTransferUpdatedEvent as V2MoneyManagementOutboundTransferUpdatedEvent, +) +from stripe.events._v2_money_management_received_credit_available_event import ( + V2MoneyManagementReceivedCreditAvailableEvent as V2MoneyManagementReceivedCreditAvailableEvent, +) +from stripe.events._v2_money_management_received_credit_failed_event import ( + V2MoneyManagementReceivedCreditFailedEvent as V2MoneyManagementReceivedCreditFailedEvent, +) +from stripe.events._v2_money_management_received_credit_returned_event import ( + V2MoneyManagementReceivedCreditReturnedEvent as V2MoneyManagementReceivedCreditReturnedEvent, +) +from stripe.events._v2_money_management_received_credit_succeeded_event import ( + V2MoneyManagementReceivedCreditSucceededEvent as V2MoneyManagementReceivedCreditSucceededEvent, +) +from stripe.events._v2_money_management_received_debit_canceled_event import ( + V2MoneyManagementReceivedDebitCanceledEvent as V2MoneyManagementReceivedDebitCanceledEvent, +) +from stripe.events._v2_money_management_received_debit_failed_event import ( + V2MoneyManagementReceivedDebitFailedEvent as V2MoneyManagementReceivedDebitFailedEvent, +) +from stripe.events._v2_money_management_received_debit_pending_event import ( + V2MoneyManagementReceivedDebitPendingEvent as V2MoneyManagementReceivedDebitPendingEvent, +) +from stripe.events._v2_money_management_received_debit_succeeded_event import ( + V2MoneyManagementReceivedDebitSucceededEvent as V2MoneyManagementReceivedDebitSucceededEvent, +) +from stripe.events._v2_money_management_received_debit_updated_event import ( + V2MoneyManagementReceivedDebitUpdatedEvent as V2MoneyManagementReceivedDebitUpdatedEvent, +) +from stripe.events._v2_money_management_transaction_created_event import ( + V2MoneyManagementTransactionCreatedEvent as V2MoneyManagementTransactionCreatedEvent, +) +from stripe.events._v2_money_management_transaction_updated_event import ( + V2MoneyManagementTransactionUpdatedEvent as V2MoneyManagementTransactionUpdatedEvent, +) +from stripe.events._v2_off_session_payment_requires_capture_event import ( + V2OffSessionPaymentRequiresCaptureEvent as V2OffSessionPaymentRequiresCaptureEvent, +) +from stripe.events._v2_payments_off_session_payment_authorization_attempt_failed_event import ( + V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent as V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent, +) +from stripe.events._v2_payments_off_session_payment_authorization_attempt_started_event import ( + V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent as V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent, +) +from stripe.events._v2_payments_off_session_payment_canceled_event import ( + V2PaymentsOffSessionPaymentCanceledEvent as V2PaymentsOffSessionPaymentCanceledEvent, +) +from stripe.events._v2_payments_off_session_payment_created_event import ( + V2PaymentsOffSessionPaymentCreatedEvent as V2PaymentsOffSessionPaymentCreatedEvent, +) +from stripe.events._v2_payments_off_session_payment_failed_event import ( + V2PaymentsOffSessionPaymentFailedEvent as V2PaymentsOffSessionPaymentFailedEvent, +) +from stripe.events._v2_payments_off_session_payment_succeeded_event import ( + V2PaymentsOffSessionPaymentSucceededEvent as V2PaymentsOffSessionPaymentSucceededEvent, +) diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index a47231d7b..79adae13c 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -1,18 +1,246 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.events._v2_core_account_including_requirements_updated_event import ( + V2CoreAccountIncludingRequirementsUpdatedEvent, +) +from stripe.events._v2_core_account_link_completed_event import ( + V2CoreAccountLinkCompletedEvent, +) +from stripe.events._v2_core_account_closed_event import ( + V2CoreAccountClosedEvent, +) +from stripe.events._v2_core_account_created_event import ( + V2CoreAccountCreatedEvent, +) +from stripe.events._v2_core_account_updated_event import ( + V2CoreAccountUpdatedEvent, +) +from stripe.events._v2_core_account_including_defaults_updated_event import ( + V2CoreAccountIncludingDefaultsUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_customer_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_customer_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, +) +from stripe.events._v2_core_account_including_identity_updated_event import ( + V2CoreAccountIncludingIdentityUpdatedEvent, +) +from stripe.events._v2_core_account_person_created_event import ( + V2CoreAccountPersonCreatedEvent, +) +from stripe.events._v2_core_account_person_deleted_event import ( + V2CoreAccountPersonDeletedEvent, +) +from stripe.events._v2_core_account_person_updated_event import ( + V2CoreAccountPersonUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_merchant_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_merchant_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_recipient_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, +) +from stripe.events._v2_core_account_including_configuration_recipient_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, +) +from stripe.events._v2_money_management_adjustment_created_event import ( + V2MoneyManagementAdjustmentCreatedEvent, +) from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEvent, ) from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEvent, ) +from stripe.events._v2_money_management_financial_account_created_event import ( + V2MoneyManagementFinancialAccountCreatedEvent, +) +from stripe.events._v2_money_management_financial_account_updated_event import ( + V2MoneyManagementFinancialAccountUpdatedEvent, +) +from stripe.events._v2_money_management_financial_address_activated_event import ( + V2MoneyManagementFinancialAddressActivatedEvent, +) +from stripe.events._v2_money_management_financial_address_failed_event import ( + V2MoneyManagementFinancialAddressFailedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_available_event import ( + V2MoneyManagementInboundTransferAvailableEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_failed_event import ( + V2MoneyManagementInboundTransferBankDebitFailedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_processing_event import ( + V2MoneyManagementInboundTransferBankDebitProcessingEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_queued_event import ( + V2MoneyManagementInboundTransferBankDebitQueuedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_returned_event import ( + V2MoneyManagementInboundTransferBankDebitReturnedEvent, +) +from stripe.events._v2_money_management_inbound_transfer_bank_debit_succeeded_event import ( + V2MoneyManagementInboundTransferBankDebitSucceededEvent, +) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEvent, ) +from stripe.events._v2_off_session_payment_requires_capture_event import ( + V2OffSessionPaymentRequiresCaptureEvent, +) +from stripe.events._v2_payments_off_session_payment_authorization_attempt_failed_event import ( + V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent, +) +from stripe.events._v2_payments_off_session_payment_authorization_attempt_started_event import ( + V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent, +) +from stripe.events._v2_payments_off_session_payment_canceled_event import ( + V2PaymentsOffSessionPaymentCanceledEvent, +) +from stripe.events._v2_payments_off_session_payment_created_event import ( + V2PaymentsOffSessionPaymentCreatedEvent, +) +from stripe.events._v2_payments_off_session_payment_failed_event import ( + V2PaymentsOffSessionPaymentFailedEvent, +) +from stripe.events._v2_payments_off_session_payment_succeeded_event import ( + V2PaymentsOffSessionPaymentSucceededEvent, +) +from stripe.events._v2_money_management_outbound_payment_canceled_event import ( + V2MoneyManagementOutboundPaymentCanceledEvent, +) +from stripe.events._v2_money_management_outbound_payment_created_event import ( + V2MoneyManagementOutboundPaymentCreatedEvent, +) +from stripe.events._v2_money_management_outbound_payment_failed_event import ( + V2MoneyManagementOutboundPaymentFailedEvent, +) +from stripe.events._v2_money_management_outbound_payment_posted_event import ( + V2MoneyManagementOutboundPaymentPostedEvent, +) +from stripe.events._v2_money_management_outbound_payment_returned_event import ( + V2MoneyManagementOutboundPaymentReturnedEvent, +) +from stripe.events._v2_money_management_outbound_payment_updated_event import ( + V2MoneyManagementOutboundPaymentUpdatedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_canceled_event import ( + V2MoneyManagementOutboundTransferCanceledEvent, +) +from stripe.events._v2_money_management_outbound_transfer_created_event import ( + V2MoneyManagementOutboundTransferCreatedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_failed_event import ( + V2MoneyManagementOutboundTransferFailedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_posted_event import ( + V2MoneyManagementOutboundTransferPostedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_returned_event import ( + V2MoneyManagementOutboundTransferReturnedEvent, +) +from stripe.events._v2_money_management_outbound_transfer_updated_event import ( + V2MoneyManagementOutboundTransferUpdatedEvent, +) +from stripe.events._v2_money_management_received_credit_available_event import ( + V2MoneyManagementReceivedCreditAvailableEvent, +) +from stripe.events._v2_money_management_received_credit_failed_event import ( + V2MoneyManagementReceivedCreditFailedEvent, +) +from stripe.events._v2_money_management_received_credit_returned_event import ( + V2MoneyManagementReceivedCreditReturnedEvent, +) +from stripe.events._v2_money_management_received_credit_succeeded_event import ( + V2MoneyManagementReceivedCreditSucceededEvent, +) +from stripe.events._v2_money_management_received_debit_canceled_event import ( + V2MoneyManagementReceivedDebitCanceledEvent, +) +from stripe.events._v2_money_management_received_debit_failed_event import ( + V2MoneyManagementReceivedDebitFailedEvent, +) +from stripe.events._v2_money_management_received_debit_pending_event import ( + V2MoneyManagementReceivedDebitPendingEvent, +) +from stripe.events._v2_money_management_received_debit_succeeded_event import ( + V2MoneyManagementReceivedDebitSucceededEvent, +) +from stripe.events._v2_money_management_received_debit_updated_event import ( + V2MoneyManagementReceivedDebitUpdatedEvent, +) +from stripe.events._v2_money_management_transaction_created_event import ( + V2MoneyManagementTransactionCreatedEvent, +) +from stripe.events._v2_money_management_transaction_updated_event import ( + V2MoneyManagementTransactionUpdatedEvent, +) THIN_EVENT_CLASSES = { V1BillingMeterErrorReportTriggeredEvent.LOOKUP_TYPE: V1BillingMeterErrorReportTriggeredEvent, V1BillingMeterNoMeterFoundEvent.LOOKUP_TYPE: V1BillingMeterNoMeterFoundEvent, + V2CoreAccountClosedEvent.LOOKUP_TYPE: V2CoreAccountClosedEvent, + V2CoreAccountCreatedEvent.LOOKUP_TYPE: V2CoreAccountCreatedEvent, + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, + V2CoreAccountIncludingDefaultsUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingDefaultsUpdatedEvent, + V2CoreAccountIncludingIdentityUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingIdentityUpdatedEvent, + V2CoreAccountIncludingRequirementsUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingRequirementsUpdatedEvent, + V2CoreAccountLinkCompletedEvent.LOOKUP_TYPE: V2CoreAccountLinkCompletedEvent, + V2CoreAccountPersonCreatedEvent.LOOKUP_TYPE: V2CoreAccountPersonCreatedEvent, + V2CoreAccountPersonDeletedEvent.LOOKUP_TYPE: V2CoreAccountPersonDeletedEvent, + V2CoreAccountPersonUpdatedEvent.LOOKUP_TYPE: V2CoreAccountPersonUpdatedEvent, + V2CoreAccountUpdatedEvent.LOOKUP_TYPE: V2CoreAccountUpdatedEvent, V2CoreEventDestinationPingEvent.LOOKUP_TYPE: V2CoreEventDestinationPingEvent, + V2MoneyManagementAdjustmentCreatedEvent.LOOKUP_TYPE: V2MoneyManagementAdjustmentCreatedEvent, + V2MoneyManagementFinancialAccountCreatedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAccountCreatedEvent, + V2MoneyManagementFinancialAccountUpdatedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAccountUpdatedEvent, + V2MoneyManagementFinancialAddressActivatedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAddressActivatedEvent, + V2MoneyManagementFinancialAddressFailedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAddressFailedEvent, + V2MoneyManagementInboundTransferAvailableEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferAvailableEvent, + V2MoneyManagementInboundTransferBankDebitFailedEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferBankDebitFailedEvent, + V2MoneyManagementInboundTransferBankDebitProcessingEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferBankDebitProcessingEvent, + V2MoneyManagementInboundTransferBankDebitQueuedEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferBankDebitQueuedEvent, + V2MoneyManagementInboundTransferBankDebitReturnedEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferBankDebitReturnedEvent, + V2MoneyManagementInboundTransferBankDebitSucceededEvent.LOOKUP_TYPE: V2MoneyManagementInboundTransferBankDebitSucceededEvent, + V2MoneyManagementOutboundPaymentCanceledEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentCanceledEvent, + V2MoneyManagementOutboundPaymentCreatedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentCreatedEvent, + V2MoneyManagementOutboundPaymentFailedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentFailedEvent, + V2MoneyManagementOutboundPaymentPostedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentPostedEvent, + V2MoneyManagementOutboundPaymentReturnedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentReturnedEvent, + V2MoneyManagementOutboundPaymentUpdatedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundPaymentUpdatedEvent, + V2MoneyManagementOutboundTransferCanceledEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferCanceledEvent, + V2MoneyManagementOutboundTransferCreatedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferCreatedEvent, + V2MoneyManagementOutboundTransferFailedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferFailedEvent, + V2MoneyManagementOutboundTransferPostedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferPostedEvent, + V2MoneyManagementOutboundTransferReturnedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferReturnedEvent, + V2MoneyManagementOutboundTransferUpdatedEvent.LOOKUP_TYPE: V2MoneyManagementOutboundTransferUpdatedEvent, + V2MoneyManagementReceivedCreditAvailableEvent.LOOKUP_TYPE: V2MoneyManagementReceivedCreditAvailableEvent, + V2MoneyManagementReceivedCreditFailedEvent.LOOKUP_TYPE: V2MoneyManagementReceivedCreditFailedEvent, + V2MoneyManagementReceivedCreditReturnedEvent.LOOKUP_TYPE: V2MoneyManagementReceivedCreditReturnedEvent, + V2MoneyManagementReceivedCreditSucceededEvent.LOOKUP_TYPE: V2MoneyManagementReceivedCreditSucceededEvent, + V2MoneyManagementReceivedDebitCanceledEvent.LOOKUP_TYPE: V2MoneyManagementReceivedDebitCanceledEvent, + V2MoneyManagementReceivedDebitFailedEvent.LOOKUP_TYPE: V2MoneyManagementReceivedDebitFailedEvent, + V2MoneyManagementReceivedDebitPendingEvent.LOOKUP_TYPE: V2MoneyManagementReceivedDebitPendingEvent, + V2MoneyManagementReceivedDebitSucceededEvent.LOOKUP_TYPE: V2MoneyManagementReceivedDebitSucceededEvent, + V2MoneyManagementReceivedDebitUpdatedEvent.LOOKUP_TYPE: V2MoneyManagementReceivedDebitUpdatedEvent, + V2MoneyManagementTransactionCreatedEvent.LOOKUP_TYPE: V2MoneyManagementTransactionCreatedEvent, + V2MoneyManagementTransactionUpdatedEvent.LOOKUP_TYPE: V2MoneyManagementTransactionUpdatedEvent, + V2OffSessionPaymentRequiresCaptureEvent.LOOKUP_TYPE: V2OffSessionPaymentRequiresCaptureEvent, + V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent, + V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent, + V2PaymentsOffSessionPaymentCanceledEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentCanceledEvent, + V2PaymentsOffSessionPaymentCreatedEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentCreatedEvent, + V2PaymentsOffSessionPaymentFailedEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentFailedEvent, + V2PaymentsOffSessionPaymentSucceededEvent.LOOKUP_TYPE: V2PaymentsOffSessionPaymentSucceededEvent, } diff --git a/stripe/events/_v2_core_account_closed_event.py b/stripe/events/_v2_core_account_closed_event.py new file mode 100644 index 000000000..b3b3c3420 --- /dev/null +++ b/stripe/events/_v2_core_account_closed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountClosedEvent(Event): + LOOKUP_TYPE = "v2.core.account.closed" + type: Literal["v2.core.account.closed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_created_event.py b/stripe/events/_v2_core_account_created_event.py new file mode 100644 index 000000000..419b7a1d7 --- /dev/null +++ b/stripe/events/_v2_core_account_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountCreatedEvent(Event): + LOOKUP_TYPE = "v2.core.account.created" + type: Literal["v2.core.account.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py new file mode 100644 index 000000000..ef5b703fc --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent( + Event, +): + LOOKUP_TYPE = ( + "v2.core.account[configuration.customer].capability_status_updated" + ) + type: Literal[ + "v2.core.account[configuration.customer].capability_status_updated" + ] + + class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData( + StripeObject, + ): + updated_capability: Literal["automatic_indirect_tax"] + """ + Open Enum. The capability which had its status updated. + """ + + data: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData + """ + Data for the v2.core.account[configuration.customer].capability_status_updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py new file mode 100644 index 000000000..be57e9f98 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.customer].updated" + type: Literal["v2.core.account[configuration.customer].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py new file mode 100644 index 000000000..78271e965 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent( + Event, +): + LOOKUP_TYPE = ( + "v2.core.account[configuration.merchant].capability_status_updated" + ) + type: Literal[ + "v2.core.account[configuration.merchant].capability_status_updated" + ] + + class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData( + StripeObject, + ): + updated_capability: Literal[ + "ach_debit_payments", + "acss_debit_payments", + "affirm_payments", + "afterpay_clearpay_payments", + "alma_payments", + "amazon_pay_payments", + "au_becs_debit_payments", + "bacs_debit_payments", + "bancontact_payments", + "blik_payments", + "boleto_payments", + "card_payments", + "cartes_bancaires_payments", + "cashapp_payments", + "eps_payments", + "fpx_payments", + "gb_bank_transfer_payments", + "grabpay_payments", + "ideal_payments", + "jcb_payments", + "jp_bank_transfer_payments", + "kakao_pay_payments", + "klarna_payments", + "konbini_payments", + "kr_card_payments", + "link_payments", + "mobilepay_payments", + "multibanco_payments", + "mx_bank_transfer_payments", + "naver_pay_payments", + "oxxo_payments", + "p24_payments", + "payco_payments", + "paynow_payments", + "stripe_balance.payouts", + "pay_by_bank_payments", + "promptpay_payments", + "revolut_pay_payments", + "samsung_pay_payments", + "sepa_bank_transfer_payments", + "sepa_debit_payments", + "swish_payments", + "twint_payments", + "us_bank_transfer_payments", + "zip_payments", + ] + """ + Open Enum. The capability which had its status updated. + """ + + data: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData + """ + Data for the v2.core.account[configuration.merchant].capability_status_updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py new file mode 100644 index 000000000..368b5d25f --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.merchant].updated" + type: Literal["v2.core.account[configuration.merchant].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py new file mode 100644 index 000000000..f58d0b6f7 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent( + Event, +): + LOOKUP_TYPE = ( + "v2.core.account[configuration.recipient].capability_status_updated" + ) + type: Literal[ + "v2.core.account[configuration.recipient].capability_status_updated" + ] + + class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData( + StripeObject, + ): + updated_capability: Literal[ + "bank_accounts.local", + "bank_accounts.wire", + "cards", + "stripe_balance.payouts", + "stripe_balance.stripe_transfers", + "stripe.transfers", + ] + """ + Open Enum. The capability which had its status updated. + """ + + data: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData + """ + Data for the v2.core.account[configuration.recipient].capability_status_updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py b/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py new file mode 100644 index 000000000..faa56540a --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.recipient].updated" + type: Literal["v2.core.account[configuration.recipient].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_defaults_updated_event.py b/stripe/events/_v2_core_account_including_defaults_updated_event.py new file mode 100644 index 000000000..c97ef0843 --- /dev/null +++ b/stripe/events/_v2_core_account_including_defaults_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingDefaultsUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[defaults].updated" + type: Literal["v2.core.account[defaults].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_identity_updated_event.py b/stripe/events/_v2_core_account_including_identity_updated_event.py new file mode 100644 index 000000000..dc9b49665 --- /dev/null +++ b/stripe/events/_v2_core_account_including_identity_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingIdentityUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[identity].updated" + type: Literal["v2.core.account[identity].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_requirements_updated_event.py b/stripe/events/_v2_core_account_including_requirements_updated_event.py new file mode 100644 index 000000000..c45171415 --- /dev/null +++ b/stripe/events/_v2_core_account_including_requirements_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingRequirementsUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[requirements].updated" + type: Literal["v2.core.account[requirements].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_link_completed_event.py b/stripe/events/_v2_core_account_link_completed_event.py new file mode 100644 index 000000000..f03013c95 --- /dev/null +++ b/stripe/events/_v2_core_account_link_completed_event.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from typing import Any, Dict, List, Optional +from typing_extensions import Literal + + +class V2CoreAccountLinkCompletedEvent(Event): + LOOKUP_TYPE = "v2.core.account_link.completed" + type: Literal["v2.core.account_link.completed"] + + class V2CoreAccountLinkCompletedEventData(StripeObject): + account_id: str + """ + The ID of the v2 account. + """ + configurations: List[Literal["recipient"]] + """ + Configurations on the Account that was onboarded via the account link. + """ + use_case: Literal["account_onboarding", "account_update"] + """ + Open Enum. The use case type of the account link that has been completed. + """ + + data: V2CoreAccountLinkCompletedEventData + """ + Data for the v2.core.account_link.completed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountLinkCompletedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountLinkCompletedEvent.V2CoreAccountLinkCompletedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/stripe/events/_v2_core_account_person_created_event.py b/stripe/events/_v2_core_account_person_created_event.py new file mode 100644 index 000000000..9a11d0ac9 --- /dev/null +++ b/stripe/events/_v2_core_account_person_created_event.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._person import Person +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountPersonCreatedEvent(Event): + LOOKUP_TYPE = "v2.core.account_person.created" + type: Literal["v2.core.account_person.created"] + + class V2CoreAccountPersonCreatedEventData(StripeObject): + account_id: str + """ + The ID of the v2 account. + """ + + data: V2CoreAccountPersonCreatedEventData + """ + Data for the v2.core.account_person.created event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountPersonCreatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountPersonCreatedEvent.V2CoreAccountPersonCreatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Person: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Person, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_person_deleted_event.py b/stripe/events/_v2_core_account_person_deleted_event.py new file mode 100644 index 000000000..dc9edcc9c --- /dev/null +++ b/stripe/events/_v2_core_account_person_deleted_event.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._person import Person +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountPersonDeletedEvent(Event): + LOOKUP_TYPE = "v2.core.account_person.deleted" + type: Literal["v2.core.account_person.deleted"] + + class V2CoreAccountPersonDeletedEventData(StripeObject): + account_id: str + """ + The ID of the v2 account. + """ + + data: V2CoreAccountPersonDeletedEventData + """ + Data for the v2.core.account_person.deleted event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountPersonDeletedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountPersonDeletedEvent.V2CoreAccountPersonDeletedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Person: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Person, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_person_updated_event.py b/stripe/events/_v2_core_account_person_updated_event.py new file mode 100644 index 000000000..4f698144e --- /dev/null +++ b/stripe/events/_v2_core_account_person_updated_event.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._person import Person +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountPersonUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account_person.updated" + type: Literal["v2.core.account_person.updated"] + + class V2CoreAccountPersonUpdatedEventData(StripeObject): + account_id: str + """ + The ID of the v2 account. + """ + + data: V2CoreAccountPersonUpdatedEventData + """ + Data for the v2.core.account_person.updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountPersonUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountPersonUpdatedEvent.V2CoreAccountPersonUpdatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Person: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Person, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_updated_event.py b/stripe/events/_v2_core_account_updated_event.py new file mode 100644 index 000000000..cc320a482 --- /dev/null +++ b/stripe/events/_v2_core_account_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account.updated" + type: Literal["v2.core.account.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_adjustment_created_event.py b/stripe/events/_v2_money_management_adjustment_created_event.py new file mode 100644 index 000000000..8b382cfcf --- /dev/null +++ b/stripe/events/_v2_money_management_adjustment_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._adjustment import Adjustment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementAdjustmentCreatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.adjustment.created" + type: Literal["v2.money_management.adjustment.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Adjustment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Adjustment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_account_created_event.py b/stripe/events/_v2_money_management_financial_account_created_event.py new file mode 100644 index 000000000..5c89c44d3 --- /dev/null +++ b/stripe/events/_v2_money_management_financial_account_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._financial_account import FinancialAccount +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementFinancialAccountCreatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_account.created" + type: Literal["v2.money_management.financial_account.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> FinancialAccount: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + FinancialAccount, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_account_updated_event.py b/stripe/events/_v2_money_management_financial_account_updated_event.py new file mode 100644 index 000000000..109acf24b --- /dev/null +++ b/stripe/events/_v2_money_management_financial_account_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._financial_account import FinancialAccount +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementFinancialAccountUpdatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_account.updated" + type: Literal["v2.money_management.financial_account.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> FinancialAccount: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + FinancialAccount, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_address_activated_event.py b/stripe/events/_v2_money_management_financial_address_activated_event.py new file mode 100644 index 000000000..df7115bcc --- /dev/null +++ b/stripe/events/_v2_money_management_financial_address_activated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._financial_address import FinancialAddress +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementFinancialAddressActivatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_address.activated" + type: Literal["v2.money_management.financial_address.activated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> FinancialAddress: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + FinancialAddress, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_address_failed_event.py b/stripe/events/_v2_money_management_financial_address_failed_event.py new file mode 100644 index 000000000..ab6b5b4b8 --- /dev/null +++ b/stripe/events/_v2_money_management_financial_address_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._financial_address import FinancialAddress +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementFinancialAddressFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_address.failed" + type: Literal["v2.money_management.financial_address.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> FinancialAddress: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + FinancialAddress, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_available_event.py b/stripe/events/_v2_money_management_inbound_transfer_available_event.py new file mode 100644 index 000000000..061e747e3 --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_available_event.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferAvailableEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.available" + type: Literal["v2.money_management.inbound_transfer.available"] + + class V2MoneyManagementInboundTransferAvailableEventData(StripeObject): + transaction_id: str + """ + The transaction ID of the received credit. + """ + + data: V2MoneyManagementInboundTransferAvailableEventData + """ + Data for the v2.money_management.inbound_transfer.available event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2MoneyManagementInboundTransferAvailableEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2MoneyManagementInboundTransferAvailableEvent.V2MoneyManagementInboundTransferAvailableEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py new file mode 100644 index 000000000..0414c6ba3 --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferBankDebitFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.bank_debit_failed" + type: Literal["v2.money_management.inbound_transfer.bank_debit_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py new file mode 100644 index 000000000..7427df8c4 --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferBankDebitProcessingEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.bank_debit_processing" + type: Literal["v2.money_management.inbound_transfer.bank_debit_processing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py new file mode 100644 index 000000000..b7124e55d --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferBankDebitQueuedEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.bank_debit_queued" + type: Literal["v2.money_management.inbound_transfer.bank_debit_queued"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py new file mode 100644 index 000000000..fdb075a54 --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferBankDebitReturnedEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.bank_debit_returned" + type: Literal["v2.money_management.inbound_transfer.bank_debit_returned"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py new file mode 100644 index 000000000..5c63e35db --- /dev/null +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementInboundTransferBankDebitSucceededEvent(Event): + LOOKUP_TYPE = "v2.money_management.inbound_transfer.bank_debit_succeeded" + type: Literal["v2.money_management.inbound_transfer.bank_debit_succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> InboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + InboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_canceled_event.py b/stripe/events/_v2_money_management_outbound_payment_canceled_event.py new file mode 100644 index 000000000..9bc995bcd --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_canceled_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentCanceledEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.canceled" + type: Literal["v2.money_management.outbound_payment.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_created_event.py b/stripe/events/_v2_money_management_outbound_payment_created_event.py new file mode 100644 index 000000000..c221f1aea --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentCreatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.created" + type: Literal["v2.money_management.outbound_payment.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_failed_event.py b/stripe/events/_v2_money_management_outbound_payment_failed_event.py new file mode 100644 index 000000000..bfc0fc8a7 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.failed" + type: Literal["v2.money_management.outbound_payment.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_posted_event.py b/stripe/events/_v2_money_management_outbound_payment_posted_event.py new file mode 100644 index 000000000..1c71a0f6c --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_posted_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentPostedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.posted" + type: Literal["v2.money_management.outbound_payment.posted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_returned_event.py b/stripe/events/_v2_money_management_outbound_payment_returned_event.py new file mode 100644 index 000000000..c861fd9cc --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_returned_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentReturnedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.returned" + type: Literal["v2.money_management.outbound_payment.returned"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_payment_updated_event.py b/stripe/events/_v2_money_management_outbound_payment_updated_event.py new file mode 100644 index 000000000..865b3f989 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_payment_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundPaymentUpdatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_payment.updated" + type: Literal["v2.money_management.outbound_payment.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py b/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py new file mode 100644 index 000000000..9e720ecea --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferCanceledEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.canceled" + type: Literal["v2.money_management.outbound_transfer.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_created_event.py b/stripe/events/_v2_money_management_outbound_transfer_created_event.py new file mode 100644 index 000000000..61a699531 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferCreatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.created" + type: Literal["v2.money_management.outbound_transfer.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_failed_event.py b/stripe/events/_v2_money_management_outbound_transfer_failed_event.py new file mode 100644 index 000000000..c9615ec31 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.failed" + type: Literal["v2.money_management.outbound_transfer.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_posted_event.py b/stripe/events/_v2_money_management_outbound_transfer_posted_event.py new file mode 100644 index 000000000..80fd76ac9 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_posted_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferPostedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.posted" + type: Literal["v2.money_management.outbound_transfer.posted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_returned_event.py b/stripe/events/_v2_money_management_outbound_transfer_returned_event.py new file mode 100644 index 000000000..89dc9e16f --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_returned_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferReturnedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.returned" + type: Literal["v2.money_management.outbound_transfer.returned"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_updated_event.py b/stripe/events/_v2_money_management_outbound_transfer_updated_event.py new file mode 100644 index 000000000..8e19959f1 --- /dev/null +++ b/stripe/events/_v2_money_management_outbound_transfer_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementOutboundTransferUpdatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.outbound_transfer.updated" + type: Literal["v2.money_management.outbound_transfer.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OutboundTransfer: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OutboundTransfer, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_credit_available_event.py b/stripe/events/_v2_money_management_received_credit_available_event.py new file mode 100644 index 000000000..8d6f37741 --- /dev/null +++ b/stripe/events/_v2_money_management_received_credit_available_event.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.money_management._received_credit import ReceivedCredit +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedCreditAvailableEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_credit.available" + type: Literal["v2.money_management.received_credit.available"] + + class V2MoneyManagementReceivedCreditAvailableEventData(StripeObject): + transaction_id: str + """ + The transaction ID of the received credit. + """ + + data: V2MoneyManagementReceivedCreditAvailableEventData + """ + Data for the v2.money_management.received_credit.available event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2MoneyManagementReceivedCreditAvailableEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2MoneyManagementReceivedCreditAvailableEvent.V2MoneyManagementReceivedCreditAvailableEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedCredit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedCredit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_credit_failed_event.py b/stripe/events/_v2_money_management_received_credit_failed_event.py new file mode 100644 index 000000000..f11bf350a --- /dev/null +++ b/stripe/events/_v2_money_management_received_credit_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_credit import ReceivedCredit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedCreditFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_credit.failed" + type: Literal["v2.money_management.received_credit.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedCredit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedCredit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_credit_returned_event.py b/stripe/events/_v2_money_management_received_credit_returned_event.py new file mode 100644 index 000000000..c1d5824e6 --- /dev/null +++ b/stripe/events/_v2_money_management_received_credit_returned_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_credit import ReceivedCredit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedCreditReturnedEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_credit.returned" + type: Literal["v2.money_management.received_credit.returned"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedCredit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedCredit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_credit_succeeded_event.py b/stripe/events/_v2_money_management_received_credit_succeeded_event.py new file mode 100644 index 000000000..ab590a51e --- /dev/null +++ b/stripe/events/_v2_money_management_received_credit_succeeded_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_credit import ReceivedCredit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedCreditSucceededEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_credit.succeeded" + type: Literal["v2.money_management.received_credit.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedCredit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedCredit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_debit_canceled_event.py b/stripe/events/_v2_money_management_received_debit_canceled_event.py new file mode 100644 index 000000000..bef94cfda --- /dev/null +++ b/stripe/events/_v2_money_management_received_debit_canceled_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedDebitCanceledEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_debit.canceled" + type: Literal["v2.money_management.received_debit.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedDebit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedDebit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_debit_failed_event.py b/stripe/events/_v2_money_management_received_debit_failed_event.py new file mode 100644 index 000000000..33e065b06 --- /dev/null +++ b/stripe/events/_v2_money_management_received_debit_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedDebitFailedEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_debit.failed" + type: Literal["v2.money_management.received_debit.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedDebit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedDebit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_debit_pending_event.py b/stripe/events/_v2_money_management_received_debit_pending_event.py new file mode 100644 index 000000000..2f18088f5 --- /dev/null +++ b/stripe/events/_v2_money_management_received_debit_pending_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedDebitPendingEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_debit.pending" + type: Literal["v2.money_management.received_debit.pending"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedDebit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedDebit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_debit_succeeded_event.py b/stripe/events/_v2_money_management_received_debit_succeeded_event.py new file mode 100644 index 000000000..19836dd4d --- /dev/null +++ b/stripe/events/_v2_money_management_received_debit_succeeded_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedDebitSucceededEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_debit.succeeded" + type: Literal["v2.money_management.received_debit.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedDebit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedDebit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_received_debit_updated_event.py b/stripe/events/_v2_money_management_received_debit_updated_event.py new file mode 100644 index 000000000..ab683dc54 --- /dev/null +++ b/stripe/events/_v2_money_management_received_debit_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementReceivedDebitUpdatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.received_debit.updated" + type: Literal["v2.money_management.received_debit.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> ReceivedDebit: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + ReceivedDebit, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_transaction_created_event.py b/stripe/events/_v2_money_management_transaction_created_event.py new file mode 100644 index 000000000..e6358a7df --- /dev/null +++ b/stripe/events/_v2_money_management_transaction_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._transaction import Transaction +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementTransactionCreatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.transaction.created" + type: Literal["v2.money_management.transaction.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Transaction: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Transaction, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_money_management_transaction_updated_event.py b/stripe/events/_v2_money_management_transaction_updated_event.py new file mode 100644 index 000000000..7c2ef96a4 --- /dev/null +++ b/stripe/events/_v2_money_management_transaction_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.money_management._transaction import Transaction +from typing import cast +from typing_extensions import Literal + + +class V2MoneyManagementTransactionUpdatedEvent(Event): + LOOKUP_TYPE = "v2.money_management.transaction.updated" + type: Literal["v2.money_management.transaction.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Transaction: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Transaction, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_off_session_payment_requires_capture_event.py b/stripe/events/_v2_off_session_payment_requires_capture_event.py new file mode 100644 index 000000000..59bf88f69 --- /dev/null +++ b/stripe/events/_v2_off_session_payment_requires_capture_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2OffSessionPaymentRequiresCaptureEvent(Event): + LOOKUP_TYPE = "v2.off_session_payment.requires_capture" + type: Literal["v2.off_session_payment.requires_capture"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_authorization_attempt_failed_event.py b/stripe/events/_v2_payments_off_session_payment_authorization_attempt_failed_event.py new file mode 100644 index 000000000..1599d8576 --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_authorization_attempt_failed_event.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent(Event): + LOOKUP_TYPE = ( + "v2.payments.off_session_payment.authorization_attempt_failed" + ) + type: Literal[ + "v2.payments.off_session_payment.authorization_attempt_failed" + ] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_authorization_attempt_started_event.py b/stripe/events/_v2_payments_off_session_payment_authorization_attempt_started_event.py new file mode 100644 index 000000000..907fb5862 --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_authorization_attempt_started_event.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent(Event): + LOOKUP_TYPE = ( + "v2.payments.off_session_payment.authorization_attempt_started" + ) + type: Literal[ + "v2.payments.off_session_payment.authorization_attempt_started" + ] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_canceled_event.py b/stripe/events/_v2_payments_off_session_payment_canceled_event.py new file mode 100644 index 000000000..0eb326f23 --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_canceled_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentCanceledEvent(Event): + LOOKUP_TYPE = "v2.payments.off_session_payment.canceled" + type: Literal["v2.payments.off_session_payment.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_created_event.py b/stripe/events/_v2_payments_off_session_payment_created_event.py new file mode 100644 index 000000000..88efd84ac --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_created_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentCreatedEvent(Event): + LOOKUP_TYPE = "v2.payments.off_session_payment.created" + type: Literal["v2.payments.off_session_payment.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_failed_event.py b/stripe/events/_v2_payments_off_session_payment_failed_event.py new file mode 100644 index 000000000..3efaf639b --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_failed_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentFailedEvent(Event): + LOOKUP_TYPE = "v2.payments.off_session_payment.failed" + type: Literal["v2.payments.off_session_payment.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_payments_off_session_payment_succeeded_event.py b/stripe/events/_v2_payments_off_session_payment_succeeded_event.py new file mode 100644 index 000000000..69cafde53 --- /dev/null +++ b/stripe/events/_v2_payments_off_session_payment_succeeded_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import cast +from typing_extensions import Literal + + +class V2PaymentsOffSessionPaymentSucceededEvent(Event): + LOOKUP_TYPE = "v2.payments.off_session_payment.succeeded" + type: Literal["v2.payments.off_session_payment.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> OffSessionPayment: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + OffSessionPayment, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/financial_connections/__init__.py b/stripe/financial_connections/__init__.py index 66673d1ef..ed45923e7 100644 --- a/stripe/financial_connections/__init__.py +++ b/stripe/financial_connections/__init__.py @@ -1,6 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.financial_connections._account import Account as Account +from stripe.financial_connections._account_inferred_balance import ( + AccountInferredBalance as AccountInferredBalance, +) +from stripe.financial_connections._account_inferred_balance_service import ( + AccountInferredBalanceService as AccountInferredBalanceService, +) from stripe.financial_connections._account_owner import ( AccountOwner as AccountOwner, ) @@ -13,6 +19,12 @@ from stripe.financial_connections._account_service import ( AccountService as AccountService, ) +from stripe.financial_connections._institution import ( + Institution as Institution, +) +from stripe.financial_connections._institution_service import ( + InstitutionService as InstitutionService, +) from stripe.financial_connections._session import Session as Session from stripe.financial_connections._session_service import ( SessionService as SessionService, diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index 5760bc3b8..6feb58839 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -3,6 +3,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id @@ -18,12 +19,17 @@ if TYPE_CHECKING: from stripe._account import Account as AccountResource from stripe._customer import Customer + from stripe.financial_connections._account_inferred_balance import ( + AccountInferredBalance, + ) from stripe.financial_connections._account_owner import AccountOwner from stripe.financial_connections._account_ownership import ( AccountOwnership, ) + from stripe.financial_connections._institution import Institution +@nested_resource_class_methods("inferred_balance") class Account(ListableAPIResource["Account"]): """ A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. @@ -42,6 +48,7 @@ class AccountHolder(StripeObject): """ ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. """ + customer_account: Optional[str] type: Literal["account", "customer"] """ Type of account holder that this account belongs to. @@ -102,6 +109,20 @@ class BalanceRefresh(StripeObject): The status of the last refresh attempt. """ + class InferredBalancesRefresh(StripeObject): + last_attempted_at: int + """ + The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + """ + next_refresh_available_at: Optional[int] + """ + Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + """ + status: Literal["failed", "pending", "succeeded"] + """ + The status of the last refresh attempt. + """ + class OwnershipRefresh(StripeObject): last_attempted_at: int """ @@ -140,6 +161,24 @@ class DisconnectParams(RequestOptions): Specifies which fields in the response should be expanded. """ + class ListInferredBalancesParams(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. + """ + class ListOwnersParams(RequestOptions): ending_before: NotRequired[str] """ @@ -197,13 +236,21 @@ class ListParamsAccountHolder(TypedDict): """ The ID of the Stripe customer whose accounts will be retrieved. """ + customer_account: NotRequired[str] + """ + The Account ID of the Stripe customer whose accounts will be retrieved. + """ class RefreshAccountParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - features: List[Literal["balance", "ownership", "transactions"]] + features: List[ + Literal[ + "balance", "inferred_balances", "ownership", "transactions" + ] + ] """ The list of account features that you would like to refresh. """ @@ -219,7 +266,7 @@ class SubscribeParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["transactions"]] + features: List[Literal["balance", "inferred_balances", "transactions"]] """ The list of account features to which you would like to subscribe. """ @@ -229,7 +276,7 @@ class UnsubscribeParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["transactions"]] + features: List[Literal["balance", "inferred_balances", "transactions"]] """ The list of account features from which you would like to unsubscribe. """ @@ -262,6 +309,14 @@ class UnsubscribeParams(RequestOptions): """ Unique identifier for the object. """ + inferred_balances_refresh: Optional[InferredBalancesRefresh] + """ + The state of the most recent attempt to refresh the account's inferred balance history. + """ + institution: Optional[ExpandableField["Institution"]] + """ + The ID of the Financial Connections Institution this account belongs to. Note that this relationship may sometimes change in rare circumstances (e.g. institution mergers). + """ institution_name: str """ The name of the institution that holds this account. @@ -322,7 +377,9 @@ class UnsubscribeParams(RequestOptions): If `category` is `investment` or `other`, this will be `other`. """ - subscriptions: Optional[List[Literal["transactions"]]] + subscriptions: Optional[ + List[Literal["balance", "inferred_balances", "transactions"]] + ] """ The list of data refresh subscriptions requested on this account. """ @@ -947,10 +1004,51 @@ async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def list_inferred_balances( + cls, + account: str, + **params: Unpack["Account.ListInferredBalancesParams"], + ) -> ListObject["AccountInferredBalance"]: + """ + Lists the recorded inferred balances for a Financial Connections Account. + """ + return cast( + ListObject["AccountInferredBalance"], + cls._static_request( + "get", + "/v1/financial_connections/accounts/{account}/inferred_balances".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @classmethod + async def list_inferred_balances_async( + cls, + account: str, + **params: Unpack["Account.ListInferredBalancesParams"], + ) -> ListObject["AccountInferredBalance"]: + """ + Lists the recorded inferred balances for a Financial Connections Account. + """ + return cast( + ListObject["AccountInferredBalance"], + await cls._static_request_async( + "get", + "/v1/financial_connections/accounts/{account}/inferred_balances".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + _inner_class_types = { "account_holder": AccountHolder, "balance": Balance, "balance_refresh": BalanceRefresh, + "inferred_balances_refresh": InferredBalancesRefresh, "ownership_refresh": OwnershipRefresh, "transaction_refresh": TransactionRefresh, } diff --git a/stripe/financial_connections/_account_inferred_balance.py b/stripe/financial_connections/_account_inferred_balance.py new file mode 100644 index 000000000..9f929bd7b --- /dev/null +++ b/stripe/financial_connections/_account_inferred_balance.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict +from typing_extensions import Literal + + +class AccountInferredBalance(StripeObject): + """ + A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data. + """ + + OBJECT_NAME: ClassVar[ + Literal["financial_connections.account_inferred_balance"] + ] = "financial_connections.account_inferred_balance" + as_of: int + """ + The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC. + """ + current: Dict[str, int] + """ + The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. + + Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + + Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["financial_connections.account_inferred_balance"] + """ + String representing the object's type. Objects of the same type share the same value. + """ diff --git a/stripe/financial_connections/_account_inferred_balance_service.py b/stripe/financial_connections/_account_inferred_balance_service.py new file mode 100644 index 000000000..2d5a09224 --- /dev/null +++ b/stripe/financial_connections/_account_inferred_balance_service.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.financial_connections._account_inferred_balance import ( + AccountInferredBalance, +) +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class AccountInferredBalanceService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + account: str, + params: "AccountInferredBalanceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[AccountInferredBalance]: + """ + Lists the recorded inferred balances for a Financial Connections Account. + """ + return cast( + ListObject[AccountInferredBalance], + self._request( + "get", + "/v1/financial_connections/accounts/{account}/inferred_balances".format( + account=sanitize_id(account), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + account: str, + params: "AccountInferredBalanceService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[AccountInferredBalance]: + """ + Lists the recorded inferred balances for a Financial Connections Account. + """ + return cast( + ListObject[AccountInferredBalance], + await self._request_async( + "get", + "/v1/financial_connections/accounts/{account}/inferred_balances".format( + account=sanitize_id(account), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index 18fcd6dd6..45ccaef29 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -5,6 +5,9 @@ from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.financial_connections._account import Account +from stripe.financial_connections._account_inferred_balance_service import ( + AccountInferredBalanceService, +) from stripe.financial_connections._account_owner_service import ( AccountOwnerService, ) @@ -15,6 +18,7 @@ class AccountService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.inferred_balances = AccountInferredBalanceService(self._requestor) self.owners = AccountOwnerService(self._requestor) class DisconnectParams(TypedDict): @@ -58,13 +62,21 @@ class ListParamsAccountHolder(TypedDict): """ The ID of the Stripe customer whose accounts will be retrieved. """ + customer_account: NotRequired[str] + """ + The Account ID of the Stripe customer whose accounts will be retrieved. + """ class RefreshParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ - features: List[Literal["balance", "ownership", "transactions"]] + features: List[ + Literal[ + "balance", "inferred_balances", "ownership", "transactions" + ] + ] """ The list of account features that you would like to refresh. """ @@ -80,7 +92,7 @@ class SubscribeParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["transactions"]] + features: List[Literal["balance", "inferred_balances", "transactions"]] """ The list of account features to which you would like to subscribe. """ @@ -90,7 +102,7 @@ class UnsubscribeParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["transactions"]] + features: List[Literal["balance", "inferred_balances", "transactions"]] """ The list of account features from which you would like to unsubscribe. """ diff --git a/stripe/financial_connections/_institution.py b/stripe/financial_connections/_institution.py new file mode 100644 index 000000000..78a33e841 --- /dev/null +++ b/stripe/financial_connections/_institution.py @@ -0,0 +1,176 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class Institution(ListableAPIResource["Institution"]): + """ + An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow. + """ + + OBJECT_NAME: ClassVar[Literal["financial_connections.institution"]] = ( + "financial_connections.institution" + ) + + class Features(StripeObject): + class Balances(StripeObject): + supported: bool + """ + Whether the given feature is supported by this institution. + """ + + class Ownership(StripeObject): + supported: bool + """ + Whether the given feature is supported by this institution. + """ + + class PaymentMethod(StripeObject): + supported: bool + """ + Whether the given feature is supported by this institution. + """ + + class Transactions(StripeObject): + supported: bool + """ + Whether the given feature is supported by this institution. + """ + + balances: Balances + ownership: Ownership + payment_method: PaymentMethod + transactions: Transactions + _inner_class_types = { + "balances": Balances, + "ownership": Ownership, + "payment_method": PaymentMethod, + "transactions": Transactions, + } + + class ListParams(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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + countries: List[str] + """ + The list of countries supported by this institution, formatted as ISO country codes. + """ + features: Features + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + name: str + """ + The name of this institution. + """ + object: Literal["financial_connections.institution"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + routing_numbers: List[str] + """ + A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions. + """ + status: Literal["active", "degraded", "inactive"] + """ + The status of this institution in the Financial Connections authentication flow. + """ + url: Optional[str] + """ + A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution. + """ + + @classmethod + def list( + cls, **params: Unpack["Institution.ListParams"] + ) -> ListObject["Institution"]: + """ + Returns a list of Financial Connections Institution objects. + """ + 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["Institution.ListParams"] + ) -> ListObject["Institution"]: + """ + Returns a list of Financial Connections Institution objects. + """ + 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["Institution.RetrieveParams"] + ) -> "Institution": + """ + Retrieves the details of a Financial Connections Institution. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Institution.RetrieveParams"] + ) -> "Institution": + """ + Retrieves the details of a Financial Connections Institution. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"features": Features} diff --git a/stripe/financial_connections/_institution_service.py b/stripe/financial_connections/_institution_service.py new file mode 100644 index 000000000..137143b60 --- /dev/null +++ b/stripe/financial_connections/_institution_service.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.financial_connections._institution import Institution +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class InstitutionService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "InstitutionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Institution]: + """ + Returns a list of Financial Connections Institution objects. + """ + return cast( + ListObject[Institution], + self._request( + "get", + "/v1/financial_connections/institutions", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "InstitutionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Institution]: + """ + Returns a list of Financial Connections Institution objects. + """ + return cast( + ListObject[Institution], + await self._request_async( + "get", + "/v1/financial_connections/institutions", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + institution: str, + params: "InstitutionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Institution: + """ + Retrieves the details of a Financial Connections Institution. + """ + return cast( + Institution, + self._request( + "get", + "/v1/financial_connections/institutions/{institution}".format( + institution=sanitize_id(institution), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + institution: str, + params: "InstitutionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Institution: + """ + Retrieves the details of a Financial Connections Institution. + """ + return cast( + Institution, + await self._request_async( + "get", + "/v1/financial_connections/institutions/{institution}".format( + institution=sanitize_id(institution), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 1109ccda9..a19490058 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -40,6 +40,7 @@ class AccountHolder(StripeObject): """ ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. """ + customer_account: Optional[str] type: Literal["account", "customer"] """ Type of account holder that this account belongs to. @@ -64,6 +65,29 @@ class Filters(StripeObject): """ List of countries from which to filter accounts. """ + institution: Optional[str] + """ + Stripe ID of the institution with which the customer should be directed to log in. + """ + + class Limits(StripeObject): + accounts: int + """ + The number of accounts that can be linked in this Session. + """ + + class ManualEntry(StripeObject): + pass + + class StatusDetails(StripeObject): + class Cancelled(StripeObject): + reason: Literal["custom_manual_entry", "other"] + """ + The reason for the Session being cancelled. + """ + + cancelled: Optional[Cancelled] + _inner_class_types = {"cancelled": Cancelled} class CreateParams(RequestOptions): account_holder: "Session.CreateParamsAccountHolder" @@ -78,6 +102,14 @@ class CreateParams(RequestOptions): """ Filters to restrict the kinds of accounts to collect. """ + limits: NotRequired["Session.CreateParamsLimits"] + """ + Settings for configuring Session-specific limits. + """ + manual_entry: NotRequired["Session.CreateParamsManualEntry"] + """ + Customize manual entry behavior + """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] @@ -87,7 +119,14 @@ class CreateParams(RequestOptions): Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -106,6 +145,10 @@ class CreateParamsAccountHolder(TypedDict): """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ + customer_account: NotRequired[str] + """ + The ID of the Stripe customer Account whose accounts will be retrieved. Should only be present if `type` is `customer`. + """ type: Literal["account", "customer"] """ Type of account holder to collect accounts for. @@ -130,6 +173,22 @@ class CreateParamsFilters(TypedDict): """ List of countries from which to collect accounts. """ + institution: NotRequired[str] + """ + Stripe ID of the institution with which the customer should be directed to log in. + """ + + class CreateParamsLimits(TypedDict): + accounts: int + """ + The number of accounts that can be linked in this Session. + """ + + class CreateParamsManualEntry(TypedDict): + mode: NotRequired[Literal["automatic", "custom"]] + """ + Whether manual entry will be handled by Stripe during the Session. + """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] @@ -154,10 +213,12 @@ class RetrieveParams(RequestOptions): """ Unique identifier for the object. """ + limits: Optional[Limits] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + manual_entry: Optional[ManualEntry] object: Literal["financial_connections.session"] """ String representing the object's type. Objects of the same type share the same value. @@ -168,7 +229,13 @@ class RetrieveParams(RequestOptions): """ Permissions requested for accounts collected during this session. """ - prefetch: Optional[List[Literal["balances", "ownership", "transactions"]]] + prefetch: Optional[ + List[ + Literal[ + "balances", "inferred_balances", "ownership", "transactions" + ] + ] + ] """ Data features requested to be retrieved upon account creation. """ @@ -176,6 +243,11 @@ class RetrieveParams(RequestOptions): """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ + status: Optional[Literal["cancelled", "failed", "pending", "succeeded"]] + """ + The current state of the session. + """ + status_details: Optional[StatusDetails] @classmethod def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": @@ -229,4 +301,10 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"account_holder": AccountHolder, "filters": Filters} + _inner_class_types = { + "account_holder": AccountHolder, + "filters": Filters, + "limits": Limits, + "manual_entry": ManualEntry, + "status_details": StatusDetails, + } diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index 9295cb25f..029849214 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -22,6 +22,14 @@ class CreateParams(TypedDict): """ Filters to restrict the kinds of accounts to collect. """ + limits: NotRequired["SessionService.CreateParamsLimits"] + """ + Settings for configuring Session-specific limits. + """ + manual_entry: NotRequired["SessionService.CreateParamsManualEntry"] + """ + Customize manual entry behavior + """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] @@ -31,7 +39,14 @@ class CreateParams(TypedDict): Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Literal[ + "balances", + "inferred_balances", + "ownership", + "transactions", + ] + ] ] """ List of data features that you would like to retrieve upon account creation. @@ -50,6 +65,10 @@ class CreateParamsAccountHolder(TypedDict): """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ + customer_account: NotRequired[str] + """ + The ID of the Stripe customer Account whose accounts will be retrieved. Should only be present if `type` is `customer`. + """ type: Literal["account", "customer"] """ Type of account holder to collect accounts for. @@ -74,6 +93,22 @@ class CreateParamsFilters(TypedDict): """ List of countries from which to collect accounts. """ + institution: NotRequired[str] + """ + Stripe ID of the institution with which the customer should be directed to log in. + """ + + class CreateParamsLimits(TypedDict): + accounts: int + """ + The number of accounts that can be linked in this Session. + """ + + class CreateParamsManualEntry(TypedDict): + mode: NotRequired[Literal["automatic", "custom"]] + """ + Whether manual entry will be handled by Stripe during the Session. + """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 944758ef8..5ecd70ea0 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -259,6 +259,10 @@ class CreateParams(RequestOptions): """ Customer ID """ + related_customer_account: NotRequired[str] + """ + Token referencing a Customer Account resource. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -332,6 +336,7 @@ class ListParams(RequestOptions): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ related_customer: NotRequired[str] + related_customer_account: NotRequired[str] 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. @@ -487,6 +492,10 @@ class RetrieveParams(RequestOptions): """ Customer ID """ + related_customer_account: Optional[str] + """ + Token referencing a Customer Account resource. + """ status: Literal["canceled", "processing", "requires_input", "verified"] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index d993d8eea..5000991c2 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -43,6 +43,10 @@ class CreateParams(TypedDict): """ Customer ID """ + related_customer_account: NotRequired[str] + """ + Token referencing a Customer Account resource. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -118,6 +122,7 @@ class ListParams(TypedDict): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ related_customer: NotRequired[str] + related_customer_account: NotRequired[str] starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. diff --git a/stripe/issuing/__init__.py b/stripe/issuing/__init__.py index c393631e1..02f151884 100644 --- a/stripe/issuing/__init__.py +++ b/stripe/issuing/__init__.py @@ -10,8 +10,26 @@ from stripe.issuing._cardholder_service import ( CardholderService as CardholderService, ) +from stripe.issuing._credit_underwriting_record import ( + CreditUnderwritingRecord as CreditUnderwritingRecord, +) +from stripe.issuing._credit_underwriting_record_service import ( + CreditUnderwritingRecordService as CreditUnderwritingRecordService, +) from stripe.issuing._dispute import Dispute as Dispute from stripe.issuing._dispute_service import DisputeService as DisputeService +from stripe.issuing._dispute_settlement_detail import ( + DisputeSettlementDetail as DisputeSettlementDetail, +) +from stripe.issuing._dispute_settlement_detail_service import ( + DisputeSettlementDetailService as DisputeSettlementDetailService, +) +from stripe.issuing._fraud_liability_debit import ( + FraudLiabilityDebit as FraudLiabilityDebit, +) +from stripe.issuing._fraud_liability_debit_service import ( + FraudLiabilityDebitService as FraudLiabilityDebitService, +) from stripe.issuing._personalization_design import ( PersonalizationDesign as PersonalizationDesign, ) @@ -22,6 +40,7 @@ from stripe.issuing._physical_bundle_service import ( PhysicalBundleService as PhysicalBundleService, ) +from stripe.issuing._settlement import Settlement as Settlement from stripe.issuing._token import Token as Token from stripe.issuing._token_service import TokenService as TokenService from stripe.issuing._transaction import Transaction as Transaction diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 7092c99d0..42d5ec744 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -1159,7 +1159,8 @@ class CreateParams(RequestOptions): """ phone_number: NotRequired[str] """ - The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. + While phone number is optional if the cardholder will not be creating EU cards, note that this cardholder will not be eligible for 3DS without a phone number. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 34f4c468d..8c5e32c18 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -41,7 +41,8 @@ class CreateParams(TypedDict): """ phone_number: NotRequired[str] """ - The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. + While phone number is optional if the cardholder will not be creating EU cards, note that this cardholder will not be eligible for 3DS without a phone number. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] diff --git a/stripe/issuing/_credit_underwriting_record.py b/stripe/issuing/_credit_underwriting_record.py new file mode 100644 index 000000000..f85cd45cf --- /dev/null +++ b/stripe/issuing/_credit_underwriting_record.py @@ -0,0 +1,1694 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Dict, List, Optional, cast, overload +from typing_extensions import Literal, NotRequired, TypedDict, Unpack + + +class CreditUnderwritingRecord( + ListableAPIResource["CreditUnderwritingRecord"] +): + """ + Every time an applicant submits an application for a Charge Card product your platform offers, or every time your platform takes a proactive credit decision on an existing account, you must record the decision by creating a new `CreditUnderwritingRecord` object on a connected account. + + [Follow the guide](https://stripe.com/docs/issuing/credit/report-credit-decisions-and-manage-aans) to learn about your requirements as a platform. + """ + + OBJECT_NAME: ClassVar[Literal["issuing.credit_underwriting_record"]] = ( + "issuing.credit_underwriting_record" + ) + + class Application(StripeObject): + application_method: Literal["in_person", "mail", "online", "phone"] + """ + The channel through which the applicant has submitted their application. + """ + purpose: Literal["credit_limit_increase", "credit_line_opening"] + """ + Scope of demand made by the applicant. + """ + submitted_at: int + """ + Date when the applicant submitted their application. + """ + + class CreditUser(StripeObject): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class Decision(StripeObject): + class ApplicationRejected(StripeObject): + reason_other_explanation: Optional[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the application was rejected up to 4 reasons, in order of importance. + """ + + class CreditLimitApproved(StripeObject): + amount: int + """ + Credit amount approved. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + + class CreditLimitDecreased(StripeObject): + amount: int + """ + Credit amount approved after decrease. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + reason_other_explanation: Optional[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + """ + + class CreditLineClosed(StripeObject): + reason_other_explanation: Optional[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing account was closed, up to 4 reasons, in order of importance. + """ + + application_rejected: Optional[ApplicationRejected] + """ + Details about a decision application_rejected. + """ + credit_limit_approved: Optional[CreditLimitApproved] + """ + Details about a decision credit_limit_approved. + """ + credit_limit_decreased: Optional[CreditLimitDecreased] + """ + Details about a decision credit_limit_decreased. + """ + credit_line_closed: Optional[CreditLineClosed] + """ + Details about a decision credit_line_closed. + """ + type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + Outcome of the decision. + """ + _inner_class_types = { + "application_rejected": ApplicationRejected, + "credit_limit_approved": CreditLimitApproved, + "credit_limit_decreased": CreditLimitDecreased, + "credit_line_closed": CreditLineClosed, + } + + class UnderwritingException(StripeObject): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class CorrectParams(RequestOptions): + application: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsApplication" + ] + """ + Details about the application submission. + """ + credit_user: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsCreditUser" + ] + """ + Information about the company or person applying or holding the account. + """ + decided_at: NotRequired[int] + """ + Date when a decision was made. + """ + decision: NotRequired["CreditUnderwritingRecord.CorrectParamsDecision"] + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). Optional if previously provided and no changes are needed. + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class CorrectParamsApplication(TypedDict): + application_method: NotRequired[ + Literal["in_person", "mail", "online", "phone"] + ] + """ + The channel through which the applicant has submitted their application. Defaults to `online`. + """ + purpose: Literal["credit_limit_increase", "credit_line_opening"] + """ + Scope of demand made by the applicant. + """ + submitted_at: int + """ + Date when the applicant submitted their application. + """ + + class CorrectParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CorrectParamsDecision(TypedDict): + application_rejected: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsDecisionApplicationRejected" + ] + """ + Details about the application rejection. + """ + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + credit_limit_decreased: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsDecisionCreditLimitDecreased" + ] + """ + Details about the credit limit decreased. + """ + credit_line_closed: NotRequired[ + "CreditUnderwritingRecord.CorrectParamsDecisionCreditLineClosed" + ] + """ + Details about the credit line closed. + """ + type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + Outcome of the decision. + """ + + class CorrectParamsDecisionApplicationRejected(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the application was rejected, up to 4 reasons, in order of importance. + """ + + class CorrectParamsDecisionCreditLimitApproved(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class CorrectParamsDecisionCreditLimitDecreased(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + """ + + class CorrectParamsDecisionCreditLineClosed(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the credit line was closed, up to 4 reasons, in order of importance. + """ + + class CorrectParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class CreateFromApplicationParams(RequestOptions): + application: ( + "CreditUnderwritingRecord.CreateFromApplicationParamsApplication" + ) + """ + Details about the application submission. + """ + credit_user: ( + "CreditUnderwritingRecord.CreateFromApplicationParamsCreditUser" + ) + """ + Information about the company or person applying or holding the account. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + + class CreateFromApplicationParamsApplication(TypedDict): + application_method: NotRequired[ + Literal["in_person", "mail", "online", "phone"] + ] + """ + The channel through which the applicant has submitted their application. Defaults to `online`. + """ + purpose: Literal["credit_limit_increase", "credit_line_opening"] + """ + Scope of demand made by the applicant. + """ + submitted_at: int + """ + Date when the applicant submitted their application. + """ + + class CreateFromApplicationParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CreateFromProactiveReviewParams(RequestOptions): + credit_user: "CreditUnderwritingRecord.CreateFromProactiveReviewParamsCreditUser" + """ + Information about the company or person applying or holding the account. + """ + decided_at: int + """ + Date when a decision was made. + """ + decision: ( + "CreditUnderwritingRecord.CreateFromProactiveReviewParamsDecision" + ) + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class CreateFromProactiveReviewParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CreateFromProactiveReviewParamsDecision(TypedDict): + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + credit_limit_decreased: NotRequired[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParamsDecisionCreditLimitDecreased" + ] + """ + Details about the credit limit decreased. + """ + credit_line_closed: NotRequired[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParamsDecisionCreditLineClosed" + ] + """ + Details about the credit line closed. + """ + type: Literal[ + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + ] + """ + Outcome of the decision. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLimitApproved( + TypedDict + ): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLimitDecreased( + TypedDict, + ): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLineClosed(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the credit line was closed, up to 4 reasons, in order of importance. + """ + + class CreateFromProactiveReviewParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class ListParams(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. + """ + + class ReportDecisionParams(RequestOptions): + decided_at: int + """ + Date when a decision was made. + """ + decision: "CreditUnderwritingRecord.ReportDecisionParamsDecision" + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecord.ReportDecisionParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class ReportDecisionParamsDecision(TypedDict): + application_rejected: NotRequired[ + "CreditUnderwritingRecord.ReportDecisionParamsDecisionApplicationRejected" + ] + """ + Details about the application rejection. + """ + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecord.ReportDecisionParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "withdrawn_by_applicant", + ] + """ + Outcome of the decision. + """ + + class ReportDecisionParamsDecisionApplicationRejected(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the application was rejected, up to 4 reasons, in order of importance. + """ + + class ReportDecisionParamsDecisionCreditLimitApproved(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class ReportDecisionParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + application: Optional[Application] + """ + For decisions triggered by an application, details about the submission. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + created_from: Literal["application", "proactive_review"] + """ + The event that triggered the underwriting. + """ + credit_user: CreditUser + decided_at: Optional[int] + """ + Date when a decision was made. + """ + decision: Optional[Decision] + """ + Details about the decision. + """ + decision_deadline: Optional[int] + """ + For underwriting initiated by an application, a decision must be taken 30 days after the submission. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["issuing.credit_underwriting_record"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + regulatory_reporting_file: Optional[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + """ + underwriting_exception: Optional[UnderwritingException] + """ + If an exception to the usual underwriting criteria was made for this application, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + @classmethod + def _cls_correct( + cls, + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.CorrectParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + "CreditUnderwritingRecord", + cls._static_request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + def correct( + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.CorrectParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + ... + + @overload + def correct( + self, **params: Unpack["CreditUnderwritingRecord.CorrectParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + ... + + @class_method_variant("_cls_correct") + def correct( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditUnderwritingRecord.CorrectParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + "CreditUnderwritingRecord", + self._request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_correct_async( + cls, + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.CorrectParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + "CreditUnderwritingRecord", + await cls._static_request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def correct_async( + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.CorrectParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + ... + + @overload + async def correct_async( + self, **params: Unpack["CreditUnderwritingRecord.CorrectParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + ... + + @class_method_variant("_cls_correct_async") + async def correct_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditUnderwritingRecord.CorrectParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + "CreditUnderwritingRecord", + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create_from_application( + cls, + **params: Unpack[ + "CreditUnderwritingRecord.CreateFromApplicationParams" + ], + ) -> "CreditUnderwritingRecord": + """ + Creates a CreditUnderwritingRecord object with information about a credit application submission. + """ + return cast( + "CreditUnderwritingRecord", + cls._static_request( + "post", + "/v1/issuing/credit_underwriting_records/create_from_application", + params=params, + ), + ) + + @classmethod + async def create_from_application_async( + cls, + **params: Unpack[ + "CreditUnderwritingRecord.CreateFromApplicationParams" + ], + ) -> "CreditUnderwritingRecord": + """ + Creates a CreditUnderwritingRecord object with information about a credit application submission. + """ + return cast( + "CreditUnderwritingRecord", + await cls._static_request_async( + "post", + "/v1/issuing/credit_underwriting_records/create_from_application", + params=params, + ), + ) + + @classmethod + def create_from_proactive_review( + cls, + **params: Unpack[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParams" + ], + ) -> "CreditUnderwritingRecord": + """ + Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. + """ + return cast( + "CreditUnderwritingRecord", + cls._static_request( + "post", + "/v1/issuing/credit_underwriting_records/create_from_proactive_review", + params=params, + ), + ) + + @classmethod + async def create_from_proactive_review_async( + cls, + **params: Unpack[ + "CreditUnderwritingRecord.CreateFromProactiveReviewParams" + ], + ) -> "CreditUnderwritingRecord": + """ + Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. + """ + return cast( + "CreditUnderwritingRecord", + await cls._static_request_async( + "post", + "/v1/issuing/credit_underwriting_records/create_from_proactive_review", + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["CreditUnderwritingRecord.ListParams"] + ) -> ListObject["CreditUnderwritingRecord"]: + """ + Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + 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["CreditUnderwritingRecord.ListParams"] + ) -> ListObject["CreditUnderwritingRecord"]: + """ + Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + 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 _cls_report_decision( + cls, + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + "CreditUnderwritingRecord", + cls._static_request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + def report_decision( + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + ... + + @overload + def report_decision( + self, **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + ... + + @class_method_variant("_cls_report_decision") + def report_decision( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + "CreditUnderwritingRecord", + self._request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_report_decision_async( + cls, + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + "CreditUnderwritingRecord", + await cls._static_request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def report_decision_async( + credit_underwriting_record: str, + **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"], + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + ... + + @overload + async def report_decision_async( + self, **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + ... + + @class_method_variant("_cls_report_decision_async") + async def report_decision_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["CreditUnderwritingRecord.ReportDecisionParams"] + ) -> "CreditUnderwritingRecord": + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + "CreditUnderwritingRecord", + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, + id: str, + **params: Unpack["CreditUnderwritingRecord.RetrieveParams"], + ) -> "CreditUnderwritingRecord": + """ + Retrieves a CreditUnderwritingRecord object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, + id: str, + **params: Unpack["CreditUnderwritingRecord.RetrieveParams"], + ) -> "CreditUnderwritingRecord": + """ + Retrieves a CreditUnderwritingRecord object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "application": Application, + "credit_user": CreditUser, + "decision": Decision, + "underwriting_exception": UnderwritingException, + } diff --git a/stripe/issuing/_credit_underwriting_record_service.py b/stripe/issuing/_credit_underwriting_record_service.py new file mode 100644 index 000000000..f8b075336 --- /dev/null +++ b/stripe/issuing/_credit_underwriting_record_service.py @@ -0,0 +1,1159 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.issuing._credit_underwriting_record import CreditUnderwritingRecord +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class CreditUnderwritingRecordService(StripeService): + class CorrectParams(TypedDict): + application: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsApplication" + ] + """ + Details about the application submission. + """ + credit_user: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsCreditUser" + ] + """ + Information about the company or person applying or holding the account. + """ + decided_at: NotRequired[int] + """ + Date when a decision was made. + """ + decision: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsDecision" + ] + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). Optional if previously provided and no changes are needed. + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class CorrectParamsApplication(TypedDict): + application_method: NotRequired[ + Literal["in_person", "mail", "online", "phone"] + ] + """ + The channel through which the applicant has submitted their application. Defaults to `online`. + """ + purpose: Literal["credit_limit_increase", "credit_line_opening"] + """ + Scope of demand made by the applicant. + """ + submitted_at: int + """ + Date when the applicant submitted their application. + """ + + class CorrectParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CorrectParamsDecision(TypedDict): + application_rejected: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsDecisionApplicationRejected" + ] + """ + Details about the application rejection. + """ + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + credit_limit_decreased: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsDecisionCreditLimitDecreased" + ] + """ + Details about the credit limit decreased. + """ + credit_line_closed: NotRequired[ + "CreditUnderwritingRecordService.CorrectParamsDecisionCreditLineClosed" + ] + """ + Details about the credit line closed. + """ + type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + Outcome of the decision. + """ + + class CorrectParamsDecisionApplicationRejected(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the application was rejected, up to 4 reasons, in order of importance. + """ + + class CorrectParamsDecisionCreditLimitApproved(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class CorrectParamsDecisionCreditLimitDecreased(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + """ + + class CorrectParamsDecisionCreditLineClosed(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the credit line was closed, up to 4 reasons, in order of importance. + """ + + class CorrectParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class CreateFromApplicationParams(TypedDict): + application: "CreditUnderwritingRecordService.CreateFromApplicationParamsApplication" + """ + Details about the application submission. + """ + credit_user: "CreditUnderwritingRecordService.CreateFromApplicationParamsCreditUser" + """ + Information about the company or person applying or holding the account. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + + class CreateFromApplicationParamsApplication(TypedDict): + application_method: NotRequired[ + Literal["in_person", "mail", "online", "phone"] + ] + """ + The channel through which the applicant has submitted their application. Defaults to `online`. + """ + purpose: Literal["credit_limit_increase", "credit_line_opening"] + """ + Scope of demand made by the applicant. + """ + submitted_at: int + """ + Date when the applicant submitted their application. + """ + + class CreateFromApplicationParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CreateFromProactiveReviewParams(TypedDict): + credit_user: "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsCreditUser" + """ + Information about the company or person applying or holding the account. + """ + decided_at: int + """ + Date when a decision was made. + """ + decision: "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsDecision" + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class CreateFromProactiveReviewParamsCreditUser(TypedDict): + email: str + """ + Email of the applicant or accountholder. + """ + name: str + """ + Full name of the company or person. + """ + + class CreateFromProactiveReviewParamsDecision(TypedDict): + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + credit_limit_decreased: NotRequired[ + "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsDecisionCreditLimitDecreased" + ] + """ + Details about the credit limit decreased. + """ + credit_line_closed: NotRequired[ + "CreditUnderwritingRecordService.CreateFromProactiveReviewParamsDecisionCreditLineClosed" + ] + """ + Details about the credit line closed. + """ + type: Literal[ + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + ] + """ + Outcome of the decision. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLimitApproved( + TypedDict + ): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLimitDecreased( + TypedDict, + ): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + """ + + class CreateFromProactiveReviewParamsDecisionCreditLineClosed(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "change_in_financial_state", + "change_in_utilization_of_credit_line", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "decrease_in_income_to_expense_ratio", + "decrease_in_social_media_performance", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "exceeds_acceptable_platform_exposure", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "has_recent_credit_limit_increase", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_credit_utilization", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "insufficient_usage_as_qualified_expenses", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the credit line was closed, up to 4 reasons, in order of importance. + """ + + class CreateFromProactiveReviewParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + class ReportDecisionParams(TypedDict): + decided_at: int + """ + Date when a decision was made. + """ + decision: ( + "CreditUnderwritingRecordService.ReportDecisionParamsDecision" + ) + """ + Details about the decision. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + regulatory_reporting_file: NotRequired[str] + """ + File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + """ + underwriting_exception: NotRequired[ + "CreditUnderwritingRecordService.ReportDecisionParamsUnderwritingException" + ] + """ + If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + """ + + class ReportDecisionParamsDecision(TypedDict): + application_rejected: NotRequired[ + "CreditUnderwritingRecordService.ReportDecisionParamsDecisionApplicationRejected" + ] + """ + Details about the application rejection. + """ + credit_limit_approved: NotRequired[ + "CreditUnderwritingRecordService.ReportDecisionParamsDecisionCreditLimitApproved" + ] + """ + Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/) + """ + type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "withdrawn_by_applicant", + ] + """ + Outcome of the decision. + """ + + class ReportDecisionParamsDecisionApplicationRejected(TypedDict): + reason_other_explanation: NotRequired[str] + """ + Details about the `reasons.other` when present. + """ + reasons: List[ + Literal[ + "applicant_is_not_beneficial_owner", + "applicant_too_young", + "application_is_not_beneficial_owner", + "bankruptcy", + "business_size_too_small", + "current_account_tier_ineligible", + "customer_already_exists", + "customer_requested_account_closure", + "debt_to_cash_balance_ratio_too_high", + "debt_to_equity_ratio_too_high", + "delinquent_credit_obligations", + "dispute_rate_too_high", + "duration_of_residence", + "excessive_income_or_revenue_obligations", + "expenses_to_cash_balance_ratio_too_high", + "foreclosure_or_repossession", + "frozen_file_at_credit_bureau", + "garnishment_or_attachment", + "government_loan_program_criteria", + "high_concentration_of_clients", + "high_risk_industry", + "incomplete_application", + "inconsistent_monthly_revenues", + "insufficient_account_history_with_platform", + "insufficient_bank_account_history", + "insufficient_cash_balance", + "insufficient_cash_flow", + "insufficient_collateral", + "insufficient_credit_experience", + "insufficient_deposits", + "insufficient_income", + "insufficient_margin_ratio", + "insufficient_operating_profit", + "insufficient_period_in_operation", + "insufficient_reserves", + "insufficient_revenue", + "insufficient_social_media_performance", + "insufficient_time_in_network", + "insufficient_trade_credit_insurance", + "invalid_business_license", + "lacking_cash_account", + "late_payment_history_reported_to_bureau", + "lien_collection_action_or_judgement", + "negative_public_information", + "no_credit_file", + "other", + "outside_supported_country", + "outside_supported_state", + "poor_payment_history_with_platform", + "prior_or_current_legal_action", + "prohibited_industry", + "rate_of_cash_balance_fluctuation_too_high", + "recent_inquiries_on_business_credit_report", + "removal_of_bank_account_connection", + "revenue_discrepancy", + "runway_too_short", + "suspected_fraud", + "too_many_non_sufficient_funds_or_overdrafts", + "unable_to_verify_address", + "unable_to_verify_identity", + "unable_to_verify_income_or_revenue", + "unprofitable", + "unsupportable_business_type", + ] + ] + """ + List of reasons why the application was rejected, up to 4 reasons, in order of importance. + """ + + class ReportDecisionParamsDecisionCreditLimitApproved(TypedDict): + amount: int + """ + The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + """ + currency: NotRequired[str] + """ + The currency of the credit approved, will default to the Account's Issuing currency. + """ + + class ReportDecisionParamsUnderwritingException(TypedDict): + explanation: str + """ + Written explanation for the exception. + """ + original_decision_type: Literal[ + "additional_information_requested", + "application_rejected", + "credit_limit_approved", + "credit_limit_decreased", + "credit_line_closed", + "no_changes", + "withdrawn_by_applicant", + ] + """ + The decision before the exception was applied. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "CreditUnderwritingRecordService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditUnderwritingRecord]: + """ + Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + return cast( + ListObject[CreditUnderwritingRecord], + self._request( + "get", + "/v1/issuing/credit_underwriting_records", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "CreditUnderwritingRecordService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[CreditUnderwritingRecord]: + """ + Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. + """ + return cast( + ListObject[CreditUnderwritingRecord], + await self._request_async( + "get", + "/v1/issuing/credit_underwriting_records", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Retrieves a CreditUnderwritingRecord object. + """ + return cast( + CreditUnderwritingRecord, + self._request( + "get", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Retrieves a CreditUnderwritingRecord object. + """ + return cast( + CreditUnderwritingRecord, + await self._request_async( + "get", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def correct( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.CorrectParams" = {}, + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + CreditUnderwritingRecord, + self._request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def correct_async( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.CorrectParams" = {}, + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Update a CreditUnderwritingRecord object to correct mistakes. + """ + return cast( + CreditUnderwritingRecord, + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def report_decision( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.ReportDecisionParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + CreditUnderwritingRecord, + self._request( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def report_decision_async( + self, + credit_underwriting_record: str, + params: "CreditUnderwritingRecordService.ReportDecisionParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Update a CreditUnderwritingRecord object from a decision made on a credit application. + """ + return cast( + CreditUnderwritingRecord, + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( + credit_underwriting_record=sanitize_id( + credit_underwriting_record + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create_from_application( + self, + params: "CreditUnderwritingRecordService.CreateFromApplicationParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Creates a CreditUnderwritingRecord object with information about a credit application submission. + """ + return cast( + CreditUnderwritingRecord, + self._request( + "post", + "/v1/issuing/credit_underwriting_records/create_from_application", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_from_application_async( + self, + params: "CreditUnderwritingRecordService.CreateFromApplicationParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Creates a CreditUnderwritingRecord object with information about a credit application submission. + """ + return cast( + CreditUnderwritingRecord, + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/create_from_application", + base_address="api", + params=params, + options=options, + ), + ) + + def create_from_proactive_review( + self, + params: "CreditUnderwritingRecordService.CreateFromProactiveReviewParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. + """ + return cast( + CreditUnderwritingRecord, + self._request( + "post", + "/v1/issuing/credit_underwriting_records/create_from_proactive_review", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_from_proactive_review_async( + self, + params: "CreditUnderwritingRecordService.CreateFromProactiveReviewParams", + options: RequestOptions = {}, + ) -> CreditUnderwritingRecord: + """ + Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. + """ + return cast( + CreditUnderwritingRecord, + await self._request_async( + "post", + "/v1/issuing/credit_underwriting_records/create_from_proactive_review", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_dispute_settlement_detail.py b/stripe/issuing/_dispute_settlement_detail.py new file mode 100644 index 000000000..b7215693b --- /dev/null +++ b/stripe/issuing/_dispute_settlement_detail.py @@ -0,0 +1,169 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class DisputeSettlementDetail(ListableAPIResource["DisputeSettlementDetail"]): + """ + Represents a record from the card network of a money movement or change in state for an Issuing dispute. These records are included in the settlement reports that we receive from networks and expose to users as Settlement objects. + """ + + OBJECT_NAME: ClassVar[Literal["issuing.dispute_settlement_detail"]] = ( + "issuing.dispute_settlement_detail" + ) + + class NetworkData(StripeObject): + processing_date: Optional[str] + """ + The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + """ + + class ListParams(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. + """ + settlement: NotRequired[str] + """ + Select the Issuing dispute settlement details for the given settlement. + """ + 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. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount: int + """ + Disputed amount in the card's currency and in the smallest currency unit. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + """ + card: str + """ + The card used to make the original transaction. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + The currency the original transaction was made in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + dispute: str + """ + The ID of the linked dispute. + """ + event_type: Literal["filing", "loss", "representment", "win"] + """ + The type of event corresponding to this dispute settlement detail, representing the stage in the dispute network lifecycle. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + network: Literal["maestro", "mastercard", "visa"] + """ + The card network for this dispute settlement detail. One of ["visa", "mastercard", "maestro"] + """ + network_data: Optional[NetworkData] + """ + Details about the transaction, such as processing dates, set by the card network. + """ + object: Literal["issuing.dispute_settlement_detail"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + settlement: Optional[str] + """ + The ID of the linked card network settlement. + """ + + @classmethod + def list( + cls, **params: Unpack["DisputeSettlementDetail.ListParams"] + ) -> ListObject["DisputeSettlementDetail"]: + """ + Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["DisputeSettlementDetail.ListParams"] + ) -> ListObject["DisputeSettlementDetail"]: + """ + Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["DisputeSettlementDetail.RetrieveParams"], + ) -> "DisputeSettlementDetail": + """ + Retrieves an Issuing DisputeSettlementDetail object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, + id: str, + **params: Unpack["DisputeSettlementDetail.RetrieveParams"], + ) -> "DisputeSettlementDetail": + """ + Retrieves an Issuing DisputeSettlementDetail object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"network_data": NetworkData} diff --git a/stripe/issuing/_dispute_settlement_detail_service.py b/stripe/issuing/_dispute_settlement_detail_service.py new file mode 100644 index 000000000..8924dbc00 --- /dev/null +++ b/stripe/issuing/_dispute_settlement_detail_service.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.issuing._dispute_settlement_detail import DisputeSettlementDetail +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class DisputeSettlementDetailService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + settlement: NotRequired[str] + """ + Select the Issuing dispute settlement details for the given settlement. + """ + 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. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "DisputeSettlementDetailService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[DisputeSettlementDetail]: + """ + Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[DisputeSettlementDetail], + self._request( + "get", + "/v1/issuing/dispute_settlement_details", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "DisputeSettlementDetailService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[DisputeSettlementDetail]: + """ + Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + return cast( + ListObject[DisputeSettlementDetail], + await self._request_async( + "get", + "/v1/issuing/dispute_settlement_details", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + dispute_settlement_detail: str, + params: "DisputeSettlementDetailService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> DisputeSettlementDetail: + """ + Retrieves an Issuing DisputeSettlementDetail object. + """ + return cast( + DisputeSettlementDetail, + self._request( + "get", + "/v1/issuing/dispute_settlement_details/{dispute_settlement_detail}".format( + dispute_settlement_detail=sanitize_id( + dispute_settlement_detail + ), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + dispute_settlement_detail: str, + params: "DisputeSettlementDetailService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> DisputeSettlementDetail: + """ + Retrieves an Issuing DisputeSettlementDetail object. + """ + return cast( + DisputeSettlementDetail, + await self._request_async( + "get", + "/v1/issuing/dispute_settlement_details/{dispute_settlement_detail}".format( + dispute_settlement_detail=sanitize_id( + dispute_settlement_detail + ), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/issuing/_fraud_liability_debit.py b/stripe/issuing/_fraud_liability_debit.py new file mode 100644 index 000000000..94ee96e31 --- /dev/null +++ b/stripe/issuing/_fraud_liability_debit.py @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from typing import ClassVar, List, Optional +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._balance_transaction import BalanceTransaction + + +class FraudLiabilityDebit(ListableAPIResource["FraudLiabilityDebit"]): + """ + A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on Issuing transactions. + """ + + OBJECT_NAME: ClassVar[Literal["issuing.fraud_liability_debit"]] = ( + "issuing.fraud_liability_debit" + ) + + class ListParams(RequestOptions): + created: NotRequired["FraudLiabilityDebit.ListParamsCreated|int"] + """ + Only return Issuing Fraud Liability Debits that were created during the given date interval. + """ + 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. + """ + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + amount: int + """ + Debited amount. This is equal to the disputed amount and is given in the card's currency and in the smallest currency unit. + """ + balance_transaction: Optional[ExpandableField["BalanceTransaction"]] + """ + ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this debit. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + The currency of the debit. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + dispute: str + """ + The ID of the linked dispute. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["issuing.fraud_liability_debit"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def list( + cls, **params: Unpack["FraudLiabilityDebit.ListParams"] + ) -> ListObject["FraudLiabilityDebit"]: + """ + Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["FraudLiabilityDebit.ListParams"] + ) -> ListObject["FraudLiabilityDebit"]: + """ + Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + """ + 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["FraudLiabilityDebit.RetrieveParams"] + ) -> "FraudLiabilityDebit": + """ + Retrieves an Issuing FraudLiabilityDebit object. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FraudLiabilityDebit.RetrieveParams"] + ) -> "FraudLiabilityDebit": + """ + Retrieves an Issuing FraudLiabilityDebit object. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance diff --git a/stripe/_invoice_payment_service.py b/stripe/issuing/_fraud_liability_debit_service.py similarity index 56% rename from stripe/_invoice_payment_service.py rename to stripe/issuing/_fraud_liability_debit_service.py index 3f0929c70..bedc39734 100644 --- a/stripe/_invoice_payment_service.py +++ b/stripe/issuing/_fraud_liability_debit_service.py @@ -1,16 +1,22 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._invoice_payment import InvoicePayment from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id +from stripe.issuing._fraud_liability_debit import FraudLiabilityDebit from typing import List, cast -from typing_extensions import Literal, NotRequired, TypedDict +from typing_extensions import NotRequired, TypedDict -class InvoicePaymentService(StripeService): +class FraudLiabilityDebitService(StripeService): class ListParams(TypedDict): + created: NotRequired[ + "FraudLiabilityDebitService.ListParamsCreated|int" + ] + """ + Only return Issuing Fraud Liability Debits that were created during the given date interval. + """ 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. @@ -19,35 +25,31 @@ class ListParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - invoice: NotRequired[str] - """ - The identifier of the invoice whose payments to return. - """ 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. """ - payment: NotRequired["InvoicePaymentService.ListParamsPayment"] - """ - The payment details of the invoice payments to return. - """ 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. """ - status: NotRequired[Literal["canceled", "open", "paid"]] + + class ListParamsCreated(TypedDict): + gt: NotRequired[int] """ - The status of the invoice payments to return. + Minimum value to filter by (exclusive) """ - - class ListParamsPayment(TypedDict): - payment_intent: NotRequired[str] + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] """ - Only return invoice payments associated by this payment intent ID. + Maximum value to filter by (exclusive) """ - type: Literal["payment_intent"] + lte: NotRequired[int] """ - Only return invoice payments associated by this payment type. + Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): @@ -58,17 +60,17 @@ class RetrieveParams(TypedDict): def list( self, - params: "InvoicePaymentService.ListParams" = {}, + params: "FraudLiabilityDebitService.ListParams" = {}, options: RequestOptions = {}, - ) -> ListObject[InvoicePayment]: + ) -> ListObject[FraudLiabilityDebit]: """ - When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( - ListObject[InvoicePayment], + ListObject[FraudLiabilityDebit], self._request( "get", - "/v1/invoice_payments", + "/v1/issuing/fraud_liability_debits", base_address="api", params=params, options=options, @@ -77,17 +79,17 @@ def list( async def list_async( self, - params: "InvoicePaymentService.ListParams" = {}, + params: "FraudLiabilityDebitService.ListParams" = {}, options: RequestOptions = {}, - ) -> ListObject[InvoicePayment]: + ) -> ListObject[FraudLiabilityDebit]: """ - When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. + Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( - ListObject[InvoicePayment], + ListObject[FraudLiabilityDebit], await self._request_async( "get", - "/v1/invoice_payments", + "/v1/issuing/fraud_liability_debits", base_address="api", params=params, options=options, @@ -96,19 +98,19 @@ async def list_async( def retrieve( self, - invoice_payment: str, - params: "InvoicePaymentService.RetrieveParams" = {}, + fraud_liability_debit: str, + params: "FraudLiabilityDebitService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> InvoicePayment: + ) -> FraudLiabilityDebit: """ - Retrieves the invoice payment with the given ID. + Retrieves an Issuing FraudLiabilityDebit object. """ return cast( - InvoicePayment, + FraudLiabilityDebit, self._request( "get", - "/v1/invoice_payments/{invoice_payment}".format( - invoice_payment=sanitize_id(invoice_payment), + "/v1/issuing/fraud_liability_debits/{fraud_liability_debit}".format( + fraud_liability_debit=sanitize_id(fraud_liability_debit), ), base_address="api", params=params, @@ -118,19 +120,19 @@ def retrieve( async def retrieve_async( self, - invoice_payment: str, - params: "InvoicePaymentService.RetrieveParams" = {}, + fraud_liability_debit: str, + params: "FraudLiabilityDebitService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> InvoicePayment: + ) -> FraudLiabilityDebit: """ - Retrieves the invoice payment with the given ID. + Retrieves an Issuing FraudLiabilityDebit object. """ return cast( - InvoicePayment, + FraudLiabilityDebit, await self._request_async( "get", - "/v1/invoice_payments/{invoice_payment}".format( - invoice_payment=sanitize_id(invoice_payment), + "/v1/issuing/fraud_liability_debits/{fraud_liability_debit}".format( + fraud_liability_debit=sanitize_id(fraud_liability_debit), ), base_address="api", params=params, diff --git a/stripe/issuing/_settlement.py b/stripe/issuing/_settlement.py new file mode 100644 index 000000000..5818a9a89 --- /dev/null +++ b/stripe/issuing/_settlement.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, Optional +from typing_extensions import Literal + + +class Settlement(StripeObject): + """ + When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object. + """ + + OBJECT_NAME: ClassVar[Literal["issuing.settlement"]] = "issuing.settlement" + bin: str + """ + The Bank Identification Number reflecting this settlement record. + """ + clearing_date: int + """ + The date that the transactions are cleared and posted to user's accounts. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + id: str + """ + Unique identifier for the object. + """ + interchange_fees_amount: int + """ + The total interchange received as reimbursement for the transactions. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Dict[str, str] + """ + Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + net_total_amount: int + """ + The total net amount required to settle with the network. + """ + network: Literal["maestro", "visa"] + """ + The card network for this settlement report. One of ["visa", "maestro"] + """ + network_fees_amount: int + """ + The total amount of fees owed to the network. + """ + network_settlement_identifier: str + """ + The Settlement Identification Number assigned by the network. + """ + object: Literal["issuing.settlement"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + other_fees_amount: Optional[int] + """ + The total amount of any additional fees assessed by the card network. + """ + other_fees_count: Optional[int] + """ + The total number of additional fees assessed by the card network. + """ + settlement_service: str + """ + One of `international` or `uk_national_net`. + """ + status: Literal["complete", "pending"] + """ + The current processing status of this settlement. + """ + transaction_amount: int + """ + The total transaction amount reflected in this settlement. + """ + transaction_count: int + """ + The total number of transactions reflected in this settlement. + """ diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index f8baaa07e..c395a9880 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -24,6 +24,7 @@ from stripe.issuing._card import Card from stripe.issuing._cardholder import Cardholder from stripe.issuing._dispute import Dispute + from stripe.issuing._settlement import Settlement from stripe.issuing._token import Token @@ -1595,6 +1596,10 @@ class ListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + settlement: NotRequired[str] + """ + Only return transactions that are associated with the given settlement. + """ 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. @@ -1717,6 +1722,10 @@ class RetrieveParams(RequestOptions): """ Additional purchase information that is optionally provided by the merchant. """ + settlement: Optional[ExpandableField["Settlement"]] + """ + The ID of the [settlement](https://stripe.com/docs/api/issuing/settlements) to which this transaction belongs. + """ token: Optional[ExpandableField["Token"]] """ [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null. diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index f61d4622a..c17898263 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -35,6 +35,10 @@ class ListParams(TypedDict): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ + settlement: NotRequired[str] + """ + Only return transactions that are associated with the given settlement. + """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. diff --git a/stripe/privacy/__init__.py b/stripe/privacy/__init__.py new file mode 100644 index 000000000..a14073ede --- /dev/null +++ b/stripe/privacy/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.privacy._redaction_job import RedactionJob as RedactionJob +from stripe.privacy._redaction_job_service import ( + RedactionJobService as RedactionJobService, +) +from stripe.privacy._redaction_job_validation_error import ( + RedactionJobValidationError as RedactionJobValidationError, +) +from stripe.privacy._redaction_job_validation_error_service import ( + RedactionJobValidationErrorService as RedactionJobValidationErrorService, +) diff --git a/stripe/privacy/_redaction_job.py b/stripe/privacy/_redaction_job.py new file mode 100644 index 000000000..1b388158a --- /dev/null +++ b/stripe/privacy/_redaction_job.py @@ -0,0 +1,809 @@ +# -*- 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._nested_resource_class_methods import nested_resource_class_methods +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe.privacy._redaction_job_validation_error import ( + RedactionJobValidationError, + ) + + +@nested_resource_class_methods("validation_error") +class RedactionJob( + CreateableAPIResource["RedactionJob"], + ListableAPIResource["RedactionJob"], + UpdateableAPIResource["RedactionJob"], +): + """ + The Redaction Job object redacts Stripe objects. You can use it + to coordinate the removal of personal information from selected + objects, making them permanently inaccessible in the Stripe Dashboard + and API. + """ + + OBJECT_NAME: ClassVar[Literal["privacy.redaction_job"]] = ( + "privacy.redaction_job" + ) + + class Objects(StripeObject): + charges: Optional[List[str]] + """ + Charge object identifiers usually starting with `ch_` + """ + checkout_sessions: Optional[List[str]] + """ + CheckoutSession object identifiers starting with `cs_` + """ + customers: Optional[List[str]] + """ + Customer object identifiers starting with `cus_` + """ + identity_verification_sessions: Optional[List[str]] + """ + Identity VerificationSessions object identifiers starting with `vs_` + """ + invoices: Optional[List[str]] + """ + Invoice object identifiers starting with `in_` + """ + issuing_cardholders: Optional[List[str]] + """ + Issuing Cardholder object identifiers starting with `ich_` + """ + payment_intents: Optional[List[str]] + """ + PaymentIntent object identifiers starting with `pi_` + """ + radar_value_list_items: Optional[List[str]] + """ + Fraud ValueListItem object identifiers starting with `rsli_` + """ + setup_intents: Optional[List[str]] + """ + SetupIntent object identifiers starting with `seti_` + """ + + class CancelParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + objects: "RedactionJob.CreateParamsObjects" + """ + The objects to redact. These root objects and their related ones will be validated for redaction. + """ + validation_behavior: NotRequired[Literal["error", "fix"]] + """ + Determines the validation behavior of the job. Default is `error`. + """ + + class CreateParamsObjects(TypedDict): + charges: NotRequired[List[str]] + checkout_sessions: NotRequired[List[str]] + customers: NotRequired[List[str]] + identity_verification_sessions: NotRequired[List[str]] + invoices: NotRequired[List[str]] + issuing_cardholders: NotRequired[List[str]] + issuing_cards: NotRequired[List[str]] + payment_intents: NotRequired[List[str]] + radar_value_list_items: NotRequired[List[str]] + setup_intents: NotRequired[List[str]] + + class ListParams(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. + """ + status: NotRequired[ + Literal[ + "canceled", + "canceling", + "created", + "failed", + "ready", + "redacting", + "succeeded", + "validating", + ] + ] + + class ListValidationErrorsParams(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. + """ + + class ModifyParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + validation_behavior: NotRequired[Literal["error", "fix"]] + """ + Determines the validation behavior of the job. Default is `error`. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RunParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class ValidateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["privacy.redaction_job"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + objects: Optional[Objects] + """ + The objects to redact in this job. + """ + status: Literal[ + "canceled", + "canceling", + "created", + "failed", + "ready", + "redacting", + "succeeded", + "validating", + ] + """ + The status of the job. + """ + validation_behavior: Optional[Literal["error", "fix"]] + """ + Validation behavior determines how a job validates objects for redaction eligibility. Default is `error`. + """ + + @classmethod + def _cls_cancel( + cls, job: str, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + "RedactionJob", + cls._static_request( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + def cancel( + job: str, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + ... + + @overload + def cancel( + self, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + ... + + @class_method_variant("_cls_cancel") + def cancel( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + "RedactionJob", + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_cancel_async( + cls, job: str, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + "RedactionJob", + await cls._static_request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + job: str, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.CancelParams"] + ) -> "RedactionJob": + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + "RedactionJob", + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create( + cls, **params: Unpack["RedactionJob.CreateParams"] + ) -> "RedactionJob": + """ + Creates a redaction job. When a job is created, it will start to validate. + """ + return cast( + "RedactionJob", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["RedactionJob.CreateParams"] + ) -> "RedactionJob": + """ + Creates a redaction job. When a job is created, it will start to validate. + """ + return cast( + "RedactionJob", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["RedactionJob.ListParams"] + ) -> ListObject["RedactionJob"]: + """ + Returns a list of redaction jobs. + """ + 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["RedactionJob.ListParams"] + ) -> ListObject["RedactionJob"]: + """ + Returns a list of redaction jobs. + """ + 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 modify( + cls, id: str, **params: Unpack["RedactionJob.ModifyParams"] + ) -> "RedactionJob": + """ + Updates the properties of a redaction job without running or canceling the job. + + If the job to update is in a failed status, it will not automatically start to validate. Once you applied all of the changes, use the validate API to start validation again. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "RedactionJob", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["RedactionJob.ModifyParams"] + ) -> "RedactionJob": + """ + Updates the properties of a redaction job without running or canceling the job. + + If the job to update is in a failed status, it will not automatically start to validate. Once you applied all of the changes, use the validate API to start validation again. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "RedactionJob", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["RedactionJob.RetrieveParams"] + ) -> "RedactionJob": + """ + Retrieves the details of a previously created redaction job. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["RedactionJob.RetrieveParams"] + ) -> "RedactionJob": + """ + Retrieves the details of a previously created redaction job. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_run( + cls, job: str, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + "RedactionJob", + cls._static_request( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + def run( + job: str, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + ... + + @overload + def run( + self, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + ... + + @class_method_variant("_cls_run") + def run( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + "RedactionJob", + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_run_async( + cls, job: str, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + "RedactionJob", + await cls._static_request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def run_async( + job: str, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + ... + + @overload + async def run_async( + self, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + ... + + @class_method_variant("_cls_run_async") + async def run_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.RunParams"] + ) -> "RedactionJob": + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + "RedactionJob", + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_validate( + cls, job: str, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + "RedactionJob", + cls._static_request( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + def validate( + job: str, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + ... + + @overload + def validate( + self, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + ... + + @class_method_variant("_cls_validate") + def validate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + "RedactionJob", + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_validate_async( + cls, job: str, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + "RedactionJob", + await cls._static_request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def validate_async( + job: str, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + ... + + @overload + async def validate_async( + self, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + ... + + @class_method_variant("_cls_validate_async") + async def validate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["RedactionJob.ValidateParams"] + ) -> "RedactionJob": + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + "RedactionJob", + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list_validation_errors( + cls, + job: str, + **params: Unpack["RedactionJob.ListValidationErrorsParams"], + ) -> ListObject["RedactionJobValidationError"]: + """ + Returns a list of validation errors for the specified redaction job. + """ + return cast( + ListObject["RedactionJobValidationError"], + cls._static_request( + "get", + "/v1/privacy/redaction_jobs/{job}/validation_errors".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + @classmethod + async def list_validation_errors_async( + cls, + job: str, + **params: Unpack["RedactionJob.ListValidationErrorsParams"], + ) -> ListObject["RedactionJobValidationError"]: + """ + Returns a list of validation errors for the specified redaction job. + """ + return cast( + ListObject["RedactionJobValidationError"], + await cls._static_request_async( + "get", + "/v1/privacy/redaction_jobs/{job}/validation_errors".format( + job=sanitize_id(job) + ), + params=params, + ), + ) + + _inner_class_types = {"objects": Objects} diff --git a/stripe/privacy/_redaction_job_service.py b/stripe/privacy/_redaction_job_service.py new file mode 100644 index 000000000..7acb1b164 --- /dev/null +++ b/stripe/privacy/_redaction_job_service.py @@ -0,0 +1,430 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.privacy._redaction_job import RedactionJob +from stripe.privacy._redaction_job_validation_error_service import ( + RedactionJobValidationErrorService, +) +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class RedactionJobService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.validation_errors = RedactionJobValidationErrorService( + self._requestor, + ) + + class CancelParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class CreateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + objects: "RedactionJobService.CreateParamsObjects" + """ + The objects to redact. These root objects and their related ones will be validated for redaction. + """ + validation_behavior: NotRequired[Literal["error", "fix"]] + """ + Determines the validation behavior of the job. Default is `error`. + """ + + class CreateParamsObjects(TypedDict): + charges: NotRequired[List[str]] + checkout_sessions: NotRequired[List[str]] + customers: NotRequired[List[str]] + identity_verification_sessions: NotRequired[List[str]] + invoices: NotRequired[List[str]] + issuing_cardholders: NotRequired[List[str]] + issuing_cards: NotRequired[List[str]] + payment_intents: NotRequired[List[str]] + radar_value_list_items: NotRequired[List[str]] + setup_intents: NotRequired[List[str]] + + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + Literal[ + "canceled", + "canceling", + "created", + "failed", + "ready", + "redacting", + "succeeded", + "validating", + ] + ] + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RunParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class UpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + validation_behavior: NotRequired[Literal["error", "fix"]] + """ + Determines the validation behavior of the job. Default is `error`. + """ + + class ValidateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, + params: "RedactionJobService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[RedactionJob]: + """ + Returns a list of redaction jobs. + """ + return cast( + ListObject[RedactionJob], + self._request( + "get", + "/v1/privacy/redaction_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "RedactionJobService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[RedactionJob]: + """ + Returns a list of redaction jobs. + """ + return cast( + ListObject[RedactionJob], + await self._request_async( + "get", + "/v1/privacy/redaction_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "RedactionJobService.CreateParams", + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Creates a redaction job. When a job is created, it will start to validate. + """ + return cast( + RedactionJob, + self._request( + "post", + "/v1/privacy/redaction_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "RedactionJobService.CreateParams", + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Creates a redaction job. When a job is created, it will start to validate. + """ + return cast( + RedactionJob, + await self._request_async( + "post", + "/v1/privacy/redaction_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + job: str, + params: "RedactionJobService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Retrieves the details of a previously created redaction job. + """ + return cast( + RedactionJob, + self._request( + "get", + "/v1/privacy/redaction_jobs/{job}".format( + job=sanitize_id(job) + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + job: str, + params: "RedactionJobService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Retrieves the details of a previously created redaction job. + """ + return cast( + RedactionJob, + await self._request_async( + "get", + "/v1/privacy/redaction_jobs/{job}".format( + job=sanitize_id(job) + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + job: str, + params: "RedactionJobService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Updates the properties of a redaction job without running or canceling the job. + + If the job to update is in a failed status, it will not automatically start to validate. Once you applied all of the changes, use the validate API to start validation again. + """ + return cast( + RedactionJob, + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}".format( + job=sanitize_id(job) + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + job: str, + params: "RedactionJobService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Updates the properties of a redaction job without running or canceling the job. + + If the job to update is in a failed status, it will not automatically start to validate. Once you applied all of the changes, use the validate API to start validation again. + """ + return cast( + RedactionJob, + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}".format( + job=sanitize_id(job) + ), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + job: str, + params: "RedactionJobService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + RedactionJob, + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + job: str, + params: "RedactionJobService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + You can cancel a redaction job when it's in one of these statuses: ready, failed. + + Canceling the redaction job will abandon its attempt to redact the configured objects. A canceled job cannot be used again. + """ + return cast( + RedactionJob, + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/cancel".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def run( + self, + job: str, + params: "RedactionJobService.RunParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + RedactionJob, + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def run_async( + self, + job: str, + params: "RedactionJobService.RunParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Run a redaction job in a ready status. + + When you run a job, the configured objects will be redacted asynchronously. This action is irreversible and cannot be canceled once started. + + The status of the job will move to redacting. Once all of the objects are redacted, the status will become succeeded. If the job's validation_behavior is set to fix, the automatic fixes will be applied to objects at this step. + """ + return cast( + RedactionJob, + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/run".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def validate( + self, + job: str, + params: "RedactionJobService.ValidateParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + RedactionJob, + self._request( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def validate_async( + self, + job: str, + params: "RedactionJobService.ValidateParams" = {}, + options: RequestOptions = {}, + ) -> RedactionJob: + """ + Validate a redaction job when it is in a failed status. + + When a job is created, it automatically begins to validate on the configured objects' eligibility for redaction. Use this to validate the job again after its validation errors are resolved or the job's validation_behavior is changed. + + The status of the job will move to validating. Once all of the objects are validated, the status of the job will become ready. If there are any validation errors preventing the job from running, the status will become failed. + """ + return cast( + RedactionJob, + await self._request_async( + "post", + "/v1/privacy/redaction_jobs/{job}/validate".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/privacy/_redaction_job_validation_error.py b/stripe/privacy/_redaction_job_validation_error.py new file mode 100644 index 000000000..0c1193e3e --- /dev/null +++ b/stripe/privacy/_redaction_job_validation_error.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class RedactionJobValidationError(StripeObject): + """ + The Redaction Job validation error object contains information about + errors that affect the ability to redact a specific object in a + redaction job. + """ + + OBJECT_NAME: ClassVar[ + Literal["privacy.redaction_job_validation_error"] + ] = "privacy.redaction_job_validation_error" + + class ErroringObject(StripeObject): + id: str + """ + Unique identifier for the object. + """ + object_type: str + """ + Erroring object type + """ + + code: Literal[ + "invalid_cascading_source", + "invalid_file_purpose", + "invalid_state", + "locked_by_other_job", + "too_many_objects", + ] + """ + A code indicating the reason for the error. + """ + erroring_object: Optional[ErroringObject] + """ + If the error is related to a specific object, this field includes the object's identifier and object type. + """ + id: str + """ + Unique identifier for the object. + """ + message: str + """ + A human-readable message providing more details about the error. + """ + object: Literal["privacy.redaction_job_validation_error"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + _inner_class_types = {"erroring_object": ErroringObject} diff --git a/stripe/privacy/_redaction_job_validation_error_service.py b/stripe/privacy/_redaction_job_validation_error_service.py new file mode 100644 index 000000000..6a6fcefdd --- /dev/null +++ b/stripe/privacy/_redaction_job_validation_error_service.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.privacy._redaction_job_validation_error import ( + RedactionJobValidationError, +) +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class RedactionJobValidationErrorService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + + def list( + self, + job: str, + params: "RedactionJobValidationErrorService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[RedactionJobValidationError]: + """ + Returns a list of validation errors for the specified redaction job. + """ + return cast( + ListObject[RedactionJobValidationError], + self._request( + "get", + "/v1/privacy/redaction_jobs/{job}/validation_errors".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + job: str, + params: "RedactionJobValidationErrorService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[RedactionJobValidationError]: + """ + Returns a list of validation errors for the specified redaction job. + """ + return cast( + ListObject[RedactionJobValidationError], + await self._request_async( + "get", + "/v1/privacy/redaction_jobs/{job}/validation_errors".format( + job=sanitize_id(job), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/__init__.py b/stripe/tax/__init__.py index 4328458b6..256d22c54 100644 --- a/stripe/tax/__init__.py +++ b/stripe/tax/__init__.py @@ -1,5 +1,9 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.tax._association import Association as Association +from stripe.tax._association_service import ( + AssociationService as AssociationService, +) from stripe.tax._calculation import Calculation as Calculation from stripe.tax._calculation_line_item import ( CalculationLineItem as CalculationLineItem, @@ -10,6 +14,8 @@ from stripe.tax._calculation_service import ( CalculationService as CalculationService, ) +from stripe.tax._form import Form as Form +from stripe.tax._form_service import FormService as FormService from stripe.tax._registration import Registration as Registration from stripe.tax._registration_service import ( RegistrationService as RegistrationService, diff --git a/stripe/tax/_association.py b/stripe/tax/_association.py new file mode 100644 index 000000000..c153c3cb9 --- /dev/null +++ b/stripe/tax/_association.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional, cast +from typing_extensions import Literal, NotRequired, Unpack + + +class Association(APIResource["Association"]): + """ + A Tax Association exposes the Tax Transactions that Stripe attempted to create on your behalf based on the PaymentIntent input + """ + + OBJECT_NAME: ClassVar[Literal["tax.association"]] = "tax.association" + + class TaxTransactionAttempt(StripeObject): + class Committed(StripeObject): + transaction: str + """ + The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + """ + + class Errored(StripeObject): + reason: Literal[ + "another_payment_associated_with_calculation", + "calculation_expired", + "currency_mismatch", + "original_transaction_voided", + "unique_reference_violation", + ] + """ + Details on why we couldn't commit the tax transaction. + """ + + committed: Optional[Committed] + errored: Optional[Errored] + source: str + """ + The source of the tax transaction attempt. This is either a refund or a payment intent. + """ + status: str + """ + The status of the transaction attempt. This can be `errored` or `committed`. + """ + _inner_class_types = {"committed": Committed, "errored": Errored} + + class FindParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + Valid [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) id + """ + + calculation: str + """ + The [Tax Calculation](https://stripe.com/docs/api/tax/calculations/object) that was included in PaymentIntent. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["tax.association"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_intent: str + """ + The [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) that this Tax Association is tracking. + """ + tax_transaction_attempts: Optional[List[TaxTransactionAttempt]] + """ + Information about the tax transactions linked to this payment intent + """ + + @classmethod + def find(cls, **params: Unpack["Association.FindParams"]) -> "Association": + """ + Finds a tax association object by PaymentIntent id. + """ + return cast( + "Association", + cls._static_request( + "get", + "/v1/tax/associations/find", + params=params, + ), + ) + + @classmethod + async def find_async( + cls, **params: Unpack["Association.FindParams"] + ) -> "Association": + """ + Finds a tax association object by PaymentIntent id. + """ + return cast( + "Association", + await cls._static_request_async( + "get", + "/v1/tax/associations/find", + params=params, + ), + ) + + _inner_class_types = {"tax_transaction_attempts": TaxTransactionAttempt} diff --git a/stripe/tax/_association_service.py b/stripe/tax/_association_service.py new file mode 100644 index 000000000..6ed5b6ee1 --- /dev/null +++ b/stripe/tax/_association_service.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.tax._association import Association +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class AssociationService(StripeService): + class FindParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + Valid [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) id + """ + + def find( + self, + params: "AssociationService.FindParams", + options: RequestOptions = {}, + ) -> Association: + """ + Finds a tax association object by PaymentIntent id. + """ + return cast( + Association, + self._request( + "get", + "/v1/tax/associations/find", + base_address="api", + params=params, + options=options, + ), + ) + + async def find_async( + self, + params: "AssociationService.FindParams", + options: RequestOptions = {}, + ) -> Association: + """ + Finds a tax association object by PaymentIntent id. + """ + return cast( + Association, + await self._request_async( + "get", + "/v1/tax/associations/find", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_form.py b/stripe/tax/_form.py new file mode 100644 index 000000000..eefc88f98 --- /dev/null +++ b/stripe/tax/_form.py @@ -0,0 +1,420 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import Any, ClassVar, List, Optional, cast, overload +from typing_extensions import ( + Literal, + NotRequired, + TypedDict, + Unpack, + TYPE_CHECKING, +) + +if TYPE_CHECKING: + from stripe._account import Account + + +class Form(ListableAPIResource["Form"]): + """ + Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes. + + Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting) + """ + + OBJECT_NAME: ClassVar[Literal["tax.form"]] = "tax.form" + + class AuSerr(StripeObject): + reporting_period_end_date: str + """ + End date of the period represented by the information reported on the tax form. + """ + reporting_period_start_date: str + """ + Start date of the period represented by the information reported on the tax form. + """ + + class CaMrdp(StripeObject): + reporting_period_end_date: str + """ + End date of the period represented by the information reported on the tax form. + """ + reporting_period_start_date: str + """ + Start date of the period represented by the information reported on the tax form. + """ + + class EuDac7(StripeObject): + reporting_period_end_date: str + """ + End date of the period represented by the information reported on the tax form. + """ + reporting_period_start_date: str + """ + Start date of the period represented by the information reported on the tax form. + """ + + class FilingStatus(StripeObject): + class Jurisdiction(StripeObject): + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + level: Literal["country", "state"] + """ + Indicates the level of the jurisdiction where the form was filed. + """ + state: Optional[str] + """ + [ISO 3166-2 U.S. state code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix, if any. For example, "NY" for New York, United States. Null for non-U.S. forms. + """ + + effective_at: int + """ + Time when the filing status was updated. + """ + jurisdiction: Jurisdiction + value: Literal["accepted", "filed", "rejected"] + """ + The current status of the filed form. + """ + _inner_class_types = {"jurisdiction": Jurisdiction} + + class GbMrdp(StripeObject): + reporting_period_end_date: str + """ + End date of the period represented by the information reported on the tax form. + """ + reporting_period_start_date: str + """ + Start date of the period represented by the information reported on the tax form. + """ + + class NzMrdp(StripeObject): + reporting_period_end_date: str + """ + End date of the period represented by the information reported on the tax form. + """ + reporting_period_start_date: str + """ + Start date of the period represented by the information reported on the tax form. + """ + + class Payee(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The ID of the payee's Stripe account. + """ + external_reference: Optional[str] + """ + The external reference to this payee. + """ + type: Literal["account", "external_reference"] + """ + Either `account` or `external_reference`. + """ + + class Us1099K(StripeObject): + reporting_year: int + """ + Year represented by the information reported on the tax form. + """ + + class Us1099Misc(StripeObject): + reporting_year: int + """ + Year represented by the information reported on the tax form. + """ + + class Us1099Nec(StripeObject): + reporting_year: int + """ + Year represented by the information reported on the tax form. + """ + + class ListParams(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. + """ + payee: "Form.ListParamsPayee" + """ + The payee whose volume is represented on the tax form. + """ + 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: NotRequired[ + Literal[ + "au_serr", + "ca_mrdp", + "eu_dac7", + "gb_mrdp", + "nz_mrdp", + "us_1099_k", + "us_1099_misc", + "us_1099_nec", + ] + ] + """ + An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future tax form types. If your integration expects only one type of tax form in the response, make sure to provide a type value in the request. + """ + + class ListParamsPayee(TypedDict): + account: NotRequired[str] + """ + The ID of the Stripe account whose forms will be retrieved. + """ + external_reference: NotRequired[str] + """ + The external reference to the payee whose forms will be retrieved. + """ + type: NotRequired[Literal["account", "external_reference"]] + """ + Specifies the payee type. Either `account` or `external_reference`. + """ + + class PdfParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + au_serr: Optional[AuSerr] + ca_mrdp: Optional[CaMrdp] + corrected_by: Optional[ExpandableField["Form"]] + """ + The form that corrects this form, if any. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + eu_dac7: Optional[EuDac7] + filing_statuses: List[FilingStatus] + """ + A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction's tax authority. + """ + gb_mrdp: Optional[GbMrdp] + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + nz_mrdp: Optional[NzMrdp] + object: Literal["tax.form"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payee: Payee + type: Literal[ + "au_serr", + "ca_mrdp", + "eu_dac7", + "gb_mrdp", + "nz_mrdp", + "us_1099_k", + "us_1099_misc", + "us_1099_nec", + ] + """ + The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type. + """ + us_1099_k: Optional[Us1099K] + us_1099_misc: Optional[Us1099Misc] + us_1099_nec: Optional[Us1099Nec] + + @classmethod + def list(cls, **params: Unpack["Form.ListParams"]) -> ListObject["Form"]: + """ + Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. + """ + 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["Form.ListParams"] + ) -> ListObject["Form"]: + """ + Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. + """ + 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 _cls_pdf(cls, id: str, **params: Unpack["Form.PdfParams"]) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + cls._static_request_stream( + "get", + "/v1/tax/forms/{id}/pdf".format(id=sanitize_id(id)), + params=params, + base_address="files", + ), + ) + + @overload + @staticmethod + def pdf(id: str, **params: Unpack["Form.PdfParams"]) -> Any: + """ + Download the PDF for a tax form. + """ + ... + + @overload + def pdf(self, **params: Unpack["Form.PdfParams"]) -> Any: + """ + Download the PDF for a tax form. + """ + ... + + @class_method_variant("_cls_pdf") + def pdf( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Form.PdfParams"] + ) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + self._request_stream( + "get", + "/v1/tax/forms/{id}/pdf".format( + id=sanitize_id(self.get("id")) + ), + params=params, + base_address="files", + ), + ) + + @classmethod + async def _cls_pdf_async( + cls, id: str, **params: Unpack["Form.PdfParams"] + ) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + await cls._static_request_stream_async( + "get", + "/v1/tax/forms/{id}/pdf".format(id=sanitize_id(id)), + params=params, + base_address="files", + ), + ) + + @overload + @staticmethod + async def pdf_async(id: str, **params: Unpack["Form.PdfParams"]) -> Any: + """ + Download the PDF for a tax form. + """ + ... + + @overload + async def pdf_async(self, **params: Unpack["Form.PdfParams"]) -> Any: + """ + Download the PDF for a tax form. + """ + ... + + @class_method_variant("_cls_pdf_async") + async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Form.PdfParams"] + ) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + await self._request_stream_async( + "get", + "/v1/tax/forms/{id}/pdf".format( + id=sanitize_id(self.get("id")) + ), + params=params, + base_address="files", + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["Form.RetrieveParams"] + ) -> "Form": + """ + Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["Form.RetrieveParams"] + ) -> "Form": + """ + Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = { + "au_serr": AuSerr, + "ca_mrdp": CaMrdp, + "eu_dac7": EuDac7, + "filing_statuses": FilingStatus, + "gb_mrdp": GbMrdp, + "nz_mrdp": NzMrdp, + "payee": Payee, + "us_1099_k": Us1099K, + "us_1099_misc": Us1099Misc, + "us_1099_nec": Us1099Nec, + } diff --git a/stripe/tax/_form_service.py b/stripe/tax/_form_service.py new file mode 100644 index 000000000..84a5e1003 --- /dev/null +++ b/stripe/tax/_form_service.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._list_object import ListObject +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.tax._form import Form +from typing import Any, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class FormService(StripeService): + class ListParams(TypedDict): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + payee: "FormService.ListParamsPayee" + """ + The payee whose volume is represented on the tax form. + """ + 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: NotRequired[ + Literal[ + "au_serr", + "ca_mrdp", + "eu_dac7", + "gb_mrdp", + "nz_mrdp", + "us_1099_k", + "us_1099_misc", + "us_1099_nec", + ] + ] + """ + An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future tax form types. If your integration expects only one type of tax form in the response, make sure to provide a type value in the request. + """ + + class ListParamsPayee(TypedDict): + account: NotRequired[str] + """ + The ID of the Stripe account whose forms will be retrieved. + """ + external_reference: NotRequired[str] + """ + The external reference to the payee whose forms will be retrieved. + """ + type: NotRequired[Literal["account", "external_reference"]] + """ + Specifies the payee type. Either `account` or `external_reference`. + """ + + class PdfParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def list( + self, params: "FormService.ListParams", options: RequestOptions = {} + ) -> ListObject[Form]: + """ + Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. + """ + return cast( + ListObject[Form], + self._request( + "get", + "/v1/tax/forms", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, params: "FormService.ListParams", options: RequestOptions = {} + ) -> ListObject[Form]: + """ + Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. + """ + return cast( + ListObject[Form], + await self._request_async( + "get", + "/v1/tax/forms", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "FormService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Form: + """ + Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. + """ + return cast( + Form, + self._request( + "get", + "/v1/tax/forms/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "FormService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Form: + """ + Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. + """ + return cast( + Form, + await self._request_async( + "get", + "/v1/tax/forms/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def pdf( + self, + id: str, + params: "FormService.PdfParams" = {}, + options: RequestOptions = {}, + ) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + self._request_stream( + "get", + "/v1/tax/forms/{id}/pdf".format(id=sanitize_id(id)), + base_address="files", + params=params, + options=options, + ), + ) + + async def pdf_async( + self, + id: str, + params: "FormService.PdfParams" = {}, + options: RequestOptions = {}, + ) -> Any: + """ + Download the PDF for a tax form. + """ + return cast( + Any, + await self._request_stream_async( + "get", + "/v1/tax/forms/{id}/pdf".format(id=sanitize_id(id)), + base_address="files", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/__init__.py b/stripe/terminal/__init__.py index e4bff0712..5d8761712 100644 --- a/stripe/terminal/__init__.py +++ b/stripe/terminal/__init__.py @@ -15,4 +15,10 @@ LocationService as LocationService, ) from stripe.terminal._reader import Reader as Reader +from stripe.terminal._reader_collected_data import ( + ReaderCollectedData as ReaderCollectedData, +) +from stripe.terminal._reader_collected_data_service import ( + ReaderCollectedDataService as ReaderCollectedDataService, +) from stripe.terminal._reader_service import ReaderService as ReaderService diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index b1ec7dba0..36efc2b8b 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -23,6 +23,7 @@ if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent + from stripe._payment_method import PaymentMethod from stripe._refund import Refund from stripe._setup_intent import SetupIntent from stripe.terminal._location import Location @@ -212,6 +213,71 @@ class Toggle(StripeObject): """ _inner_class_types = {"inputs": Input} + class CollectPaymentMethod(StripeObject): + class CollectConfig(StripeObject): + class Tipping(StripeObject): + amount_eligible: Optional[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + enable_customer_cancellation: Optional[bool] + """ + Enable customer initiated cancellation when processing this payment. + """ + skip_tipping: Optional[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: Optional[Tipping] + """ + Represents a per-transaction tipping configuration + """ + _inner_class_types = {"tipping": Tipping} + + account: Optional[str] + """ + Account the payment intent belongs to. + """ + collect_config: Optional[CollectConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + payment_method: Optional["PaymentMethod"] + """ + PaymentMethod objects represent your customer's payment instruments. + You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + Customer objects to store instrument details for future payments. + + Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + """ + _inner_class_types = {"collect_config": CollectConfig} + + class ConfirmPaymentIntent(StripeObject): + class ConfirmConfig(StripeObject): + return_url: Optional[str] + """ + If the customer does not abandon authenticating the payment, they will be redirected to this specified URL after completion. + """ + + account: Optional[str] + """ + Account the payment intent belongs to. + """ + confirm_config: Optional[ConfirmConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + _inner_class_types = {"confirm_config": ConfirmConfig} + class ProcessPaymentIntent(StripeObject): class ProcessConfig(StripeObject): class Tipping(StripeObject): @@ -238,6 +304,10 @@ class Tipping(StripeObject): """ _inner_class_types = {"tipping": Tipping} + account: Optional[str] + """ + Account the payment intent belongs to. + """ payment_intent: ExpandableField["PaymentIntent"] """ Most recent PaymentIntent processed by the reader. @@ -276,6 +346,10 @@ class RefundPaymentConfig(StripeObject): Enable customer initiated cancellation when refunding this payment. """ + account: Optional[str] + """ + Account the payment intent belongs to. + """ amount: Optional[int] """ The amount being refunded. @@ -364,6 +438,14 @@ class LineItem(StripeObject): """ Represents a reader action to collect customer inputs """ + collect_payment_method: Optional[CollectPaymentMethod] + """ + Represents a reader action to collect a payment method + """ + confirm_payment_intent: Optional[ConfirmPaymentIntent] + """ + Represents a reader action to confirm a payment + """ failure_code: Optional[str] """ Failure code, only set if status is `failed`. @@ -394,6 +476,8 @@ class LineItem(StripeObject): """ type: Literal[ "collect_inputs", + "collect_payment_method", + "confirm_payment_intent", "process_payment_intent", "process_setup_intent", "refund_payment", @@ -404,6 +488,8 @@ class LineItem(StripeObject): """ _inner_class_types = { "collect_inputs": CollectInputs, + "collect_payment_method": CollectPaymentMethod, + "confirm_payment_intent": ConfirmPaymentIntent, "process_payment_intent": ProcessPaymentIntent, "process_setup_intent": ProcessSetupIntent, "refund_payment": RefundPayment, @@ -506,6 +592,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(RequestOptions): + collect_config: NotRequired[ + "Reader.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID + """ + + class CollectPaymentMethodParamsCollectConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ + enable_customer_cancellation: NotRequired[bool] + """ + Enables cancel button on transaction screens. + """ + skip_tipping: NotRequired[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: NotRequired[ + "Reader.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(TypedDict): + amount_eligible: NotRequired[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + class ConfirmPaymentIntentParams(RequestOptions): + confirm_config: NotRequired[ + "Reader.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + """ + class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -1096,6 +1248,226 @@ async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_collect_payment_method( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def collect_payment_method( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + def collect_payment_method( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method") + def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_collect_payment_method_async( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def collect_payment_method_async( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + async def collect_payment_method_async( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method_async") + async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_confirm_payment_intent( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def confirm_payment_intent( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + def confirm_payment_intent( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent") + def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_confirm_payment_intent_async( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def confirm_payment_intent_async( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + async def confirm_payment_intent_async( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent_async") + async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ diff --git a/stripe/terminal/_reader_collected_data.py b/stripe/terminal/_reader_collected_data.py new file mode 100644 index 000000000..b825e7f5d --- /dev/null +++ b/stripe/terminal/_reader_collected_data.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._request_options import RequestOptions +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal, NotRequired, Unpack + + +class ReaderCollectedData(APIResource["ReaderCollectedData"]): + """ + Returns data collected by Terminal readers. This data is only stored for 24 hours. + """ + + OBJECT_NAME: ClassVar[Literal["terminal.reader_collected_data"]] = ( + "terminal.reader_collected_data" + ) + + class Magstripe(StripeObject): + data: Optional[str] + """ + The raw magstripe data collected by the reader. + """ + + class RetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + magstripe: Optional[Magstripe] + """ + The magstripe data collected by the reader. + """ + object: Literal["terminal.reader_collected_data"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + type: Literal["magstripe"] + """ + The type of data collected by the reader. + """ + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["ReaderCollectedData.RetrieveParams"] + ) -> "ReaderCollectedData": + """ + Retrieve data collected using Reader hardware. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ReaderCollectedData.RetrieveParams"] + ) -> "ReaderCollectedData": + """ + Retrieve data collected using Reader hardware. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/terminal/reader_collected_data" + + _inner_class_types = {"magstripe": Magstripe} diff --git a/stripe/terminal/_reader_collected_data_service.py b/stripe/terminal/_reader_collected_data_service.py new file mode 100644 index 000000000..c4ab111a6 --- /dev/null +++ b/stripe/terminal/_reader_collected_data_service.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.terminal._reader_collected_data import ReaderCollectedData +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class ReaderCollectedDataService(StripeService): + class RetrieveParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + def retrieve( + self, + reader_collected_data: str, + params: "ReaderCollectedDataService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReaderCollectedData: + """ + Retrieve data collected using Reader hardware. + """ + return cast( + ReaderCollectedData, + self._request( + "get", + "/v1/terminal/reader_collected_data/{reader_collected_data}".format( + reader_collected_data=sanitize_id(reader_collected_data), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + reader_collected_data: str, + params: "ReaderCollectedDataService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReaderCollectedData: + """ + Retrieve data collected using Reader hardware. + """ + return cast( + ReaderCollectedData, + await self._request_async( + "get", + "/v1/terminal/reader_collected_data/{reader_collected_data}".format( + reader_collected_data=sanitize_id(reader_collected_data), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 8ac8022a7..d92c5ea14 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -110,6 +110,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(TypedDict): + collect_config: NotRequired[ + "ReaderService.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID + """ + + class CollectPaymentMethodParamsCollectConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ + enable_customer_cancellation: NotRequired[bool] + """ + Enables cancel button on transaction screens. + """ + skip_tipping: NotRequired[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: NotRequired[ + "ReaderService.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(TypedDict): + amount_eligible: NotRequired[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + class ConfirmPaymentIntentParams(TypedDict): + confirm_config: NotRequired[ + "ReaderService.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + """ + class CreateParams(TypedDict): expand: NotRequired[List[str]] """ @@ -659,6 +725,94 @@ async def collect_inputs_async( ), ) + def collect_payment_method( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def collect_payment_method_async( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def confirm_payment_intent( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_payment_intent_async( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + def process_payment_intent( self, reader: str, diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 1fcab8016..07cb34b3e 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -159,12 +159,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ + gopay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataGopay" + ] + """ + If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method. + """ grabpay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ + id_bank_transfer: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataIdBankTransfer" + ] + """ + If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method. + """ ideal: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataIdeal" ] @@ -207,6 +219,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ + mb_way: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataMbWay" + ] + """ + If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method. + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -271,6 +289,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ + payto: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPayto" + ] + """ + If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. + """ pix: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPix" ] @@ -283,12 +307,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ + qris: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataQris" + ] + """ + If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method. + """ radar_options: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ + rechnung: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataRechnung" + ] + """ + If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method. + """ revolut_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataRevolutPay" ] @@ -313,12 +349,24 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + shopeepay: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataShopeepay" + ] + """ + If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. + """ sofort: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ + stripe_balance: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataStripeBalance" + ] + """ + This hash contains details about the Stripe balance payment method. + """ swish: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSwish" ] @@ -349,13 +397,16 @@ class CreateParamsPaymentMethodData(TypedDict): "eps", "fpx", "giropay", + "gopay", "grabpay", + "id_bank_transfer", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "link", + "mb_way", "mobilepay", "multibanco", "naver_pay", @@ -366,13 +417,18 @@ class CreateParamsPaymentMethodData(TypedDict): "payco", "paynow", "paypal", + "payto", "pix", "promptpay", + "qris", + "rechnung", "revolut_pay", "samsung_pay", "satispay", "sepa_debit", + "shopeepay", "sofort", + "stripe_balance", "swish", "twint", "us_bank_account", @@ -594,9 +650,18 @@ class CreateParamsPaymentMethodDataFpx(TypedDict): class CreateParamsPaymentMethodDataGiropay(TypedDict): pass + class CreateParamsPaymentMethodDataGopay(TypedDict): + pass + class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass + class CreateParamsPaymentMethodDataIdBankTransfer(TypedDict): + bank: NotRequired[Literal["bca", "bni", "bri", "cimb", "permata"]] + """ + Bank where the account is held. + """ + class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ @@ -659,6 +724,9 @@ class CreateParamsPaymentMethodDataKrCard(TypedDict): class CreateParamsPaymentMethodDataLink(TypedDict): pass + class CreateParamsPaymentMethodDataMbWay(TypedDict): + pass + class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass @@ -744,18 +812,57 @@ class CreateParamsPaymentMethodDataPaynow(TypedDict): class CreateParamsPaymentMethodDataPaypal(TypedDict): pass + class CreateParamsPaymentMethodDataPayto(TypedDict): + account_number: NotRequired[str] + """ + The account number for the bank account. + """ + bsb_number: NotRequired[str] + """ + Bank-State-Branch number of the bank account. + """ + pay_id: NotRequired[str] + """ + The PayID alias for the bank account. + """ + class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass + class CreateParamsPaymentMethodDataQris(TypedDict): + pass + class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class CreateParamsPaymentMethodDataRechnung(TypedDict): + dob: ( + "ConfirmationTokenService.CreateParamsPaymentMethodDataRechnungDob" + ) + """ + Customer's date of birth + """ + + class CreateParamsPaymentMethodDataRechnungDob(TypedDict): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass @@ -771,12 +878,25 @@ class CreateParamsPaymentMethodDataSepaDebit(TypedDict): IBAN of the bank account. """ + class CreateParamsPaymentMethodDataShopeepay(TypedDict): + pass + class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ + class CreateParamsPaymentMethodDataStripeBalance(TypedDict): + account: NotRequired[str] + """ + The connected account ID whose Stripe balance to use as the source of payment + """ + source_type: NotRequired[Literal["bank_account", "card", "fpx"]] + """ + The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance + """ + class CreateParamsPaymentMethodDataSwish(TypedDict): pass diff --git a/stripe/test_helpers/treasury/_received_credit_service.py b/stripe/test_helpers/treasury/_received_credit_service.py index 2a7033187..efe30a58d 100644 --- a/stripe/test_helpers/treasury/_received_credit_service.py +++ b/stripe/test_helpers/treasury/_received_credit_service.py @@ -39,6 +39,12 @@ class CreateParams(TypedDict): """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + network_details: NotRequired[ + "ReceivedCreditService.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the ReceivedCredit. + """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] @@ -66,6 +72,22 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): The bank account's routing number. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired["ReceivedCreditService.CreateParamsNetworkDetailsAch"] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedCredit. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + ACH Addenda record + """ + def create( self, params: "ReceivedCreditService.CreateParams", diff --git a/stripe/test_helpers/treasury/_received_debit_service.py b/stripe/test_helpers/treasury/_received_debit_service.py index 918b269e3..d06ed2dca 100644 --- a/stripe/test_helpers/treasury/_received_debit_service.py +++ b/stripe/test_helpers/treasury/_received_debit_service.py @@ -39,6 +39,12 @@ class CreateParams(TypedDict): """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + network_details: NotRequired[ + "ReceivedDebitService.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the ReceivedDebit. + """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] @@ -66,6 +72,22 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): The bank account's routing number. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired["ReceivedDebitService.CreateParamsNetworkDetailsAch"] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedDebit. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + Addenda record data associated with this ReceivedDebit. + """ + def create( self, params: "ReceivedDebitService.CreateParams", diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 8b002e6f7..8f931b299 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -139,6 +139,10 @@ class CloseParamsForwardingSettings(TypedDict): """ class CreateParams(RequestOptions): + display_name: NotRequired["Literal['']|str"] + """ + The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -231,6 +235,10 @@ class CreateParamsFeaturesFinancialAddresses(TypedDict): """ class CreateParamsFeaturesFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. @@ -359,6 +367,10 @@ class ListParamsCreated(TypedDict): """ class ModifyParams(RequestOptions): + display_name: NotRequired["Literal['']|str"] + """ + The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -453,6 +465,10 @@ class ModifyParamsFeaturesFinancialAddresses(TypedDict): """ class ModifyParamsFeaturesFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. @@ -635,6 +651,10 @@ class UpdateFeaturesParamsFinancialAddresses(TypedDict): """ class UpdateFeaturesParamsFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. @@ -744,6 +764,10 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + display_name: Optional[str] + """ + The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + """ features: Optional["FinancialAccountFeatures"] """ Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. diff --git a/stripe/treasury/_financial_account_features.py b/stripe/treasury/_financial_account_features.py index b787ad43c..bf811f8eb 100644 --- a/stripe/treasury/_financial_account_features.py +++ b/stripe/treasury/_financial_account_features.py @@ -139,6 +139,10 @@ class StatusDetail(StripeObject): The `platform_restrictions` that are restricting this Feature. """ + bank: Optional[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner for this Financial Account + """ requested: bool """ Whether the FinancialAccount should have the Feature. diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index 95ffff587..15df6ea8a 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -7,7 +7,7 @@ FinancialAccountFeatures, ) from typing import List, cast -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class FinancialAccountFeaturesService(StripeService): @@ -86,6 +86,10 @@ class UpdateParamsFinancialAddresses(TypedDict): """ class UpdateParamsFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 6cc6f577d..06d8fe63a 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -44,6 +44,10 @@ class CloseParamsForwardingSettings(TypedDict): """ class CreateParams(TypedDict): + display_name: NotRequired["Literal['']|str"] + """ + The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -136,6 +140,10 @@ class CreateParamsFeaturesFinancialAddresses(TypedDict): """ class CreateParamsFeaturesFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. @@ -270,6 +278,10 @@ class RetrieveParams(TypedDict): """ class UpdateParams(TypedDict): + display_name: NotRequired["Literal['']|str"] + """ + The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. @@ -364,6 +376,10 @@ class UpdateParamsFeaturesFinancialAddresses(TypedDict): """ class UpdateParamsFeaturesFinancialAddressesAba(TypedDict): + bank: NotRequired[Literal["evolve", "fifth_third", "goldman_sachs"]] + """ + Requested bank partner + """ requested: bool """ Whether the FinancialAccount should have the Feature. diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 3316d23fd..1c86bf528 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -135,6 +135,23 @@ class UsBankAccount(StripeObject): "us_bank_account": UsBankAccount, } + class NetworkDetails(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + ACH Addenda record + """ + + ach: Optional[Ach] + """ + Details about an ACH transaction. + """ + type: Literal["ach"] + """ + The type of flow that originated the OutboundTransfer. + """ + _inner_class_types = {"ach": Ach} + class ReturnedDetails(StripeObject): code: Literal[ "account_closed", @@ -250,6 +267,12 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + network_details: NotRequired[ + "OutboundTransfer.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the OutboundTransfer. + """ statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". @@ -279,6 +302,22 @@ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired["OutboundTransfer.CreateParamsNetworkDetailsAch"] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the OutboundTransfer. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + Addenda record data associated with this OutboundTransfer. + """ + class FailParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -451,6 +490,10 @@ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + network_details: Optional[NetworkDetails] + """ + Details about the network used for the OutboundTransfer. + """ object: Literal["treasury.outbound_transfer"] """ String representing the object's type. Objects of the same type share the same value. @@ -1164,6 +1207,7 @@ def test_helpers(self): _inner_class_types = { "destination_payment_method_details": DestinationPaymentMethodDetails, + "network_details": NetworkDetails, "returned_details": ReturnedDetails, "status_transitions": StatusTransitions, "tracking_details": TrackingDetails, diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 12f7d0498..9960c4a5f 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -57,6 +57,12 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + network_details: NotRequired[ + "OutboundTransferService.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the OutboundTransfer. + """ statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". @@ -86,6 +92,24 @@ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired[ + "OutboundTransferService.CreateParamsNetworkDetailsAch" + ] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the OutboundTransfer. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + Addenda record data associated with this OutboundTransfer. + """ + class ListParams(TypedDict): ending_before: NotRequired[str] """ diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 2ea338fbb..f4c87e7c0 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -193,6 +193,23 @@ class SourceFlowDetails(StripeObject): """ _inner_class_types = {"source_flow_details": SourceFlowDetails} + class NetworkDetails(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + ACH Addenda record + """ + + ach: Optional[Ach] + """ + Details about an ACH transaction. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedCredit. + """ + _inner_class_types = {"ach": Ach} + class ReversalDetails(StripeObject): deadline: Optional[int] """ @@ -242,6 +259,12 @@ class CreateParams(RequestOptions): """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + network_details: NotRequired[ + "ReceivedCredit.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the ReceivedCredit. + """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] @@ -269,6 +292,22 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): The bank account's routing number. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired["ReceivedCredit.CreateParamsNetworkDetailsAch"] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedCredit. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + ACH Addenda record + """ + class ListParams(RequestOptions): ending_before: NotRequired[str] """ @@ -366,6 +405,10 @@ class RetrieveParams(RequestOptions): """ The rails used to send the funds. """ + network_details: Optional[NetworkDetails] + """ + Details specific to the money movement rails. + """ object: Literal["treasury.received_credit"] """ String representing the object's type. Objects of the same type share the same value. @@ -487,6 +530,7 @@ def test_helpers(self): _inner_class_types = { "initiating_payment_method_details": InitiatingPaymentMethodDetails, "linked_flows": LinkedFlows, + "network_details": NetworkDetails, "reversal_details": ReversalDetails, } diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index 798915fab..6fbf73d67 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -140,6 +140,27 @@ class LinkedFlows(StripeObject): """ Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. """ + received_credit_capital_withholding: Optional[str] + """ + The ReceivedCredit that Capital withheld from + """ + + class NetworkDetails(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + ACH Addenda record + """ + + ach: Optional[Ach] + """ + Details about an ACH transaction. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedDebit. + """ + _inner_class_types = {"ach": Ach} class ReversalDetails(StripeObject): deadline: Optional[int] @@ -190,6 +211,12 @@ class CreateParams(RequestOptions): """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ + network_details: NotRequired[ + "ReceivedDebit.CreateParamsNetworkDetails" + ] + """ + Details about the network used for the ReceivedDebit. + """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] @@ -217,6 +244,22 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): The bank account's routing number. """ + class CreateParamsNetworkDetails(TypedDict): + ach: NotRequired["ReceivedDebit.CreateParamsNetworkDetailsAch"] + """ + Optional fields for `ach`. + """ + type: Literal["ach"] + """ + The type of flow that originated the ReceivedDebit. + """ + + class CreateParamsNetworkDetailsAch(TypedDict): + addenda: NotRequired[str] + """ + Addenda record data associated with this ReceivedDebit. + """ + class ListParams(RequestOptions): ending_before: NotRequired[str] """ @@ -299,6 +342,10 @@ class RetrieveParams(RequestOptions): """ The network used for the ReceivedDebit. """ + network_details: Optional[NetworkDetails] + """ + Details specific to the money movement rails. + """ object: Literal["treasury.received_debit"] """ String representing the object's type. Objects of the same type share the same value. @@ -420,6 +467,7 @@ def test_helpers(self): _inner_class_types = { "initiating_payment_method_details": InitiatingPaymentMethodDetails, "linked_flows": LinkedFlows, + "network_details": NetworkDetails, "reversal_details": ReversalDetails, } diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 73418d2cf..018092e9c 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -3,9 +3,28 @@ # The beginning of the section generated from our OpenAPI spec -from stripe.v2 import billing as billing, core as core +from stripe.v2 import ( + billing as billing, + core as core, + money_management as money_management, + payments as payments, + test_helpers as test_helpers, +) from stripe.v2._billing_service import BillingService as BillingService from stripe.v2._core_service import CoreService as CoreService from stripe.v2._event import Event as Event from stripe.v2._event_destination import EventDestination as EventDestination +from stripe.v2._financial_address_credit_simulation import ( + FinancialAddressCreditSimulation as FinancialAddressCreditSimulation, +) +from stripe.v2._financial_address_generated_microdeposits import ( + FinancialAddressGeneratedMicrodeposits as FinancialAddressGeneratedMicrodeposits, +) +from stripe.v2._money_management_service import ( + MoneyManagementService as MoneyManagementService, +) +from stripe.v2._payment_service import PaymentService as PaymentService +from stripe.v2._test_helper_service import ( + TestHelperService as TestHelperService, +) # The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py index f8e6b1dad..cf234c48f 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -1,12 +1,18 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService +from stripe.v2.core._account_link_service import AccountLinkService +from stripe.v2.core._account_service import AccountService from stripe.v2.core._event_destination_service import EventDestinationService from stripe.v2.core._event_service import EventService +from stripe.v2.core._vault_service import VaultService class CoreService(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.accounts = AccountService(self._requestor) + self.account_links = AccountLinkService(self._requestor) self.event_destinations = EventDestinationService(self._requestor) self.events = EventService(self._requestor) + self.vault = VaultService(self._requestor) diff --git a/stripe/v2/_financial_address_credit_simulation.py b/stripe/v2/_financial_address_credit_simulation.py new file mode 100644 index 000000000..65ea5c674 --- /dev/null +++ b/stripe/v2/_financial_address_credit_simulation.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class FinancialAddressCreditSimulation(StripeObject): + OBJECT_NAME: ClassVar[Literal["financial_address_credit_simulation"]] = ( + "financial_address_credit_simulation" + ) + object: Literal["financial_address_credit_simulation"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: str + """ + The status of the request, signifying whether a simulated credit was initiated. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ diff --git a/stripe/v2/_financial_address_generated_microdeposits.py b/stripe/v2/_financial_address_generated_microdeposits.py new file mode 100644 index 000000000..6780c4495 --- /dev/null +++ b/stripe/v2/_financial_address_generated_microdeposits.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, List +from typing_extensions import Literal + + +class FinancialAddressGeneratedMicrodeposits(StripeObject): + OBJECT_NAME: ClassVar[ + Literal["financial_address_generated_microdeposits"] + ] = "financial_address_generated_microdeposits" + amounts: List[Amount] + """ + The amounts of the microdeposits that were generated. + """ + object: Literal["financial_address_generated_microdeposits"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["accepted"] + """ + Closed Enum. The status of the request. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ diff --git a/stripe/v2/_money_management_service.py b/stripe/v2/_money_management_service.py new file mode 100644 index 000000000..dab5aa203 --- /dev/null +++ b/stripe/v2/_money_management_service.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.money_management._adjustment_service import AdjustmentService +from stripe.v2.money_management._financial_account_service import ( + FinancialAccountService, +) +from stripe.v2.money_management._financial_address_service import ( + FinancialAddressService, +) +from stripe.v2.money_management._inbound_transfer_service import ( + InboundTransferService, +) +from stripe.v2.money_management._outbound_payment_quote_service import ( + OutboundPaymentQuoteService, +) +from stripe.v2.money_management._outbound_payment_service import ( + OutboundPaymentService, +) +from stripe.v2.money_management._outbound_setup_intent_service import ( + OutboundSetupIntentService, +) +from stripe.v2.money_management._outbound_transfer_service import ( + OutboundTransferService, +) +from stripe.v2.money_management._payout_method_service import ( + PayoutMethodService, +) +from stripe.v2.money_management._payout_methods_bank_account_spec_service import ( + PayoutMethodsBankAccountSpecService, +) +from stripe.v2.money_management._received_credit_service import ( + ReceivedCreditService, +) +from stripe.v2.money_management._received_debit_service import ( + ReceivedDebitService, +) +from stripe.v2.money_management._transaction_entry_service import ( + TransactionEntryService, +) +from stripe.v2.money_management._transaction_service import TransactionService + + +class MoneyManagementService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.adjustments = AdjustmentService(self._requestor) + self.financial_accounts = FinancialAccountService(self._requestor) + self.financial_addresses = FinancialAddressService(self._requestor) + self.inbound_transfers = InboundTransferService(self._requestor) + self.outbound_payments = OutboundPaymentService(self._requestor) + self.outbound_payment_quotes = OutboundPaymentQuoteService( + self._requestor, + ) + self.outbound_transfers = OutboundTransferService(self._requestor) + self.outbound_setup_intents = OutboundSetupIntentService( + self._requestor, + ) + self.payout_methods = PayoutMethodService(self._requestor) + self.payout_methods_bank_account_spec = ( + PayoutMethodsBankAccountSpecService( + self._requestor, + ) + ) + self.received_credits = ReceivedCreditService(self._requestor) + self.received_debits = ReceivedDebitService(self._requestor) + self.transactions = TransactionService(self._requestor) + self.transaction_entries = TransactionEntryService(self._requestor) diff --git a/stripe/v2/_payment_service.py b/stripe/v2/_payment_service.py new file mode 100644 index 000000000..67581fe18 --- /dev/null +++ b/stripe/v2/_payment_service.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.payments._off_session_payment_service import ( + OffSessionPaymentService, +) + + +class PaymentService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.off_session_payments = OffSessionPaymentService(self._requestor) diff --git a/stripe/v2/_test_helper_service.py b/stripe/v2/_test_helper_service.py new file mode 100644 index 000000000..ef6fe295b --- /dev/null +++ b/stripe/v2/_test_helper_service.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.test_helpers._financial_address_service import ( + FinancialAddressService, +) + + +class TestHelperService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.financial_addresses = FinancialAddressService(self._requestor) diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index 14173e719..2c0d0d912 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -1,6 +1,15 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2.core import accounts as accounts, vault as vault +from stripe.v2.core._account import Account as Account +from stripe.v2.core._account_link import AccountLink as AccountLink +from stripe.v2.core._account_link_service import ( + AccountLinkService as AccountLinkService, +) +from stripe.v2.core._account_service import AccountService as AccountService from stripe.v2.core._event_destination_service import ( EventDestinationService as EventDestinationService, ) from stripe.v2.core._event_service import EventService as EventService +from stripe.v2.core._person import Person as Person +from stripe.v2.core._vault_service import VaultService as VaultService diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py new file mode 100644 index 000000000..874012c7a --- /dev/null +++ b/stripe/v2/core/_account.py @@ -0,0 +1,7322 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class Account(StripeObject): + """ + A V2 Account is a representation of a company or individual that a Stripe user does business with. Accounts contain the contact details, Legal Entity information, and configuration required to enable the Account for use across Stripe products. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.account"]] = "v2.core.account" + + class Configuration(StripeObject): + class Customer(StripeObject): + class AutomaticIndirectTax(StripeObject): + class Location(StripeObject): + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + The identified tax country of the customer. + """ + state: Optional[str] + """ + The identified tax state, county, province, or region of the customer. + """ + + exempt: Optional[Literal["exempt", "none", "reverse"]] + """ + Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + """ + ip_address: Optional[str] + """ + A recent IP address of the customer used for tax reporting and tax location inference. + """ + location: Optional[Location] + """ + The customer's identified tax location - uses `location_source`. Will only be rendered if the `automatic_indirect_tax` feature is requested and `active`. + """ + location_source: Optional[ + Literal[ + "identity_address", "ip_address", "shipping_address" + ] + ] + """ + The data source used to identify the customer's tax location - defaults to 'identity_address'. Will only be used for automatic tax calculation on the customer's Invoices and Subscriptions. + """ + _inner_class_types = {"location": Location} + + class Billing(StripeObject): + class Invoice(StripeObject): + class CustomField(StripeObject): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. When updating, pass an empty string to remove previously-defined values. + """ + + class Rendering(StripeObject): + amount_tax_display: Optional[ + Literal["exclude_tax", "include_inclusive_tax"] + ] + """ + How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of exclude_tax or include_inclusive_tax. include_inclusive_tax will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. exclude_tax will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + """ + template: Optional[str] + """ + ID of the invoice rendering template to use for future invoices. + """ + + custom_fields: List[CustomField] + """ + The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. + """ + footer: Optional[str] + """ + Default footer to be displayed on invoices for this customer. + """ + next_sequence: Optional[int] + """ + The sequence to be used on the customer's next invoice. Defaults to 1. + """ + prefix: Optional[str] + """ + The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + """ + rendering: Optional[Rendering] + """ + Default options for invoice PDF rendering for this customer. + """ + _inner_class_types = { + "custom_fields": CustomField, + "rendering": Rendering, + } + + default_payment_method: Optional[str] + """ + ID of a payment method that's attached to the customer, to be used as the customer's default payment method for invoices and subscriptions. + """ + invoice: Optional[Invoice] + """ + Default settings used on invoices for this customer. + """ + _inner_class_types = {"invoice": Invoice} + + class Capabilities(StripeObject): + class AutomaticIndirectTax(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + automatic_indirect_tax: Optional[AutomaticIndirectTax] + """ + Generates requirements for enabling automatic indirect tax calculation on this customer's invoices or subscriptions. Recommended to request this capability if planning to enable automatic tax calculation on this customer's invoices or subscriptions. Uses the `location_source` field. + """ + _inner_class_types = { + "automatic_indirect_tax": AutomaticIndirectTax, + } + + class Shipping(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + address: Optional[Address] + """ + Customer shipping address. + """ + name: Optional[str] + """ + Customer name. + """ + phone: Optional[str] + """ + Customer phone (including extension). + """ + _inner_class_types = {"address": Address} + + automatic_indirect_tax: Optional[AutomaticIndirectTax] + """ + Automatic indirect tax settings to be used when automatic tax calculation is enabled on the customer's invoices, subscriptions, checkout sessions, or payment links. Surfaces if automatic tax calculation is possible given the current customer location information. + """ + billing: Optional[Billing] + """ + Billing settings - default settings used for this customer in Billing flows such as Invoices and Subscriptions. + """ + capabilities: Optional[Capabilities] + """ + Capabilities that have been requested on the Customer Configuration. + """ + shipping: Optional[Shipping] + """ + The customer's shipping information. Appears on invoices emailed to this customer. + """ + test_clock: Optional[str] + """ + ID of the test clock to attach to the customer. Can only be set on testmode Accounts, and when the Customer Configuration is first set on an Account. + """ + _inner_class_types = { + "automatic_indirect_tax": AutomaticIndirectTax, + "billing": Billing, + "capabilities": Capabilities, + "shipping": Shipping, + } + + class Merchant(StripeObject): + class BacsDebitPayments(StripeObject): + display_name: Optional[str] + """ + Display name for Bacs debit payments. + """ + service_user_number: Optional[str] + """ + Service user number for Bacs debit payments. + """ + + class Branding(StripeObject): + icon: Optional[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): An icon for the merchant. Must be square and at least 128px x 128px. + """ + logo: Optional[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): A logo for the merchant that will be used in Checkout instead of the icon and without the merchant's name next to it if provided. Must be at least 128px x 128px. + """ + primary_color: Optional[str] + """ + A CSS hex color value representing the primary branding color for the merchant. + """ + secondary_color: Optional[str] + """ + A CSS hex color value representing the secondary branding color for the merchant. + """ + + class Capabilities(StripeObject): + class AchDebitPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AcssDebitPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AffirmPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AfterpayClearpayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AlmaPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AmazonPayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class AuBecsDebitPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class BacsDebitPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class BancontactPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class BlikPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class BoletoPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class CardPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class CartesBancairesPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class CashappPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class EpsPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class FpxPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class GbBankTransferPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class GrabpayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class IdealPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class JcbPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class JpBankTransferPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class KakaoPayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class KlarnaPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class KonbiniPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class KrCardPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class LinkPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class MobilepayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class MultibancoPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class MxBankTransferPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class NaverPayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class OxxoPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class P24Payments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class PayByBankPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class PaycoPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class PaynowPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class PromptpayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class RevolutPayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class SamsungPayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class SepaBankTransferPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class SepaDebitPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class StripeBalance(StripeObject): + class Payouts(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + payouts: Optional[Payouts] + """ + Allows the account to do payouts using their Stripe Balance (/v1/balance). + """ + _inner_class_types = {"payouts": Payouts} + + class SwishPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class TwintPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class UsBankTransferPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class ZipPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + ach_debit_payments: Optional[AchDebitPayments] + """ + Allow the merchant to process ACH debit payments. + """ + acss_debit_payments: Optional[AcssDebitPayments] + """ + Allow the merchant to process ACSS debit payments. + """ + affirm_payments: Optional[AffirmPayments] + """ + Allow the merchant to process Affirm payments. + """ + afterpay_clearpay_payments: Optional[AfterpayClearpayPayments] + """ + Allow the merchant to process Afterpay/Clearpay payments. + """ + alma_payments: Optional[AlmaPayments] + """ + Allow the merchant to process Alma payments. + """ + amazon_pay_payments: Optional[AmazonPayPayments] + """ + Allow the merchant to process Amazon Pay payments. + """ + au_becs_debit_payments: Optional[AuBecsDebitPayments] + """ + Allow the merchant to process Australian BECS Direct Debit payments. + """ + bacs_debit_payments: Optional[BacsDebitPayments] + """ + Allow the merchant to process BACS Direct Debit payments. + """ + bancontact_payments: Optional[BancontactPayments] + """ + Allow the merchant to process Bancontact payments. + """ + blik_payments: Optional[BlikPayments] + """ + Allow the merchant to process BLIK payments. + """ + boleto_payments: Optional[BoletoPayments] + """ + Allow the merchant to process Boleto payments. + """ + card_payments: Optional[CardPayments] + """ + Allow the merchant to collect card payments. + """ + cartes_bancaires_payments: Optional[CartesBancairesPayments] + """ + Allow the merchant to process Cartes Bancaires payments. + """ + cashapp_payments: Optional[CashappPayments] + """ + Allow the merchant to process Cash App payments. + """ + eps_payments: Optional[EpsPayments] + """ + Allow the merchant to process EPS payments. + """ + fpx_payments: Optional[FpxPayments] + """ + Allow the merchant to process FPX payments. + """ + gb_bank_transfer_payments: Optional[GbBankTransferPayments] + """ + Allow the merchant to process UK bank transfer payments. + """ + grabpay_payments: Optional[GrabpayPayments] + """ + Allow the merchant to process GrabPay payments. + """ + ideal_payments: Optional[IdealPayments] + """ + Allow the merchant to process iDEAL payments. + """ + jcb_payments: Optional[JcbPayments] + """ + Allow the merchant to process JCB card payments. + """ + jp_bank_transfer_payments: Optional[JpBankTransferPayments] + """ + Allow the merchant to process Japanese bank transfer payments. + """ + kakao_pay_payments: Optional[KakaoPayPayments] + """ + Allow the merchant to process Kakao Pay payments. + """ + klarna_payments: Optional[KlarnaPayments] + """ + Allow the merchant to process Klarna payments. + """ + konbini_payments: Optional[KonbiniPayments] + """ + Allow the merchant to process Konbini convenience store payments. + """ + kr_card_payments: Optional[KrCardPayments] + """ + Allow the merchant to process Korean card payments. + """ + link_payments: Optional[LinkPayments] + """ + Allow the merchant to process Link payments. + """ + mobilepay_payments: Optional[MobilepayPayments] + """ + Allow the merchant to process MobilePay payments. + """ + multibanco_payments: Optional[MultibancoPayments] + """ + Allow the merchant to process Multibanco payments. + """ + mx_bank_transfer_payments: Optional[MxBankTransferPayments] + """ + Allow the merchant to process Mexican bank transfer payments. + """ + naver_pay_payments: Optional[NaverPayPayments] + """ + Allow the merchant to process Naver Pay payments. + """ + oxxo_payments: Optional[OxxoPayments] + """ + Allow the merchant to process OXXO payments. + """ + p24_payments: Optional[P24Payments] + """ + Allow the merchant to process Przelewy24 (P24) payments. + """ + pay_by_bank_payments: Optional[PayByBankPayments] + """ + Allow the merchant to process Pay by Bank payments. + """ + payco_payments: Optional[PaycoPayments] + """ + Allow the merchant to process PAYCO payments. + """ + paynow_payments: Optional[PaynowPayments] + """ + Allow the merchant to process PayNow payments. + """ + promptpay_payments: Optional[PromptpayPayments] + """ + Allow the merchant to process PromptPay payments. + """ + revolut_pay_payments: Optional[RevolutPayPayments] + """ + Allow the merchant to process Revolut Pay payments. + """ + samsung_pay_payments: Optional[SamsungPayPayments] + """ + Allow the merchant to process Samsung Pay payments. + """ + sepa_bank_transfer_payments: Optional[SepaBankTransferPayments] + """ + Allow the merchant to process SEPA bank transfer payments. + """ + sepa_debit_payments: Optional[SepaDebitPayments] + """ + Allow the merchant to process SEPA Direct Debit payments. + """ + stripe_balance: Optional[StripeBalance] + """ + Capabilities that enable the merchant to manage their Stripe Balance (/v1/balance). + """ + swish_payments: Optional[SwishPayments] + """ + Allow the merchant to process Swish payments. + """ + twint_payments: Optional[TwintPayments] + """ + Allow the merchant to process TWINT payments. + """ + us_bank_transfer_payments: Optional[UsBankTransferPayments] + """ + Allow the merchant to process US bank transfer payments. + """ + zip_payments: Optional[ZipPayments] + """ + Allow the merchant to process Zip payments. + """ + _inner_class_types = { + "ach_debit_payments": AchDebitPayments, + "acss_debit_payments": AcssDebitPayments, + "affirm_payments": AffirmPayments, + "afterpay_clearpay_payments": AfterpayClearpayPayments, + "alma_payments": AlmaPayments, + "amazon_pay_payments": AmazonPayPayments, + "au_becs_debit_payments": AuBecsDebitPayments, + "bacs_debit_payments": BacsDebitPayments, + "bancontact_payments": BancontactPayments, + "blik_payments": BlikPayments, + "boleto_payments": BoletoPayments, + "card_payments": CardPayments, + "cartes_bancaires_payments": CartesBancairesPayments, + "cashapp_payments": CashappPayments, + "eps_payments": EpsPayments, + "fpx_payments": FpxPayments, + "gb_bank_transfer_payments": GbBankTransferPayments, + "grabpay_payments": GrabpayPayments, + "ideal_payments": IdealPayments, + "jcb_payments": JcbPayments, + "jp_bank_transfer_payments": JpBankTransferPayments, + "kakao_pay_payments": KakaoPayPayments, + "klarna_payments": KlarnaPayments, + "konbini_payments": KonbiniPayments, + "kr_card_payments": KrCardPayments, + "link_payments": LinkPayments, + "mobilepay_payments": MobilepayPayments, + "multibanco_payments": MultibancoPayments, + "mx_bank_transfer_payments": MxBankTransferPayments, + "naver_pay_payments": NaverPayPayments, + "oxxo_payments": OxxoPayments, + "p24_payments": P24Payments, + "pay_by_bank_payments": PayByBankPayments, + "payco_payments": PaycoPayments, + "paynow_payments": PaynowPayments, + "promptpay_payments": PromptpayPayments, + "revolut_pay_payments": RevolutPayPayments, + "samsung_pay_payments": SamsungPayPayments, + "sepa_bank_transfer_payments": SepaBankTransferPayments, + "sepa_debit_payments": SepaDebitPayments, + "stripe_balance": StripeBalance, + "swish_payments": SwishPayments, + "twint_payments": TwintPayments, + "us_bank_transfer_payments": UsBankTransferPayments, + "zip_payments": ZipPayments, + } + + class CardPayments(StripeObject): + class DeclineOn(StripeObject): + avs_failure: Optional[bool] + """ + Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + """ + cvc_failure: Optional[bool] + """ + Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + """ + + decline_on: Optional[DeclineOn] + """ + Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + """ + _inner_class_types = {"decline_on": DeclineOn} + + class SepaDebitPayments(StripeObject): + creditor_id: Optional[str] + """ + Creditor ID for SEPA debit payments. + """ + + class StatementDescriptor(StripeObject): + descriptor: Optional[str] + """ + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a statement_descriptor_prefix, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the statement_descriptor text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + prefix: Optional[str] + """ + Default text that appears on statements for card charges outside of Japan, prefixing any dynamic statement_descriptor_suffix specified on the charge. To maximize space for the dynamic part of the descriptor, keep this text short. If you don't specify this value, statement_descriptor is used as the prefix. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + + class Support(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + address: Optional[Address] + """ + A publicly available mailing address for sending support issues to. + """ + email: Optional[str] + """ + A publicly available email address for sending support issues to. + """ + phone: Optional[str] + """ + A publicly available phone number to call with support issues. + """ + url: Optional[str] + """ + A publicly available website for handling support issues. + """ + _inner_class_types = {"address": Address} + + bacs_debit_payments: Optional[BacsDebitPayments] + """ + Settings used for Bacs debit payments. + """ + branding: Optional[Branding] + """ + Settings used to apply the merchant's branding to email receipts, invoices, Checkout, and other products. + """ + capabilities: Optional[Capabilities] + """ + Capabilities that have been requested on the Merchant Configuration. + """ + card_payments: Optional[CardPayments] + """ + Card payments settings. + """ + mcc: Optional[str] + """ + The merchant category code for the merchant. MCCs are used to classify businesses based on the goods or services they provide. + """ + sepa_debit_payments: Optional[SepaDebitPayments] + """ + Settings used for SEPA debit payments. + """ + statement_descriptor: Optional[StatementDescriptor] + """ + Statement descriptor. + """ + support: Optional[Support] + """ + Publicly available contact information for sending support issues to. + """ + _inner_class_types = { + "bacs_debit_payments": BacsDebitPayments, + "branding": Branding, + "capabilities": Capabilities, + "card_payments": CardPayments, + "sepa_debit_payments": SepaDebitPayments, + "statement_descriptor": StatementDescriptor, + "support": Support, + } + + class Recipient(StripeObject): + class Capabilities(StripeObject): + class BankAccounts(StripeObject): + class Local(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class Wire(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + local: Optional[Local] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over local networks. + """ + wire: Optional[Wire] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over wire. + """ + _inner_class_types = {"local": Local, "wire": Wire} + + class Cards(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class StripeBalance(StripeObject): + class Payouts(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class StripeTransfers(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", + "no_resolution", + "provide_info", + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + requested: bool + """ + Whether the Capability has been requested. + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details regarding the status of the Capability. `status_details` will be empty if the Capability's status is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + payouts: Optional[Payouts] + """ + Allows the account to do payouts using their Stripe Balance (/v1/balance). + """ + stripe_transfers: Optional[StripeTransfers] + """ + Allows the account to receive /v1/transfers into their Stripe Balance (/v1/balance). + """ + _inner_class_types = { + "payouts": Payouts, + "stripe_transfers": StripeTransfers, + } + + bank_accounts: Optional[BankAccounts] + """ + Capabilities that enable OutboundPayments to a bank account linked to this Account. + """ + cards: Optional[Cards] + """ + Capability that enable OutboundPayments to a debit card linked to this Account. + """ + stripe_balance: Optional[StripeBalance] + """ + Capabilities that enable the recipient to manage their Stripe Balance (/v1/balance). + """ + _inner_class_types = { + "bank_accounts": BankAccounts, + "cards": Cards, + "stripe_balance": StripeBalance, + } + + class DefaultOutboundDestination(StripeObject): + id: str + """ + The payout method ID of the default outbound destination. + """ + type: Literal[ + "at_bank_account", + "au_bank_account", + "ba_bank_account", + "be_bank_account", + "bg_bank_account", + "bj_bank_account", + "bs_bank_account", + "card", + "ca_bank_account", + "ch_bank_account", + "ci_bank_account", + "cy_bank_account", + "cz_bank_account", + "de_bank_account", + "dk_bank_account", + "ec_bank_account", + "ee_bank_account", + "es_bank_account", + "et_bank_account", + "fi_bank_account", + "fr_bank_account", + "gb_bank_account", + "gr_bank_account", + "hr_bank_account", + "hu_bank_account", + "id_bank_account", + "ie_bank_account", + "il_bank_account", + "in_bank_account", + "is_bank_account", + "it_bank_account", + "ke_bank_account", + "li_bank_account", + "lt_bank_account", + "lu_bank_account", + "lv_bank_account", + "mn_bank_account", + "mt_bank_account", + "mu_bank_account", + "mx_bank_account", + "na_bank_account", + "nl_bank_account", + "no_bank_account", + "nz_bank_account", + "pa_bank_account", + "ph_bank_account", + "pl_bank_account", + "pt_bank_account", + "ro_bank_account", + "rs_bank_account", + "se_bank_account", + "sg_bank_account", + "si_bank_account", + "sk_bank_account", + "sn_bank_account", + "sv_bank_account", + "tn_bank_account", + "tr_bank_account", + "us_bank_account", + "za_bank_account", + ] + """ + Closed Enum. The payout method type of the default outbound destination. + """ + + capabilities: Optional[Capabilities] + """ + Capabilities that have been requested on the Recipient Configuration. + """ + default_outbound_destination: Optional[DefaultOutboundDestination] + """ + The payout method to be used as a default outbound destination. This will allow the PayoutMethod to be omitted on OutboundPayments made through the dashboard. + """ + _inner_class_types = { + "capabilities": Capabilities, + "default_outbound_destination": DefaultOutboundDestination, + } + + customer: Optional[Customer] + """ + The Customer Configuration allows the Account to be used in inbound payment flows. + """ + merchant: Optional[Merchant] + """ + The Merchant configuration allows the Account to act as a connected account and collect payments facilitated by a Connect platform. You can add this configuration to your connected accounts only if you've completed onboarding as a Connect platform. + """ + recipient: Optional[Recipient] + """ + The Recipient Configuration allows the Account to receive funds. + """ + _inner_class_types = { + "customer": Customer, + "merchant": Merchant, + "recipient": Recipient, + } + + class Defaults(StripeObject): + class Responsibilities(StripeObject): + fees_collector: Literal["application", "stripe"] + """ + A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this Account. + """ + losses_collector: Literal["application", "stripe"] + """ + A value indicating who is responsible for losses when this Account can't pay back negative balances from payments. + """ + + currency: Optional[ + Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + ] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + locales: Optional[ + List[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ] + ] + ] + """ + The Account's preferred locales (languages), ordered by preference. + """ + responsibilities: Optional[Responsibilities] + """ + Default responsibilities held by either Stripe or the platform. + """ + _inner_class_types = {"responsibilities": Responsibilities} + + class Identity(StripeObject): + class Attestations(StripeObject): + class DirectorshipDeclaration(StripeObject): + date: Optional[str] + """ + The time marking when the director attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the director attestation was made. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the director attestation was made. + """ + + class OwnershipDeclaration(StripeObject): + date: Optional[str] + """ + The time marking when the beneficial owner attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the beneficial owner attestation was made. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the beneficial owner attestation was made. + """ + + class PersonsProvided(StripeObject): + directors: Optional[bool] + """ + Whether the company's directors have been provided. Set this Boolean to true after creating all the company's directors with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + executives: Optional[bool] + """ + Whether the company's executives have been provided. Set this Boolean to true after creating all the company's executives with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + owners: Optional[bool] + """ + Whether the company's owners have been provided. Set this Boolean to true after creating all the company's owners with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + ownership_exemption_reason: Optional[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ] + ] + """ + Reason for why the company is exempt from providing ownership information. + """ + + class TermsOfService(StripeObject): + class Account(StripeObject): + date: Optional[str] + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + account: Optional[Account] + """ + Details on the Account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance). + """ + _inner_class_types = {"account": Account} + + directorship_declaration: Optional[DirectorshipDeclaration] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ + ownership_declaration: Optional[OwnershipDeclaration] + """ + This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + """ + persons_provided: Optional[PersonsProvided] + """ + Attestation that all Persons with a specific Relationship value have been provided. + """ + terms_of_service: Optional[TermsOfService] + """ + Attestations of accepted terms of service agreements. + """ + _inner_class_types = { + "directorship_declaration": DirectorshipDeclaration, + "ownership_declaration": OwnershipDeclaration, + "persons_provided": PersonsProvided, + "terms_of_service": TermsOfService, + } + + class BusinessDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class AnnualRevenue(StripeObject): + amount: Optional[Amount] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + fiscal_year_end: Optional[str] + """ + The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + """ + + class Documents(StripeObject): + class BankAccountOwnershipVerification(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CompanyLicense(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CompanyMemorandumOfAssociation(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CompanyMinisterialDecree(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CompanyRegistrationVerification(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CompanyTaxIdVerification(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class PrimaryVerification(StripeObject): + class FrontBack(StripeObject): + back: Optional[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + front_back: FrontBack + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + _inner_class_types = {"front_back": FrontBack} + + class ProofOfRegistration(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class ProofOfUltimateBeneficialOwnership(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + bank_account_ownership_verification: Optional[ + BankAccountOwnershipVerification + ] + """ + One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + """ + company_license: Optional[CompanyLicense] + """ + One or more documents that demonstrate proof of a company's license to operate. + """ + company_memorandum_of_association: Optional[ + CompanyMemorandumOfAssociation + ] + """ + One or more documents showing the company's Memorandum of Association. + """ + company_ministerial_decree: Optional[CompanyMinisterialDecree] + """ + Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. + """ + company_registration_verification: Optional[ + CompanyRegistrationVerification + ] + """ + One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + """ + company_tax_id_verification: Optional[CompanyTaxIdVerification] + """ + One or more documents that demonstrate proof of a company's tax ID. + """ + primary_verification: Optional[PrimaryVerification] + """ + A document verifying the business. + """ + proof_of_registration: Optional[ProofOfRegistration] + """ + One or more documents showing the company's proof of registration with the national business registry. + """ + proof_of_ultimate_beneficial_ownership: Optional[ + ProofOfUltimateBeneficialOwnership + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ + _inner_class_types = { + "bank_account_ownership_verification": BankAccountOwnershipVerification, + "company_license": CompanyLicense, + "company_memorandum_of_association": CompanyMemorandumOfAssociation, + "company_ministerial_decree": CompanyMinisterialDecree, + "company_registration_verification": CompanyRegistrationVerification, + "company_tax_id_verification": CompanyTaxIdVerification, + "primary_verification": PrimaryVerification, + "proof_of_registration": ProofOfRegistration, + "proof_of_ultimate_beneficial_ownership": ProofOfUltimateBeneficialOwnership, + } + + class IdNumber(StripeObject): + registrar: Optional[str] + """ + The registrar of the ID number (Only valid for DE ID number types). + """ + type: Literal[ + "ae_crn", + "ae_vat", + "at_fn", + "au_abn", + "au_acn", + "au_in", + "be_cbe", + "bg_uic", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cy_tic", + "cz_ico", + "de_hrn", + "de_vat", + "dk_cvr", + "ee_rk", + "es_cif", + "fi_yt", + "fr_siren", + "fr_vat", + "gb_crn", + "gi_crn", + "gr_gemi", + "hk_br", + "hk_cr", + "hk_mbs", + "hu_cjs", + "ie_crn", + "it_rea", + "it_vat", + "jp_cn", + "li_uid", + "lt_ccrn", + "lu_rcs", + "lv_urn", + "mt_crn", + "mx_rfc", + "my_brn", + "my_coid", + "my_sst", + "nl_kvk", + "no_orgnr", + "nz_bn", + "pl_regon", + "pt_vat", + "ro_cui", + "se_orgnr", + "sg_uen", + "si_msp", + "sk_ico", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ] + """ + Open Enum. The ID number type of a business entity. + """ + + class MonthlyEstimatedRevenue(StripeObject): + amount: Optional[Amount] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + + class ScriptAddresses(StripeObject): + class Kana(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class Kanji(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + kana: Optional[Kana] + """ + Kana Address. + """ + kanji: Optional[Kanji] + """ + Kanji Address. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + class ScriptNames(StripeObject): + class Kana(StripeObject): + registered_name: Optional[str] + """ + Registered name of the business. + """ + + class Kanji(StripeObject): + registered_name: Optional[str] + """ + Registered name of the business. + """ + + kana: Optional[Kana] + """ + Kana name. + """ + kanji: Optional[Kanji] + """ + Kanji name. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + address: Optional[Address] + """ + The company's primary address. + """ + annual_revenue: Optional[AnnualRevenue] + """ + The business gross annual revenue for its preceding fiscal year. + """ + documents: Optional[Documents] + """ + Documents that may be submitted to satisfy various informational requests. + """ + doing_business_as: Optional[str] + """ + The company's legal name. + """ + estimated_worker_count: Optional[int] + """ + An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + """ + id_numbers: Optional[List[IdNumber]] + """ + The provided ID numbers of a business entity. + """ + monthly_estimated_revenue: Optional[MonthlyEstimatedRevenue] + """ + An estimate of the monthly revenue of the business. + """ + phone: Optional[str] + """ + The company's phone number (used for verification). + """ + product_description: Optional[str] + """ + Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + """ + registered_name: Optional[str] + """ + The business legal name. + """ + script_addresses: Optional[ScriptAddresses] + """ + The business registration address of the business entity in non latin script. + """ + script_names: Optional[ScriptNames] + """ + The business legal name in non latin script. + """ + structure: Optional[ + Literal[ + "cooperative", + "free_zone_establishment", + "free_zone_llc", + "governmental_unit", + "government_instrumentality", + "incorporated_association", + "incorporated_non_profit", + "incorporated_partnership", + "limited_liability_partnership", + "llc", + "multi_member_llc", + "private_company", + "private_corporation", + "private_partnership", + "public_company", + "public_corporation", + "public_listed_corporation", + "public_partnership", + "registered_charity", + "single_member_llc", + "sole_establishment", + "sole_proprietorship", + "tax_exempt_government_instrumentality", + "trust", + "unincorporated_association", + "unincorporated_non_profit", + "unincorporated_partnership", + ] + ] + """ + The category identifying the legal structure of the business. + """ + url: Optional[str] + """ + The business's publicly available website. + """ + _inner_class_types = { + "address": Address, + "annual_revenue": AnnualRevenue, + "documents": Documents, + "id_numbers": IdNumber, + "monthly_estimated_revenue": MonthlyEstimatedRevenue, + "script_addresses": ScriptAddresses, + "script_names": ScriptNames, + } + + class Individual(StripeObject): + class AdditionalAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class AdditionalName(StripeObject): + full_name: Optional[str] + """ + The individual's full name. + """ + given_name: Optional[str] + """ + The individual's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: Optional[str] + """ + The individual's last or family name. + """ + + class AdditionalTermsOfService(StripeObject): + class Account(StripeObject): + date: Optional[str] + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + account: Optional[Account] + """ + Stripe terms of service agreement. + """ + _inner_class_types = {"account": Account} + + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class DateOfBirth(StripeObject): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class Documents(StripeObject): + class CompanyAuthorization(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class Passport(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class PrimaryVerification(StripeObject): + class FrontBack(StripeObject): + back: Optional[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + front_back: FrontBack + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + _inner_class_types = {"front_back": FrontBack} + + class SecondaryVerification(StripeObject): + class FrontBack(StripeObject): + back: Optional[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + front_back: FrontBack + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + _inner_class_types = {"front_back": FrontBack} + + class Visa(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + company_authorization: Optional[CompanyAuthorization] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: Optional[Passport] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: Optional[PrimaryVerification] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: Optional[SecondaryVerification] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: Optional[Visa] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + _inner_class_types = { + "company_authorization": CompanyAuthorization, + "passport": Passport, + "primary_verification": PrimaryVerification, + "secondary_verification": SecondaryVerification, + "visa": Visa, + } + + class IdNumber(StripeObject): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + + class Relationship(StripeObject): + authorizer: Optional[bool] + """ + Whether the individual is an authorizer of the Account's legal entity. + """ + director: Optional[bool] + """ + Whether the individual is a director of the Account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: Optional[bool] + """ + Whether the individual has significant responsibility to control, manage, or direct the organization. + """ + legal_guardian: Optional[bool] + """ + Whether the individual is the legal guardian of the Account's representative. + """ + owner: Optional[bool] + """ + Whether the individual is an owner of the Account's legal entity. + """ + percent_ownership: Optional[str] + """ + The percent owned by the individual of the Account's legal entity. + """ + representative: Optional[bool] + """ + Whether the individual is authorized as the primary representative of the Account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + """ + title: Optional[str] + """ + The individual's title (e.g., CEO, Support Engineer). + """ + + class ScriptAddresses(StripeObject): + class Kana(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class Kanji(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + kana: Optional[Kana] + """ + Kana Address. + """ + kanji: Optional[Kanji] + """ + Kanji Address. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + class ScriptNames(StripeObject): + class Kana(StripeObject): + given_name: Optional[str] + """ + The person's first or given name. + """ + surname: Optional[str] + """ + The person's last or family name. + """ + + class Kanji(StripeObject): + given_name: Optional[str] + """ + The person's first or given name. + """ + surname: Optional[str] + """ + The person's last or family name. + """ + + kana: Optional[Kana] + """ + Persons name in kana script. + """ + kanji: Optional[Kanji] + """ + Persons name in kanji script. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + account: str + """ + The account ID which the individual belongs to. + """ + additional_addresses: Optional[List[AdditionalAddress]] + """ + Additional addresses associated with the individual. + """ + additional_names: Optional[List[AdditionalName]] + """ + Additional names (e.g. aliases) associated with the individual. + """ + additional_terms_of_service: Optional[AdditionalTermsOfService] + """ + Terms of service acceptances. + """ + address: Optional[Address] + """ + The individual's residential address. + """ + created: str + """ + Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + date_of_birth: Optional[DateOfBirth] + """ + The individual's date of birth. + """ + documents: Optional[Documents] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: Optional[str] + """ + The individual's email address. + """ + given_name: Optional[str] + """ + The individual's first name. + """ + id: str + """ + Unique identifier for the object. + """ + id_numbers: Optional[List[IdNumber]] + """ + The identification numbers (e.g., SSN) associated with the individual. + """ + legal_gender: Optional[Literal["female", "male"]] + """ + The individual's gender (International regulations require either "male” or "female"). + """ + metadata: Optional[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: Optional[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The countries where the individual is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + object: str + """ + String representing the object's type. Objects of the same type share the same value. + """ + phone: Optional[str] + """ + The individual's phone number. + """ + political_exposure: Optional[Literal["existing", "none"]] + """ + Indicates if the individual or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + """ + relationship: Optional[Relationship] + """ + The relationship that this individual has with the Account's identity. + """ + script_addresses: Optional[ScriptAddresses] + """ + The script addresses (e.g., non-Latin characters) associated with the individual. + """ + script_names: Optional[ScriptNames] + """ + The script names (e.g. non-Latin characters) associated with the individual. + """ + surname: Optional[str] + """ + The individual's last name. + """ + updated: str + """ + Time at which the object was last updated. + """ + _inner_class_types = { + "additional_addresses": AdditionalAddress, + "additional_names": AdditionalName, + "additional_terms_of_service": AdditionalTermsOfService, + "address": Address, + "date_of_birth": DateOfBirth, + "documents": Documents, + "id_numbers": IdNumber, + "relationship": Relationship, + "script_addresses": ScriptAddresses, + "script_names": ScriptNames, + } + + attestations: Optional[Attestations] + """ + Attestations from the identity's key people, e.g. owners, executives, directors. + """ + business_details: Optional[BusinessDetails] + """ + Information about the company or business. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. + """ + entity_type: Optional[ + Literal["company", "government_entity", "individual", "non_profit"] + ] + """ + The entity type. + """ + individual: Optional[Individual] + """ + Information about the individual represented by the Account. This property is `null` unless `entity_type` is set to `individual`. + """ + _inner_class_types = { + "attestations": Attestations, + "business_details": BusinessDetails, + "individual": Individual, + } + + class Requirements(StripeObject): + class Entry(StripeObject): + class Error(StripeObject): + code: Literal[ + "invalid_address_city_state_postal_code", + "invalid_address_highway_contract_box", + "invalid_address_private_mailbox", + "invalid_business_profile_name", + "invalid_business_profile_name_denylisted", + "invalid_company_name_denylisted", + "invalid_dob_age_over_maximum", + "invalid_dob_age_under_18", + "invalid_dob_age_under_minimum", + "invalid_product_description_length", + "invalid_product_description_url_match", + "invalid_representative_country", + "invalid_statement_descriptor_business_mismatch", + "invalid_statement_descriptor_denylisted", + "invalid_statement_descriptor_length", + "invalid_statement_descriptor_prefix_denylisted", + "invalid_statement_descriptor_prefix_mismatch", + "invalid_street_address", + "invalid_tax_id", + "invalid_tax_id_format", + "invalid_tos_acceptance", + "invalid_url_denylisted", + "invalid_url_format", + "invalid_url_website_business_information_mismatch", + "invalid_url_website_empty", + "invalid_url_website_inaccessible", + "invalid_url_website_inaccessible_geoblocked", + "invalid_url_website_inaccessible_password_protected", + "invalid_url_website_incomplete", + "invalid_url_website_incomplete_cancellation_policy", + "invalid_url_website_incomplete_customer_service_details", + "invalid_url_website_incomplete_legal_restrictions", + "invalid_url_website_incomplete_refund_policy", + "invalid_url_website_incomplete_return_policy", + "invalid_url_website_incomplete_terms_and_conditions", + "invalid_url_website_incomplete_under_construction", + "invalid_url_website_other", + "invalid_url_web_presence_detected", + "invalid_value_other", + "unresolvable_ip_address", + "unresolvable_postal_code", + "verification_directors_mismatch", + "verification_document_address_mismatch", + "verification_document_address_missing", + "verification_document_corrupt", + "verification_document_country_not_supported", + "verification_document_directors_mismatch", + "verification_document_dob_mismatch", + "verification_document_duplicate_type", + "verification_document_expired", + "verification_document_failed_copy", + "verification_document_failed_greyscale", + "verification_document_failed_other", + "verification_document_failed_test_mode", + "verification_document_fraudulent", + "verification_document_id_number_mismatch", + "verification_document_id_number_missing", + "verification_document_incomplete", + "verification_document_invalid", + "verification_document_issue_or_expiry_date_missing", + "verification_document_manipulated", + "verification_document_missing_back", + "verification_document_missing_front", + "verification_document_name_mismatch", + "verification_document_name_missing", + "verification_document_nationality_mismatch", + "verification_document_not_readable", + "verification_document_not_signed", + "verification_document_not_uploaded", + "verification_document_photo_mismatch", + "verification_document_too_large", + "verification_document_type_not_supported", + "verification_extraneous_directors", + "verification_failed_address_match", + "verification_failed_business_iec_number", + "verification_failed_document_match", + "verification_failed_id_number_match", + "verification_failed_keyed_identity", + "verification_failed_keyed_match", + "verification_failed_name_match", + "verification_failed_other", + "verification_failed_representative_authority", + "verification_failed_residential_address", + "verification_failed_tax_id_match", + "verification_failed_tax_id_not_issued", + "verification_missing_directors", + "verification_missing_executives", + "verification_missing_owners", + "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", + "verification_selfie_document_missing_photo", + "verification_selfie_face_mismatch", + "verification_selfie_manipulated", + "verification_selfie_unverified_other", + "verification_supportability", + "verification_token_stale", + ] + """ + Machine-readable code describing the error. + """ + description: str + """ + Human-readable description of the error. + """ + + class Impact(StripeObject): + class RestrictsCapability(StripeObject): + class Deadline(StripeObject): + status: Literal[ + "currently_due", "eventually_due", "past_due" + ] + """ + The current status of the requirement's impact. + """ + + capability: Literal[ + "ach_debit_payments", + "acss_debit_payments", + "affirm_payments", + "afterpay_clearpay_payments", + "alma_payments", + "amazon_pay_payments", + "automatic_indirect_tax", + "au_becs_debit_payments", + "bacs_debit_payments", + "bancontact_payments", + "bank_accounts.local", + "bank_accounts.wire", + "blik_payments", + "boleto_payments", + "cards", + "card_payments", + "cartes_bancaires_payments", + "cashapp_payments", + "eps_payments", + "fpx_payments", + "gb_bank_transfer_payments", + "grabpay_payments", + "ideal_payments", + "jcb_payments", + "jp_bank_transfer_payments", + "kakao_pay_payments", + "klarna_payments", + "konbini_payments", + "kr_card_payments", + "link_payments", + "mobilepay_payments", + "multibanco_payments", + "mx_bank_transfer_payments", + "naver_pay_payments", + "oxxo_payments", + "p24_payments", + "payco_payments", + "paynow_payments", + "pay_by_bank_payments", + "promptpay_payments", + "revolut_pay_payments", + "samsung_pay_payments", + "sepa_bank_transfer_payments", + "sepa_debit_payments", + "stripe_balance.payouts", + "stripe_balance.stripe_transfers", + "swish_payments", + "twint_payments", + "us_bank_transfer_payments", + "zip_payments", + ] + """ + The name of the Capability which will be restricted. + """ + configuration: Literal["customer", "merchant", "recipient"] + """ + The configuration which specifies the Capability which will be restricted. + """ + deadline: Deadline + """ + Details about when in the account lifecycle the requirement must be collected by the avoid the Capability restriction. + """ + _inner_class_types = {"deadline": Deadline} + + restricts_capabilities: Optional[List[RestrictsCapability]] + """ + The Capabilities that will be restricted if the requirement is not collected and satisfactory to Stripe. + """ + _inner_class_types = { + "restricts_capabilities": RestrictsCapability, + } + + class MinimumDeadline(StripeObject): + status: Literal["currently_due", "eventually_due", "past_due"] + """ + The current status of the requirement's impact. + """ + + class Reference(StripeObject): + inquiry: Optional[str] + """ + If `inquiry` is the type, the inquiry token. + """ + resource: Optional[str] + """ + If `resource` is the type, the resource token. + """ + type: Literal["inquiry", "resource"] + """ + The type of the reference. An additional hash is included with a name matching the type. It contains additional information specific to the type. + """ + + class RequestedReason(StripeObject): + code: Literal[ + "future_requirements", + "routine_onboarding", + "routine_verification", + ] + """ + Machine-readable description of Stripe's reason for collecting the requirement. + """ + + awaiting_action_from: Literal["stripe", "user"] + """ + Whether the responsibility is with the integrator or with Stripe (to review info, to wait for some condition, etc.) to action the requirement. + """ + description: str + """ + Machine-readable string describing the requirement. + """ + errors: List[Error] + """ + Descriptions of why the requirement must be collected, or why the collected information isn't satisfactory to Stripe. + """ + impact: Impact + """ + A hash describing the impact of not collecting the requirement, or Stripe not being able to verify the collected information. + """ + minimum_deadline: MinimumDeadline + """ + The soonest point when the account will be impacted by not providing the requirement. + """ + reference: Optional[Reference] + """ + A reference to the location of the requirement. + """ + requested_reasons: List[RequestedReason] + """ + A list of reasons why Stripe is collecting the requirement. + """ + _inner_class_types = { + "errors": Error, + "impact": Impact, + "minimum_deadline": MinimumDeadline, + "reference": Reference, + "requested_reasons": RequestedReason, + } + + class Summary(StripeObject): + class MinimumDeadline(StripeObject): + status: Literal["currently_due", "eventually_due", "past_due"] + """ + The current strictest status of all requirements on the Account. + """ + time: Optional[str] + """ + The soonest RFC3339 date & time UTC value a requirement can impact the Account. + """ + + minimum_deadline: Optional[MinimumDeadline] + """ + The soonest date and time a requirement on the Account will become `past due`. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. + """ + _inner_class_types = {"minimum_deadline": MinimumDeadline} + + collector: Literal["application", "stripe"] + """ + A value indicating responsibility for collecting requirements on this account. + """ + entries: Optional[List[Entry]] + """ + A list of requirements for the Account. + """ + summary: Optional[Summary] + """ + An object containing an overview of requirements for the Account. + """ + _inner_class_types = {"entries": Entry, "summary": Summary} + + applied_configurations: List[Literal["customer", "merchant", "recipient"]] + """ + Filter only accounts that have all of the configurations specified. If omitted, returns all accounts regardless of which configurations they have. + """ + configuration: Optional[Configuration] + """ + An Account Configuration which allows the Account to take on a key persona across Stripe products. + """ + contact_email: Optional[str] + """ + The default contact email address for the Account. Required when configuring the account as a merchant or recipient. + """ + created: str + """ + Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + dashboard: Optional[Literal["express", "full", "none"]] + """ + A value indicating the Stripe dashboard this Account has access to. This will depend on which configurations are enabled for this account. + """ + defaults: Optional[Defaults] + """ + Default values to be used on Account Configurations. + """ + display_name: Optional[str] + """ + A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on any invoices sent to the Account. + """ + id: str + """ + Unique identifier for the Account. + """ + identity: Optional[Identity] + """ + Information about the company, individual, and business represented by the Account. + """ + metadata: Optional[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["v2.core.account"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + requirements: Optional[Requirements] + """ + Information about the requirements for the Account, including what information needs to be collected, and by when. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "configuration": Configuration, + "defaults": Defaults, + "identity": Identity, + "requirements": Requirements, + } diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py new file mode 100644 index 000000000..020dd88f2 --- /dev/null +++ b/stripe/v2/core/_account_link.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class AccountLink(StripeObject): + """ + AccountLinks are the means by which a Merchant grants an Account permission to access Stripe-hosted applications, such as Recipient Onboarding. This API is only available for users enrolled in the public preview for Global Payouts. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.account_link"]] = ( + "v2.core.account_link" + ) + + class UseCase(StripeObject): + class AccountOnboarding(StripeObject): + configurations: List[Literal["recipient"]] + """ + Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. + """ + refresh_url: str + """ + The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. + """ + return_url: Optional[str] + """ + The URL that the user will be redirected to upon completing the linked flow. + """ + + class AccountUpdate(StripeObject): + configurations: List[Literal["recipient"]] + """ + Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. + """ + refresh_url: str + """ + The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. + """ + return_url: Optional[str] + """ + The URL that the user will be redirected to upon completing the linked flow. + """ + + type: Literal["account_onboarding", "account_update"] + """ + Open Enum. The type of AccountLink the user is requesting. + """ + account_onboarding: Optional[AccountOnboarding] + """ + Indicates that the AccountLink provided should onboard an account. + """ + account_update: Optional[AccountUpdate] + """ + Indicates that the AccountLink provided should update a previously onboarded account. + """ + _inner_class_types = { + "account_onboarding": AccountOnboarding, + "account_update": AccountUpdate, + } + + account: str + """ + The ID of the Account the link was created for. + """ + created: str + """ + The timestamp at which this AccountLink was created. + """ + expires_at: str + """ + The timestamp at which this AccountLink will expire. + """ + object: Literal["v2.core.account_link"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + url: str + """ + The URL for the AccountLink. + """ + use_case: UseCase + """ + The use case of AccountLink the user is requesting. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"use_case": UseCase} diff --git a/stripe/v2/core/_account_link_service.py b/stripe/v2/core/_account_link_service.py new file mode 100644 index 000000000..2b691156b --- /dev/null +++ b/stripe/v2/core/_account_link_service.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.v2.core._account_link import AccountLink +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class AccountLinkService(StripeService): + class CreateParams(TypedDict): + account: str + """ + The ID of the Account to create link for. + """ + use_case: "AccountLinkService.CreateParamsUseCase" + """ + The use case of the AccountLink. + """ + + class CreateParamsUseCase(TypedDict): + type: Literal["account_onboarding", "account_update"] + """ + Open Enum. The type of AccountLink the user is requesting. + """ + account_onboarding: NotRequired[ + "AccountLinkService.CreateParamsUseCaseAccountOnboarding" + ] + """ + Indicates that the AccountLink provided should onboard an account. + """ + account_update: NotRequired[ + "AccountLinkService.CreateParamsUseCaseAccountUpdate" + ] + """ + Indicates that the AccountLink provided should update a previously onboarded account. + """ + + class CreateParamsUseCaseAccountOnboarding(TypedDict): + configurations: List[Literal["recipient"]] + """ + Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. + """ + refresh_url: str + """ + The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. + """ + return_url: NotRequired[str] + """ + The URL that the user will be redirected to upon completing the linked flow. + """ + + class CreateParamsUseCaseAccountUpdate(TypedDict): + configurations: List[Literal["recipient"]] + """ + Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. + """ + refresh_url: str + """ + The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. + """ + return_url: NotRequired[str] + """ + The URL that the user will be redirected to upon completing the linked flow. + """ + + def create( + self, + params: "AccountLinkService.CreateParams", + options: RequestOptions = {}, + ) -> AccountLink: + """ + Creates an AccountLink object that includes a single-use Stripe URL that the merchant can redirect their user to in order to take them to a Stripe-hosted application such as Recipient Onboarding. + """ + return cast( + AccountLink, + self._request( + "post", + "/v2/core/account_links", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "AccountLinkService.CreateParams", + options: RequestOptions = {}, + ) -> AccountLink: + """ + Creates an AccountLink object that includes a single-use Stripe URL that the merchant can redirect their user to in order to take them to a Stripe-hosted application such as Recipient Onboarding. + """ + return cast( + AccountLink, + await self._request_async( + "post", + "/v2/core/account_links", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_account_service.py b/stripe/v2/core/_account_service.py new file mode 100644 index 000000000..cae8b0150 --- /dev/null +++ b/stripe/v2/core/_account_service.py @@ -0,0 +1,10774 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._list_object import ListObject +from stripe.v2.core._account import Account +from stripe.v2.core.accounts._person_service import PersonService +from typing import Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class AccountService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.persons = PersonService(self._requestor) + + class CloseParams(TypedDict): + applied_configurations: NotRequired[ + List[Literal["customer", "merchant", "recipient"]] + ] + """ + Configurations on the Account to be closed. All configurations on the Account must be passed in for this request to succeed. + """ + + class CreateParams(TypedDict): + configuration: NotRequired["AccountService.CreateParamsConfiguration"] + """ + An Account Configuration which allows the Account to take on a key persona across Stripe products. + """ + contact_email: NotRequired[str] + """ + The default contact email address for the Account. Required when configuring the account as a merchant or recipient. + """ + dashboard: NotRequired[Literal["express", "full", "none"]] + """ + A value indicating the Stripe dashboard this Account has access to. This will depend on which configurations are enabled for this account. + """ + defaults: NotRequired["AccountService.CreateParamsDefaults"] + """ + Default values to be used on Account Configurations. + """ + display_name: NotRequired[str] + """ + A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on any invoices sent to the Account. + """ + identity: NotRequired["AccountService.CreateParamsIdentity"] + """ + Information about the company, individual, and business represented by the Account. + """ + include: NotRequired[ + List[ + Literal[ + "configuration.customer", + "configuration.merchant", + "configuration.recipient", + "defaults", + "identity", + "requirements", + ] + ] + ] + """ + Additional fields to include in the response. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + + class CreateParamsConfiguration(TypedDict): + customer: NotRequired[ + "AccountService.CreateParamsConfigurationCustomer" + ] + """ + The Customer Configuration allows the Account to be used in inbound payment flows. + """ + merchant: NotRequired[ + "AccountService.CreateParamsConfigurationMerchant" + ] + """ + The Merchant configuration allows the Account to act as a connected account and collect payments facilitated by a Connect platform. You can add this configuration to your connected accounts only if you've completed onboarding as a Connect platform. + """ + recipient: NotRequired[ + "AccountService.CreateParamsConfigurationRecipient" + ] + """ + The Recipient Configuration allows the Account to receive funds. + """ + + class CreateParamsConfigurationCustomer(TypedDict): + automatic_indirect_tax: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerAutomaticIndirectTax" + ] + """ + Automatic indirect tax settings to be used when automatic tax calculation is enabled on the customer's invoices, subscriptions, checkout sessions, or payment links. Surfaces if automatic tax calculation is possible given the current customer location information. + """ + billing: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerBilling" + ] + """ + Billing settings - default settings used for this customer in Billing flows such as Invoices and Subscriptions. + """ + capabilities: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerCapabilities" + ] + """ + Capabilities that have been requested on the Customer Configuration. + """ + shipping: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerShipping" + ] + """ + The customer's shipping information. Appears on invoices emailed to this customer. + """ + test_clock: NotRequired[str] + """ + ID of the test clock to attach to the customer. Can only be set on testmode Accounts, and when the Customer Configuration is first set on an Account. + """ + + class CreateParamsConfigurationCustomerAutomaticIndirectTax(TypedDict): + exempt: NotRequired[Literal["exempt", "none", "reverse"]] + """ + Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + """ + ip_address: NotRequired[str] + """ + A recent IP address of the customer used for tax reporting and tax location inference. + """ + location_source: NotRequired[ + Literal["identity_address", "ip_address", "shipping_address"] + ] + """ + The data source used to identify the customer's tax location - defaults to 'identity_address'. Will only be used for automatic tax calculation on the customer's Invoices and Subscriptions. + """ + + class CreateParamsConfigurationCustomerBilling(TypedDict): + invoice: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerBillingInvoice" + ] + """ + Default settings used on invoices for this customer. + """ + + class CreateParamsConfigurationCustomerBillingInvoice(TypedDict): + custom_fields: NotRequired[ + List[ + "AccountService.CreateParamsConfigurationCustomerBillingInvoiceCustomField" + ] + ] + """ + The list of up to 4 default custom fields to be displayed on invoices for this customer. + """ + footer: NotRequired[str] + """ + Default footer to be displayed on invoices for this customer. + """ + next_sequence: NotRequired[int] + """ + The sequence to be used on the customer's next invoice. Defaults to 1. + """ + prefix: NotRequired[str] + """ + The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + """ + rendering: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerBillingInvoiceRendering" + ] + """ + Default options for invoice PDF rendering for this customer. + """ + + class CreateParamsConfigurationCustomerBillingInvoiceCustomField( + TypedDict + ): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. When updating, pass an empty string to remove previously-defined values. + """ + + class CreateParamsConfigurationCustomerBillingInvoiceRendering(TypedDict): + amount_tax_display: NotRequired[ + Literal["exclude_tax", "include_inclusive_tax"] + ] + """ + How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of exclude_tax or include_inclusive_tax. include_inclusive_tax will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. exclude_tax will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ + + class CreateParamsConfigurationCustomerCapabilities(TypedDict): + automatic_indirect_tax: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTax" + ] + """ + Generates requirements for enabling automatic indirect tax calculation on this customer's invoices or subscriptions. Recommended to request this capability if planning to enable automatic tax calculation on this customer's invoices or subscriptions. Uses the `location_source` field. + """ + + class CreateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTax( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationCustomerShipping(TypedDict): + address: NotRequired[ + "AccountService.CreateParamsConfigurationCustomerShippingAddress" + ] + """ + Customer shipping address. + """ + name: NotRequired[str] + """ + Customer name. + """ + phone: NotRequired[str] + """ + Customer phone (including extension). + """ + + class CreateParamsConfigurationCustomerShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class CreateParamsConfigurationMerchant(TypedDict): + bacs_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantBacsDebitPayments" + ] + """ + Settings used for Bacs debit payments. + """ + branding: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantBranding" + ] + """ + Settings used to apply the merchant's branding to email receipts, invoices, Checkout, and other products. + """ + capabilities: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilities" + ] + """ + Capabilities to request on the Merchant Configuration. + """ + card_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCardPayments" + ] + """ + Card payments settings. + """ + mcc: NotRequired[str] + """ + The merchant category code for the Merchant Configuration. MCCs are used to classify businesses based on the goods or services they provide. + """ + statement_descriptor: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantStatementDescriptor" + ] + """ + Statement descriptor. + """ + support: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantSupport" + ] + """ + Publicly available contact information for sending support issues to. + """ + + class CreateParamsConfigurationMerchantBacsDebitPayments(TypedDict): + display_name: NotRequired[str] + """ + Display name for Bacs debit payments. + """ + + class CreateParamsConfigurationMerchantBranding(TypedDict): + icon: NotRequired[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): An icon for the merchant. Must be square and at least 128px x 128px. + """ + logo: NotRequired[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): A logo for the merchant that will be used in Checkout instead of the icon and without the merchant's name next to it if provided. Must be at least 128px x 128px. + """ + primary_color: NotRequired[str] + """ + A CSS hex color value representing the primary branding color for the merchant. + """ + secondary_color: NotRequired[str] + """ + A CSS hex color value representing the secondary branding color for the merchant. + """ + + class CreateParamsConfigurationMerchantCapabilities(TypedDict): + ach_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAchDebitPayments" + ] + """ + Allow the merchant to process ACH debit payments. + """ + acss_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAcssDebitPayments" + ] + """ + Allow the merchant to process ACSS debit payments. + """ + affirm_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAffirmPayments" + ] + """ + Allow the merchant to process Affirm payments. + """ + afterpay_clearpay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAfterpayClearpayPayments" + ] + """ + Allow the merchant to process Afterpay/Clearpay payments. + """ + alma_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAlmaPayments" + ] + """ + Allow the merchant to process Alma payments. + """ + amazon_pay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAmazonPayPayments" + ] + """ + Allow the merchant to process Amazon Pay payments. + """ + au_becs_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesAuBecsDebitPayments" + ] + """ + Allow the merchant to process Australian BECS Direct Debit payments. + """ + bacs_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesBacsDebitPayments" + ] + """ + Allow the merchant to process BACS Direct Debit payments. + """ + bancontact_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesBancontactPayments" + ] + """ + Allow the merchant to process Bancontact payments. + """ + blik_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesBlikPayments" + ] + """ + Allow the merchant to process BLIK payments. + """ + boleto_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesBoletoPayments" + ] + """ + Allow the merchant to process Boleto payments. + """ + card_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesCardPayments" + ] + """ + Allow the merchant to collect card payments. + """ + cartes_bancaires_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments" + ] + """ + Allow the merchant to process Cartes Bancaires payments. + """ + cashapp_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesCashappPayments" + ] + """ + Allow the merchant to process Cash App payments. + """ + eps_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesEpsPayments" + ] + """ + Allow the merchant to process EPS payments. + """ + fpx_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesFpxPayments" + ] + """ + Allow the merchant to process FPX payments. + """ + gb_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesGbBankTransferPayments" + ] + """ + Allow the merchant to process UK bank transfer payments. + """ + grabpay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesGrabpayPayments" + ] + """ + Allow the merchant to process GrabPay payments. + """ + ideal_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesIdealPayments" + ] + """ + Allow the merchant to process iDEAL payments. + """ + jcb_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesJcbPayments" + ] + """ + Allow the merchant to process JCB card payments. + """ + jp_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesJpBankTransferPayments" + ] + """ + Allow the merchant to process Japanese bank transfer payments. + """ + kakao_pay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesKakaoPayPayments" + ] + """ + Allow the merchant to process Kakao Pay payments. + """ + klarna_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesKlarnaPayments" + ] + """ + Allow the merchant to process Klarna payments. + """ + konbini_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesKonbiniPayments" + ] + """ + Allow the merchant to process Konbini convenience store payments. + """ + kr_card_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesKrCardPayments" + ] + """ + Allow the merchant to process Korean card payments. + """ + link_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesLinkPayments" + ] + """ + Allow the merchant to process Link payments. + """ + mobilepay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesMobilepayPayments" + ] + """ + Allow the merchant to process MobilePay payments. + """ + multibanco_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesMultibancoPayments" + ] + """ + Allow the merchant to process Multibanco payments. + """ + mx_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesMxBankTransferPayments" + ] + """ + Allow the merchant to process Mexican bank transfer payments. + """ + naver_pay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesNaverPayPayments" + ] + """ + Allow the merchant to process Naver Pay payments. + """ + oxxo_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesOxxoPayments" + ] + """ + Allow the merchant to process OXXO payments. + """ + p24_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesP24Payments" + ] + """ + Allow the merchant to process Przelewy24 (P24) payments. + """ + pay_by_bank_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesPayByBankPayments" + ] + """ + Allow the merchant to process Pay by Bank payments. + """ + payco_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesPaycoPayments" + ] + """ + Allow the merchant to process PAYCO payments. + """ + paynow_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesPaynowPayments" + ] + """ + Allow the merchant to process PayNow payments. + """ + promptpay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesPromptpayPayments" + ] + """ + Allow the merchant to process PromptPay payments. + """ + revolut_pay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesRevolutPayPayments" + ] + """ + Allow the merchant to process Revolut Pay payments. + """ + samsung_pay_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesSamsungPayPayments" + ] + """ + Allow the merchant to process Samsung Pay payments. + """ + sepa_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments" + ] + """ + Allow the merchant to process SEPA bank transfer payments. + """ + sepa_debit_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesSepaDebitPayments" + ] + """ + Allow the merchant to process SEPA Direct Debit payments. + """ + swish_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesSwishPayments" + ] + """ + Allow the merchant to process Swish payments. + """ + twint_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesTwintPayments" + ] + """ + Allow the merchant to process TWINT payments. + """ + us_bank_transfer_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesUsBankTransferPayments" + ] + """ + Allow the merchant to process US bank transfer payments. + """ + zip_payments: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCapabilitiesZipPayments" + ] + """ + Allow the merchant to process Zip payments. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAchDebitPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAcssDebitPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAffirmPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAfterpayClearpayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAlmaPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAmazonPayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesAuBecsDebitPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesBacsDebitPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesBancontactPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesBlikPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesBoletoPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesCardPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesCashappPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesEpsPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesFpxPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesGbBankTransferPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesGrabpayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesIdealPayments( + TypedDict + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesJcbPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesJpBankTransferPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesKakaoPayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesKlarnaPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesKonbiniPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesKrCardPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesLinkPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesMobilepayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesMultibancoPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesMxBankTransferPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesNaverPayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesOxxoPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesP24Payments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesPayByBankPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesPaycoPayments( + TypedDict + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesPaynowPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesPromptpayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesRevolutPayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesSamsungPayPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesSepaDebitPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesSwishPayments( + TypedDict + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesTwintPayments( + TypedDict + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesUsBankTransferPayments( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCapabilitiesZipPayments(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationMerchantCardPayments(TypedDict): + decline_on: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantCardPaymentsDeclineOn" + ] + """ + Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + """ + + class CreateParamsConfigurationMerchantCardPaymentsDeclineOn(TypedDict): + avs_failure: NotRequired[bool] + """ + Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + """ + cvc_failure: NotRequired[bool] + """ + Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + """ + + class CreateParamsConfigurationMerchantStatementDescriptor(TypedDict): + descriptor: NotRequired[str] + """ + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a statement_descriptor_prefix, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the statement_descriptor text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + prefix: NotRequired[str] + """ + Default text that appears on statements for card charges outside of Japan, prefixing any dynamic statement_descriptor_suffix specified on the charge. To maximize space for the dynamic part of the descriptor, keep this text short. If you don't specify this value, statement_descriptor is used as the prefix. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + + class CreateParamsConfigurationMerchantSupport(TypedDict): + address: NotRequired[ + "AccountService.CreateParamsConfigurationMerchantSupportAddress" + ] + """ + A publicly available mailing address for sending support issues to. + """ + email: NotRequired[str] + """ + A publicly available email address for sending support issues to. + """ + phone: NotRequired[str] + """ + A publicly available phone number to call with support issues. + """ + url: NotRequired[str] + """ + A publicly available website for handling support issues. + """ + + class CreateParamsConfigurationMerchantSupportAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsConfigurationRecipient(TypedDict): + capabilities: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilities" + ] + """ + Capabilities to be requested on the Recipient Configuration. + """ + + class CreateParamsConfigurationRecipientCapabilities(TypedDict): + bank_accounts: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesBankAccounts" + ] + """ + Capabilities that enable OutboundPayments to a bank account linked to this Account. + """ + cards: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesCards" + ] + """ + Capabilities that enable OutboundPayments to a card linked to this Account. + """ + stripe_balance: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesStripeBalance" + ] + """ + Capabilities that enable the recipient to manage their Stripe Balance (/v1/balance). + """ + + class CreateParamsConfigurationRecipientCapabilitiesBankAccounts( + TypedDict + ): + local: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesBankAccountsLocal" + ] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over local networks. + """ + wire: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesBankAccountsWire" + ] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over wire. + """ + + class CreateParamsConfigurationRecipientCapabilitiesBankAccountsLocal( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationRecipientCapabilitiesBankAccountsWire( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationRecipientCapabilitiesCards(TypedDict): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsConfigurationRecipientCapabilitiesStripeBalance( + TypedDict, + ): + stripe_transfers: NotRequired[ + "AccountService.CreateParamsConfigurationRecipientCapabilitiesStripeBalanceStripeTransfers" + ] + """ + Allows the account to receive /v1/transfers into their Stripe Balance (/v1/balance). + """ + + class CreateParamsConfigurationRecipientCapabilitiesStripeBalanceStripeTransfers( + TypedDict, + ): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class CreateParamsDefaults(TypedDict): + currency: NotRequired[ + Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + ] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + locales: NotRequired[ + List[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ] + ] + ] + """ + The Account's preferred locales (languages), ordered by preference. + """ + responsibilities: NotRequired[ + "AccountService.CreateParamsDefaultsResponsibilities" + ] + """ + Default responsibilities held by either Stripe or the platform. + """ + + class CreateParamsDefaultsResponsibilities(TypedDict): + fees_collector: Literal["application", "stripe"] + """ + A value indicating the party responsible for collecting fees from this account. + """ + losses_collector: Literal["application", "stripe"] + """ + A value indicating who is responsible for losses when this Account can't pay back negative balances from payments. + """ + + class CreateParamsIdentity(TypedDict): + attestations: NotRequired[ + "AccountService.CreateParamsIdentityAttestations" + ] + """ + Attestations from the identity's key people, e.g. owners, executives, directors. + """ + business_details: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetails" + ] + """ + Information about the company or business. + """ + country: NotRequired[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. + """ + entity_type: NotRequired[ + Literal["company", "government_entity", "individual", "non_profit"] + ] + """ + The entity type. + """ + individual: NotRequired[ + "AccountService.CreateParamsIdentityIndividual" + ] + """ + Information about the person represented by the account. + """ + + class CreateParamsIdentityAttestations(TypedDict): + directorship_declaration: NotRequired[ + "AccountService.CreateParamsIdentityAttestationsDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ + ownership_declaration: NotRequired[ + "AccountService.CreateParamsIdentityAttestationsOwnershipDeclaration" + ] + """ + This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + """ + persons_provided: NotRequired[ + "AccountService.CreateParamsIdentityAttestationsPersonsProvided" + ] + """ + Attestation that all Persons with a specific Relationship value have been provided. + """ + terms_of_service: NotRequired[ + "AccountService.CreateParamsIdentityAttestationsTermsOfService" + ] + """ + Attestations of accepted terms of service agreements. + """ + + class CreateParamsIdentityAttestationsDirectorshipDeclaration(TypedDict): + date: NotRequired[str] + """ + The time marking when the director attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the director attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the director attestation was made. + """ + + class CreateParamsIdentityAttestationsOwnershipDeclaration(TypedDict): + date: NotRequired[str] + """ + The time marking when the beneficial owner attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the beneficial owner attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the beneficial owner attestation was made. + """ + + class CreateParamsIdentityAttestationsPersonsProvided(TypedDict): + directors: NotRequired[bool] + """ + Whether the company's directors have been provided. Set this Boolean to true after creating all the company's directors with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + executives: NotRequired[bool] + """ + Whether the company's executives have been provided. Set this Boolean to true after creating all the company's executives with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + owners: NotRequired[bool] + """ + Whether the company's owners have been provided. Set this Boolean to true after creating all the company's owners with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + ownership_exemption_reason: NotRequired[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ] + ] + """ + Reason for why the company is exempt from providing ownership information. + """ + + class CreateParamsIdentityAttestationsTermsOfService(TypedDict): + account: NotRequired[ + "AccountService.CreateParamsIdentityAttestationsTermsOfServiceAccount" + ] + """ + Details on the Account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance). + """ + + class CreateParamsIdentityAttestationsTermsOfServiceAccount(TypedDict): + date: str + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: str + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + class CreateParamsIdentityBusinessDetails(TypedDict): + address: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsAddress" + ] + """ + The business registration address of the business entity. + """ + annual_revenue: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsAnnualRevenue" + ] + """ + The business gross annual revenue for its preceding fiscal year. + """ + documents: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocuments" + ] + """ + A document verifying the business. + """ + doing_business_as: NotRequired[str] + """ + The name which is used by the business. + """ + estimated_worker_count: NotRequired[int] + """ + An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + """ + id_numbers: NotRequired[ + List["AccountService.CreateParamsIdentityBusinessDetailsIdNumber"] + ] + """ + The ID numbers of a business entity. + """ + monthly_estimated_revenue: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue" + ] + """ + An estimate of the monthly revenue of the business. + """ + phone: NotRequired[str] + """ + The phone number of the Business Entity. + """ + product_description: NotRequired[str] + """ + Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + """ + registered_name: NotRequired[str] + """ + The business legal name. + """ + script_addresses: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptAddresses" + ] + """ + The business registration address of the business entity in non latin script. + """ + script_names: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptNames" + ] + """ + The business legal name in non latin script. + """ + structure: NotRequired[ + Literal[ + "cooperative", + "free_zone_establishment", + "free_zone_llc", + "governmental_unit", + "government_instrumentality", + "incorporated_association", + "incorporated_non_profit", + "incorporated_partnership", + "limited_liability_partnership", + "llc", + "multi_member_llc", + "private_company", + "private_corporation", + "private_partnership", + "public_company", + "public_corporation", + "public_listed_corporation", + "public_partnership", + "registered_charity", + "single_member_llc", + "sole_establishment", + "sole_proprietorship", + "tax_exempt_government_instrumentality", + "trust", + "unincorporated_association", + "unincorporated_non_profit", + "unincorporated_partnership", + ] + ] + """ + The category identifying the legal structure of the business. + """ + url: NotRequired[str] + """ + The business's publicly available website. + """ + + class CreateParamsIdentityBusinessDetailsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): + amount: NotRequired[AmountParam] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + fiscal_year_end: NotRequired[str] + """ + The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + """ + + class CreateParamsIdentityBusinessDetailsDocuments(TypedDict): + bank_account_ownership_verification: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification" + ] + """ + One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + """ + company_license: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsCompanyLicense" + ] + """ + One or more documents that demonstrate proof of a company's license to operate. + """ + company_memorandum_of_association: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAssociation" + ] + """ + One or more documents showing the company's Memorandum of Association. + """ + company_ministerial_decree: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecree" + ] + """ + Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. + """ + company_registration_verification: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVerification" + ] + """ + One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + """ + company_tax_id_verification: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerification" + ] + """ + One or more documents that demonstrate proof of a company's tax ID. + """ + primary_verification: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsPrimaryVerification" + ] + """ + A document verifying the business. + """ + proof_of_registration: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration" + ] + """ + One or more documents showing the company's proof of registration with the national business registry. + """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsCompanyLicense( + TypedDict + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAssociation( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecree( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( + TypedDict, + ): + front_back: "AccountService.CreateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityBusinessDetailsIdNumber(TypedDict): + registrar: NotRequired[str] + """ + The registrar of the ID number (Only valid for DE ID number types). + """ + type: Literal[ + "ae_crn", + "ae_vat", + "at_fn", + "au_abn", + "au_acn", + "au_in", + "be_cbe", + "bg_uic", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cy_tic", + "cz_ico", + "de_hrn", + "de_vat", + "dk_cvr", + "ee_rk", + "es_cif", + "fi_yt", + "fr_siren", + "fr_vat", + "gb_crn", + "gi_crn", + "gr_gemi", + "hk_br", + "hk_cr", + "hk_mbs", + "hu_cjs", + "ie_crn", + "it_rea", + "it_vat", + "jp_cn", + "li_uid", + "lt_ccrn", + "lu_rcs", + "lv_urn", + "mt_crn", + "mx_rfc", + "my_brn", + "my_coid", + "my_sst", + "nl_kvk", + "no_orgnr", + "nz_bn", + "pl_regon", + "pt_vat", + "ro_cui", + "se_orgnr", + "sg_uen", + "si_msp", + "sk_ico", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ] + """ + Open Enum. The ID number type of a business entity. + """ + value: str + """ + The value of the ID number. + """ + + class CreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue( + TypedDict + ): + amount: NotRequired[AmountParam] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + + class CreateParamsIdentityBusinessDetailsScriptAddresses(TypedDict): + kana: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptAddressesKana" + ] + """ + Kana Address. + """ + kanji: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptAddressesKanji" + ] + """ + Kanji Address. + """ + + class CreateParamsIdentityBusinessDetailsScriptAddressesKana(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityBusinessDetailsScriptAddressesKanji(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityBusinessDetailsScriptNames(TypedDict): + kana: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptNamesKana" + ] + """ + Kana name. + """ + kanji: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsScriptNamesKanji" + ] + """ + Kanji name. + """ + + class CreateParamsIdentityBusinessDetailsScriptNamesKana(TypedDict): + registered_name: NotRequired[str] + """ + Registered name of the business. + """ + + class CreateParamsIdentityBusinessDetailsScriptNamesKanji(TypedDict): + registered_name: NotRequired[str] + """ + Registered name of the business. + """ + + class CreateParamsIdentityIndividual(TypedDict): + additional_addresses: NotRequired[ + List[ + "AccountService.CreateParamsIdentityIndividualAdditionalAddress" + ] + ] + """ + Additional addresses associated with the individual. + """ + additional_names: NotRequired[ + List["AccountService.CreateParamsIdentityIndividualAdditionalName"] + ] + """ + Additional names (e.g. aliases) associated with the individual. + """ + address: NotRequired[ + "AccountService.CreateParamsIdentityIndividualAddress" + ] + """ + The individual's residential address. + """ + date_of_birth: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDateOfBirth" + ] + """ + The individual's date of birth. + """ + documents: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocuments" + ] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: NotRequired[str] + """ + The individual's email address. + """ + given_name: NotRequired[str] + """ + The individual's first name. + """ + id_numbers: NotRequired[ + List["AccountService.CreateParamsIdentityIndividualIdNumber"] + ] + """ + The identification numbers (e.g., SSN) associated with the individual. + """ + legal_gender: NotRequired[Literal["female", "male"]] + """ + The individual's gender (International regulations require either "male" or "female"). + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: NotRequired[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The countries where the individual is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + phone: NotRequired[str] + """ + The individual's phone number. + """ + political_exposure: NotRequired[Literal["existing", "none"]] + """ + The individual's political exposure. + """ + relationship: NotRequired[ + "AccountService.CreateParamsIdentityIndividualRelationship" + ] + """ + The relationship that this individual has with the account's identity. + """ + script_addresses: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptAddresses" + ] + """ + The script addresses (e.g., non-Latin characters) associated with the individual. + """ + script_names: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptNames" + ] + """ + The individuals primary name in non latin script. + """ + surname: NotRequired[str] + """ + The individual's last name. + """ + + class CreateParamsIdentityIndividualAdditionalAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityIndividualAdditionalName(TypedDict): + full_name: NotRequired[str] + """ + The person's full name. + """ + given_name: NotRequired[str] + """ + The person's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class CreateParamsIdentityIndividualAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityIndividualDateOfBirth(TypedDict): + day: int + """ + The day of birth. + """ + month: int + """ + The month of birth. + """ + year: int + """ + The year of birth. + """ + + class CreateParamsIdentityIndividualDocuments(TypedDict): + company_authorization: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocumentsCompanyAuthorization" + ] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocumentsPassport" + ] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocumentsPrimaryVerification" + ] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocumentsSecondaryVerification" + ] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: NotRequired[ + "AccountService.CreateParamsIdentityIndividualDocumentsVisa" + ] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + + class CreateParamsIdentityIndividualDocumentsCompanyAuthorization( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityIndividualDocumentsPassport(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityIndividualDocumentsPrimaryVerification( + TypedDict + ): + front_back: "AccountService.CreateParamsIdentityIndividualDocumentsPrimaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class CreateParamsIdentityIndividualDocumentsPrimaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class CreateParamsIdentityIndividualDocumentsSecondaryVerification( + TypedDict, + ): + front_back: "AccountService.CreateParamsIdentityIndividualDocumentsSecondaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class CreateParamsIdentityIndividualDocumentsSecondaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class CreateParamsIdentityIndividualDocumentsVisa(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdentityIndividualIdNumber(TypedDict): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + value: str + """ + The value of the ID number. + """ + + class CreateParamsIdentityIndividualRelationship(TypedDict): + director: NotRequired[bool] + """ + Whether the person is a director of the account's identity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired[bool] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired[bool] + """ + Whether the person is an owner of the account's identity. + """ + percent_ownership: NotRequired[str] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired[str] + """ + The person's title (e.g., CEO, Support Engineer). + """ + + class CreateParamsIdentityIndividualScriptAddresses(TypedDict): + kana: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptAddressesKana" + ] + """ + Kana Address. + """ + kanji: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptAddressesKanji" + ] + """ + Kanji Address. + """ + + class CreateParamsIdentityIndividualScriptAddressesKana(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityIndividualScriptAddressesKanji(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsIdentityIndividualScriptNames(TypedDict): + kana: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptNamesKana" + ] + """ + Persons name in kana script. + """ + kanji: NotRequired[ + "AccountService.CreateParamsIdentityIndividualScriptNamesKanji" + ] + """ + Persons name in kanji script. + """ + + class CreateParamsIdentityIndividualScriptNamesKana(TypedDict): + given_name: NotRequired[str] + """ + The person's first or given name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class CreateParamsIdentityIndividualScriptNamesKanji(TypedDict): + given_name: NotRequired[str] + """ + The person's first or given name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class ListParams(TypedDict): + applied_configurations: NotRequired[List[str]] + """ + Filter only accounts that have all of the configurations specified. If omitted, returns all accounts regardless of which configurations they have. + """ + limit: NotRequired[int] + """ + The upper limit on the number of accounts returned by the List Account request. + """ + + class RetrieveParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "configuration.customer", + "configuration.merchant", + "configuration.recipient", + "defaults", + "identity", + "requirements", + ] + ] + ] + """ + Additional fields to include in the response. + """ + + class UpdateParams(TypedDict): + configuration: NotRequired["AccountService.UpdateParamsConfiguration"] + """ + An Account Configuration which allows the Account to take on a key persona across Stripe products. + """ + contact_email: NotRequired[str] + """ + The default contact email address for the Account. Required when configuring the account as a merchant or recipient. + """ + dashboard: NotRequired[Literal["express", "full", "none"]] + """ + A value indicating the Stripe dashboard this Account has access to. This will depend on which configurations are enabled for this account. + """ + defaults: NotRequired["AccountService.UpdateParamsDefaults"] + """ + Default values to be used on Account Configurations. + """ + display_name: NotRequired[str] + """ + A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on any invoices sent to the Account. + """ + identity: NotRequired["AccountService.UpdateParamsIdentity"] + """ + Information about the company, individual, and business represented by the Account. + """ + include: NotRequired[ + List[ + Literal[ + "configuration.customer", + "configuration.merchant", + "configuration.recipient", + "defaults", + "identity", + "requirements", + ] + ] + ] + """ + Additional fields to include in the response. + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + + class UpdateParamsConfiguration(TypedDict): + customer: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomer" + ] + """ + The Customer Configuration allows the Account to be charged. + """ + merchant: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchant" + ] + """ + The Merchant configuration allows the Account to act as a connected account and collect payments facilitated by a Connect platform. You can add this configuration to your connected accounts only if you've completed onboarding as a Connect platform. + """ + recipient: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipient" + ] + """ + The Recipient Configuration allows the Account to receive funds. + """ + + class UpdateParamsConfigurationCustomer(TypedDict): + automatic_indirect_tax: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerAutomaticIndirectTax" + ] + """ + Automatic indirect tax settings to be used when automatic tax calculation is enabled on the customer's invoices, subscriptions, checkout sessions, or payment links. Surfaces if automatic tax calculation is possible given the current customer location information. + """ + billing: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerBilling" + ] + """ + Billing settings - default settings used for this customer in Billing flows such as Invoices and Subscriptions. + """ + capabilities: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerCapabilities" + ] + """ + Capabilities that have been requested on the Customer Configuration. + """ + shipping: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerShipping" + ] + """ + The customer's shipping information. Appears on invoices emailed to this customer. + """ + test_clock: NotRequired[str] + """ + ID of the test clock to attach to the customer. Can only be set on testmode Accounts, and when the Customer Configuration is first set on an Account. + """ + + class UpdateParamsConfigurationCustomerAutomaticIndirectTax(TypedDict): + exempt: NotRequired[Literal["exempt", "none", "reverse"]] + """ + Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + """ + ip_address: NotRequired[str] + """ + A recent IP address of the customer used for tax reporting and tax location inference. + """ + location_source: NotRequired[ + Literal["identity_address", "ip_address", "shipping_address"] + ] + """ + The data source used to identify the customer's tax location - defaults to 'identity_address'. Will only be used for automatic tax calculation on the customer's Invoices and Subscriptions. + """ + validate_location: NotRequired[ + Literal["auto", "deferred", "immediately"] + ] + """ + A per-request flag that indicates when Stripe should validate the customer tax location - defaults to 'auto'. + """ + + class UpdateParamsConfigurationCustomerBilling(TypedDict): + default_payment_method: NotRequired[str] + """ + ID of a payment method that's attached to the customer, to be used as the customer's default payment method for invoices and subscriptions. + """ + invoice: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerBillingInvoice" + ] + """ + Default settings used on invoices for this customer. + """ + + class UpdateParamsConfigurationCustomerBillingInvoice(TypedDict): + custom_fields: NotRequired[ + List[ + "AccountService.UpdateParamsConfigurationCustomerBillingInvoiceCustomField" + ] + ] + """ + The list of up to 4 default custom fields to be displayed on invoices for this customer. + """ + footer: NotRequired[str] + """ + Default footer to be displayed on invoices for this customer. + """ + next_sequence: NotRequired[int] + """ + The sequence to be used on the customer's next invoice. Defaults to 1. + """ + prefix: NotRequired[str] + """ + The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + """ + rendering: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerBillingInvoiceRendering" + ] + """ + Default options for invoice PDF rendering for this customer. + """ + + class UpdateParamsConfigurationCustomerBillingInvoiceCustomField( + TypedDict + ): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. When updating, pass an empty string to remove previously-defined values. + """ + + class UpdateParamsConfigurationCustomerBillingInvoiceRendering(TypedDict): + amount_tax_display: NotRequired[ + Literal["exclude_tax", "include_inclusive_tax"] + ] + """ + How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of exclude_tax or include_inclusive_tax. include_inclusive_tax will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. exclude_tax will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + """ + template: NotRequired[str] + """ + ID of the invoice rendering template to use for future invoices. + """ + + class UpdateParamsConfigurationCustomerCapabilities(TypedDict): + automatic_indirect_tax: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTax" + ] + """ + Generates requirements for enabling automatic indirect tax calculation on this customer's invoices or subscriptions. Recommended to request this capability if planning to enable automatic tax calculation on this customer's invoices or subscriptions. Uses the `location_source` field. + """ + + class UpdateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTax( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationCustomerShipping(TypedDict): + address: NotRequired[ + "AccountService.UpdateParamsConfigurationCustomerShippingAddress" + ] + """ + Customer shipping address. + """ + name: NotRequired[str] + """ + Customer name. + """ + phone: NotRequired[str] + """ + Customer phone (including extension). + """ + + class UpdateParamsConfigurationCustomerShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + + class UpdateParamsConfigurationMerchant(TypedDict): + bacs_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantBacsDebitPayments" + ] + """ + Settings used for Bacs debit payments. + """ + branding: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantBranding" + ] + """ + Settings used to apply the merchant's branding to email receipts, invoices, Checkout, and other products. + """ + capabilities: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilities" + ] + """ + Capabilities to request on the Merchant Configuration. + """ + card_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCardPayments" + ] + """ + Card payments settings. + """ + mcc: NotRequired[str] + """ + The merchant category code for the merchant. MCCs are used to classify businesses based on the goods or services they provide. + """ + statement_descriptor: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantStatementDescriptor" + ] + """ + Statement descriptor. + """ + support: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantSupport" + ] + """ + Publicly available contact information for sending support issues to. + """ + + class UpdateParamsConfigurationMerchantBacsDebitPayments(TypedDict): + display_name: NotRequired[str] + """ + Display name for Bacs debit payments. + """ + + class UpdateParamsConfigurationMerchantBranding(TypedDict): + icon: NotRequired[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): An icon for the merchant. Must be square and at least 128px x 128px. + """ + logo: NotRequired[str] + """ + ID of a [file upload](https://docs.stripe.com/api/persons/update#create_file): A logo for the merchant that will be used in Checkout instead of the icon and without the merchant's name next to it if provided. Must be at least 128px x 128px. + """ + primary_color: NotRequired[str] + """ + A CSS hex color value representing the primary branding color for the merchant. + """ + secondary_color: NotRequired[str] + """ + A CSS hex color value representing the secondary branding color for the merchant. + """ + + class UpdateParamsConfigurationMerchantCapabilities(TypedDict): + ach_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAchDebitPayments" + ] + """ + Allow the merchant to process ACH debit payments. + """ + acss_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAcssDebitPayments" + ] + """ + Allow the merchant to process ACSS debit payments. + """ + affirm_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAffirmPayments" + ] + """ + Allow the merchant to process Affirm payments. + """ + afterpay_clearpay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAfterpayClearpayPayments" + ] + """ + Allow the merchant to process Afterpay/Clearpay payments. + """ + alma_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAlmaPayments" + ] + """ + Allow the merchant to process Alma payments. + """ + amazon_pay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAmazonPayPayments" + ] + """ + Allow the merchant to process Amazon Pay payments. + """ + au_becs_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesAuBecsDebitPayments" + ] + """ + Allow the merchant to process Australian BECS Direct Debit payments. + """ + bacs_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesBacsDebitPayments" + ] + """ + Allow the merchant to process BACS Direct Debit payments. + """ + bancontact_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesBancontactPayments" + ] + """ + Allow the merchant to process Bancontact payments. + """ + blik_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesBlikPayments" + ] + """ + Allow the merchant to process BLIK payments. + """ + boleto_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesBoletoPayments" + ] + """ + Allow the merchant to process Boleto payments. + """ + card_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesCardPayments" + ] + """ + Allow the merchant to collect card payments. + """ + cartes_bancaires_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments" + ] + """ + Allow the merchant to process Cartes Bancaires payments. + """ + cashapp_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesCashappPayments" + ] + """ + Allow the merchant to process Cash App payments. + """ + eps_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesEpsPayments" + ] + """ + Allow the merchant to process EPS payments. + """ + fpx_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesFpxPayments" + ] + """ + Allow the merchant to process FPX payments. + """ + gb_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesGbBankTransferPayments" + ] + """ + Allow the merchant to process UK bank transfer payments. + """ + grabpay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesGrabpayPayments" + ] + """ + Allow the merchant to process GrabPay payments. + """ + ideal_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesIdealPayments" + ] + """ + Allow the merchant to process iDEAL payments. + """ + jcb_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesJcbPayments" + ] + """ + Allow the merchant to process JCB card payments. + """ + jp_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesJpBankTransferPayments" + ] + """ + Allow the merchant to process Japanese bank transfer payments. + """ + kakao_pay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesKakaoPayPayments" + ] + """ + Allow the merchant to process Kakao Pay payments. + """ + klarna_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesKlarnaPayments" + ] + """ + Allow the merchant to process Klarna payments. + """ + konbini_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesKonbiniPayments" + ] + """ + Allow the merchant to process Konbini convenience store payments. + """ + kr_card_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesKrCardPayments" + ] + """ + Allow the merchant to process Korean card payments. + """ + link_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesLinkPayments" + ] + """ + Allow the merchant to process Link payments. + """ + mobilepay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesMobilepayPayments" + ] + """ + Allow the merchant to process MobilePay payments. + """ + multibanco_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesMultibancoPayments" + ] + """ + Allow the merchant to process Multibanco payments. + """ + mx_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesMxBankTransferPayments" + ] + """ + Allow the merchant to process Mexican bank transfer payments. + """ + naver_pay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesNaverPayPayments" + ] + """ + Allow the merchant to process Naver Pay payments. + """ + oxxo_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesOxxoPayments" + ] + """ + Allow the merchant to process OXXO payments. + """ + p24_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesP24Payments" + ] + """ + Allow the merchant to process Przelewy24 (P24) payments. + """ + pay_by_bank_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesPayByBankPayments" + ] + """ + Allow the merchant to process Pay by Bank payments. + """ + payco_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesPaycoPayments" + ] + """ + Allow the merchant to process PAYCO payments. + """ + paynow_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesPaynowPayments" + ] + """ + Allow the merchant to process PayNow payments. + """ + promptpay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesPromptpayPayments" + ] + """ + Allow the merchant to process PromptPay payments. + """ + revolut_pay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesRevolutPayPayments" + ] + """ + Allow the merchant to process Revolut Pay payments. + """ + samsung_pay_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesSamsungPayPayments" + ] + """ + Allow the merchant to process Samsung Pay payments. + """ + sepa_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments" + ] + """ + Allow the merchant to process SEPA bank transfer payments. + """ + sepa_debit_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesSepaDebitPayments" + ] + """ + Allow the merchant to process SEPA Direct Debit payments. + """ + swish_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesSwishPayments" + ] + """ + Allow the merchant to process Swish payments. + """ + twint_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesTwintPayments" + ] + """ + Allow the merchant to process TWINT payments. + """ + us_bank_transfer_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesUsBankTransferPayments" + ] + """ + Allow the merchant to process US bank transfer payments. + """ + zip_payments: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCapabilitiesZipPayments" + ] + """ + Allow the merchant to process Zip payments. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAchDebitPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAcssDebitPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAffirmPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAfterpayClearpayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAlmaPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAmazonPayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesAuBecsDebitPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesBacsDebitPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesBancontactPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesBlikPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesBoletoPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesCardPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesCashappPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesEpsPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesFpxPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesGbBankTransferPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesGrabpayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesIdealPayments( + TypedDict + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesJcbPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesJpBankTransferPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesKakaoPayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesKlarnaPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesKonbiniPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesKrCardPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesLinkPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesMobilepayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesMultibancoPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesMxBankTransferPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesNaverPayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesOxxoPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesP24Payments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesPayByBankPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesPaycoPayments( + TypedDict + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesPaynowPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesPromptpayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesRevolutPayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesSamsungPayPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesSepaDebitPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesSwishPayments( + TypedDict + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesTwintPayments( + TypedDict + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesUsBankTransferPayments( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCapabilitiesZipPayments(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationMerchantCardPayments(TypedDict): + decline_on: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantCardPaymentsDeclineOn" + ] + """ + Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + """ + + class UpdateParamsConfigurationMerchantCardPaymentsDeclineOn(TypedDict): + avs_failure: NotRequired[bool] + """ + Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + """ + cvc_failure: NotRequired[bool] + """ + Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + """ + + class UpdateParamsConfigurationMerchantStatementDescriptor(TypedDict): + descriptor: NotRequired[str] + """ + The default text that appears on statements for non-card charges outside of Japan. For card charges, if you don't set a statement_descriptor_prefix, this text is also used as the statement descriptor prefix. In that case, if concatenating the statement descriptor suffix causes the combined statement descriptor to exceed 22 characters, we truncate the statement_descriptor text to limit the full descriptor to 22 characters. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + prefix: NotRequired[str] + """ + Default text that appears on statements for card charges outside of Japan, prefixing any dynamic statement_descriptor_suffix specified on the charge. To maximize space for the dynamic part of the descriptor, keep this text short. If you don't specify this value, statement_descriptor is used as the prefix. For more information about statement descriptors and their requirements, see the Merchant Configuration settings documentation. + """ + + class UpdateParamsConfigurationMerchantSupport(TypedDict): + address: NotRequired[ + "AccountService.UpdateParamsConfigurationMerchantSupportAddress" + ] + """ + A publicly available mailing address for sending support issues to. + """ + email: NotRequired[str] + """ + A publicly available email address for sending support issues to. + """ + phone: NotRequired[str] + """ + A publicly available phone number to call with support issues. + """ + url: NotRequired[str] + """ + A publicly available website for handling support issues. + """ + + class UpdateParamsConfigurationMerchantSupportAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsConfigurationRecipient(TypedDict): + capabilities: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilities" + ] + """ + Capabilities to request on the Recipient Configuration. + """ + default_outbound_destination: NotRequired[str] + """ + The payout method id to be used as a default outbound destination. This will allow the PayoutMethod to be omitted on OutboundPayments made through API or sending payouts via dashboard. Can also be explicitly set to `null` to clear the existing default outbound destination. + """ + + class UpdateParamsConfigurationRecipientCapabilities(TypedDict): + bank_accounts: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesBankAccounts" + ] + """ + Capabilities that enable OutboundPayments to a bank account linked to this Account. + """ + cards: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesCards" + ] + """ + Capability that enable OutboundPayments to a debit card linked to this Account. + """ + stripe_balance: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesStripeBalance" + ] + """ + Capabilities that enable the recipient to manage their Stripe Balance (/v1/balance). + """ + + class UpdateParamsConfigurationRecipientCapabilitiesBankAccounts( + TypedDict + ): + local: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesBankAccountsLocal" + ] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over local networks. + """ + wire: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesBankAccountsWire" + ] + """ + Enables this Account to receive OutboundPayments to linked bank accounts over wire. + """ + + class UpdateParamsConfigurationRecipientCapabilitiesBankAccountsLocal( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationRecipientCapabilitiesBankAccountsWire( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationRecipientCapabilitiesCards(TypedDict): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsConfigurationRecipientCapabilitiesStripeBalance( + TypedDict, + ): + stripe_transfers: NotRequired[ + "AccountService.UpdateParamsConfigurationRecipientCapabilitiesStripeBalanceStripeTransfers" + ] + """ + Allows the account to receive /v1/transfers into their Stripe Balance (/v1/balance). + """ + + class UpdateParamsConfigurationRecipientCapabilitiesStripeBalanceStripeTransfers( + TypedDict, + ): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class UpdateParamsDefaults(TypedDict): + currency: NotRequired[ + Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + ] + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + locales: NotRequired[ + List[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ] + ] + ] + """ + The Account's preferred locales (languages), ordered by preference. + """ + responsibilities: NotRequired[ + "AccountService.UpdateParamsDefaultsResponsibilities" + ] + """ + Default responsibilities held by either Stripe or the platform. + """ + + class UpdateParamsDefaultsResponsibilities(TypedDict): + fees_collector: Literal["application", "stripe"] + """ + A value indicating the party responsible for collecting fees from this account. + """ + losses_collector: Literal["application", "stripe"] + """ + A value indicating who is responsible for losses when this Account can't pay back negative balances from payments. + """ + + class UpdateParamsIdentity(TypedDict): + attestations: NotRequired[ + "AccountService.UpdateParamsIdentityAttestations" + ] + """ + Attestations from the identity's key people, e.g. owners, executives, directors. + """ + business_details: NotRequired[ + "AccountService.UpdateParamsIdentityBusinessDetails" + ] + """ + Information about the company or business. + """ + country: NotRequired[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. + """ + entity_type: NotRequired[ + Literal["company", "government_entity", "individual", "non_profit"] + ] + """ + The entity type. + """ + individual: NotRequired[ + "AccountService.UpdateParamsIdentityIndividual" + ] + """ + Information about the individual represented by the Account. This property is `null` unless `entity_type` is set to `individual`. + """ + + class UpdateParamsIdentityAttestations(TypedDict): + directorship_declaration: NotRequired[ + "AccountService.UpdateParamsIdentityAttestationsDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ + ownership_declaration: NotRequired[ + "AccountService.UpdateParamsIdentityAttestationsOwnershipDeclaration" + ] + """ + This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + """ + persons_provided: NotRequired[ + "AccountService.UpdateParamsIdentityAttestationsPersonsProvided" + ] + """ + Attestation that all Persons with a specific Relationship value have been provided. + """ + terms_of_service: NotRequired[ + "AccountService.UpdateParamsIdentityAttestationsTermsOfService" + ] + """ + Attestations of accepted terms of service agreements. + """ + + class UpdateParamsIdentityAttestationsDirectorshipDeclaration(TypedDict): + date: NotRequired[str] + """ + The time marking when the director attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the director attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the director attestation was made. + """ + + class UpdateParamsIdentityAttestationsOwnershipDeclaration(TypedDict): + date: NotRequired[str] + """ + The time marking when the beneficial owner attestation was made. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the beneficial owner attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the beneficial owner attestation was made. + """ + + class UpdateParamsIdentityAttestationsPersonsProvided(TypedDict): + directors: NotRequired[bool] + """ + Whether the company's directors have been provided. Set this Boolean to true after creating all the company's directors with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + executives: NotRequired[bool] + """ + Whether the company's executives have been provided. Set this Boolean to true after creating all the company's executives with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + owners: NotRequired[bool] + """ + Whether the company's owners have been provided. Set this Boolean to true after creating all the company's owners with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson). + """ + ownership_exemption_reason: NotRequired[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ] + ] + """ + Reason for why the company is exempt from providing ownership information. + """ + + class UpdateParamsIdentityAttestationsTermsOfService(TypedDict): + account: NotRequired[ + "AccountService.UpdateParamsIdentityAttestationsTermsOfServiceAccount" + ] + """ + Details on the Account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance). + """ + + class UpdateParamsIdentityAttestationsTermsOfServiceAccount(TypedDict): + date: NotRequired[str] + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + class UpdateParamsIdentityBusinessDetails(TypedDict): + address: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsAddress" + ] + ] + """ + The business registration address of the business entity. + """ + annual_revenue: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsAnnualRevenue" + ] + ] + """ + The business gross annual revenue for its preceding fiscal year. + """ + documents: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocuments" + ] + ] + """ + A document verifying the business. + """ + doing_business_as: NotRequired[Optional[str]] + """ + The name which is used by the business. + """ + estimated_worker_count: NotRequired[Optional[int]] + """ + An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + """ + id_numbers: NotRequired[ + Optional[ + List[ + "AccountService.UpdateParamsIdentityBusinessDetailsIdNumber" + ] + ] + ] + """ + The ID numbers of a business entity. + """ + monthly_estimated_revenue: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue" + ] + ] + """ + An estimate of the monthly revenue of the business. + """ + phone: NotRequired[Optional[str]] + """ + The phone number of the Business Entity. + """ + product_description: NotRequired[Optional[str]] + """ + Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + """ + registered_name: NotRequired[Optional[str]] + """ + The business legal name. + """ + script_addresses: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptAddresses" + ] + ] + """ + The business registration address of the business entity in non latin script. + """ + script_names: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptNames" + ] + ] + """ + The business legal name in non latin script. + """ + structure: NotRequired[ + Optional[ + Literal[ + "cooperative", + "free_zone_establishment", + "free_zone_llc", + "governmental_unit", + "government_instrumentality", + "incorporated_association", + "incorporated_non_profit", + "incorporated_partnership", + "limited_liability_partnership", + "llc", + "multi_member_llc", + "private_company", + "private_corporation", + "private_partnership", + "public_company", + "public_corporation", + "public_listed_corporation", + "public_partnership", + "registered_charity", + "single_member_llc", + "sole_establishment", + "sole_proprietorship", + "tax_exempt_government_instrumentality", + "trust", + "unincorporated_association", + "unincorporated_non_profit", + "unincorporated_partnership", + ] + ] + ] + """ + The category identifying the legal structure of the business. + """ + url: NotRequired[Optional[str]] + """ + The business's publicly available website. + """ + + class UpdateParamsIdentityBusinessDetailsAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): + amount: NotRequired[AmountParam] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + fiscal_year_end: NotRequired[Optional[str]] + """ + The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + """ + + class UpdateParamsIdentityBusinessDetailsDocuments(TypedDict): + bank_account_ownership_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification" + ] + ] + """ + One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + """ + company_license: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense" + ] + ] + """ + One or more documents that demonstrate proof of a company's license to operate. + """ + company_memorandum_of_association: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAssociation" + ] + ] + """ + One or more documents showing the company's Memorandum of Association. + """ + company_ministerial_decree: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecree" + ] + ] + """ + Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. + """ + company_registration_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVerification" + ] + ] + """ + One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + """ + company_tax_id_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerification" + ] + ] + """ + One or more documents that demonstrate proof of a company's tax ID. + """ + primary_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerification" + ] + ] + """ + A document verifying the business. + """ + proof_of_registration: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration" + ] + ] + """ + One or more documents showing the company's proof of registration with the national business registry. + """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense( + TypedDict + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAssociation( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecree( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerification( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( + TypedDict, + ): + front_back: "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[Optional[str]] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): + registrar: NotRequired[str] + """ + The registrar of the ID number (Only valid for DE ID number types). + """ + type: Literal[ + "ae_crn", + "ae_vat", + "at_fn", + "au_abn", + "au_acn", + "au_in", + "be_cbe", + "bg_uic", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cy_tic", + "cz_ico", + "de_hrn", + "de_vat", + "dk_cvr", + "ee_rk", + "es_cif", + "fi_yt", + "fr_siren", + "fr_vat", + "gb_crn", + "gi_crn", + "gr_gemi", + "hk_br", + "hk_cr", + "hk_mbs", + "hu_cjs", + "ie_crn", + "it_rea", + "it_vat", + "jp_cn", + "li_uid", + "lt_ccrn", + "lu_rcs", + "lv_urn", + "mt_crn", + "mx_rfc", + "my_brn", + "my_coid", + "my_sst", + "nl_kvk", + "no_orgnr", + "nz_bn", + "pl_regon", + "pt_vat", + "ro_cui", + "se_orgnr", + "sg_uen", + "si_msp", + "sk_ico", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ] + """ + Open Enum. The ID number type of a business entity. + """ + value: str + """ + The value of the ID number. + """ + + class UpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue( + TypedDict + ): + amount: NotRequired[AmountParam] + """ + A non-negative integer representing the amount in the smallest currency unit. + """ + + class UpdateParamsIdentityBusinessDetailsScriptAddresses(TypedDict): + kana: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptAddressesKana" + ] + ] + """ + Kana Address. + """ + kanji: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptAddressesKanji" + ] + ] + """ + Kanji Address. + """ + + class UpdateParamsIdentityBusinessDetailsScriptAddressesKana(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityBusinessDetailsScriptAddressesKanji(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityBusinessDetailsScriptNames(TypedDict): + kana: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptNamesKana" + ] + ] + """ + Kana name. + """ + kanji: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityBusinessDetailsScriptNamesKanji" + ] + ] + """ + Kanji name. + """ + + class UpdateParamsIdentityBusinessDetailsScriptNamesKana(TypedDict): + registered_name: NotRequired[Optional[str]] + """ + Registered name of the business. + """ + + class UpdateParamsIdentityBusinessDetailsScriptNamesKanji(TypedDict): + registered_name: NotRequired[Optional[str]] + """ + Registered name of the business. + """ + + class UpdateParamsIdentityIndividual(TypedDict): + additional_addresses: NotRequired[ + Optional[ + List[ + "AccountService.UpdateParamsIdentityIndividualAdditionalAddress" + ] + ] + ] + """ + Additional addresses associated with the individual. + """ + additional_names: NotRequired[ + Optional[ + List[ + "AccountService.UpdateParamsIdentityIndividualAdditionalName" + ] + ] + ] + """ + Additional names (e.g. aliases) associated with the individual. + """ + address: NotRequired[ + Optional["AccountService.UpdateParamsIdentityIndividualAddress"] + ] + """ + The individual's residential address. + """ + date_of_birth: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualDateOfBirth" + ] + ] + """ + The individual's date of birth. + """ + documents: NotRequired[ + Optional["AccountService.UpdateParamsIdentityIndividualDocuments"] + ] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: NotRequired[Optional[str]] + """ + The individual's email address. + """ + given_name: NotRequired[Optional[str]] + """ + The individual's first name. + """ + id_numbers: NotRequired[ + Optional[ + List["AccountService.UpdateParamsIdentityIndividualIdNumber"] + ] + ] + """ + The identification numbers (e.g., SSN) associated with the individual. + """ + legal_gender: NotRequired[Optional[Literal["female", "male"]]] + """ + The individual's gender (International regulations require either "male" or "female"). + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: NotRequired[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The countries where the individual is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + phone: NotRequired[Optional[str]] + """ + The individual's phone number. + """ + political_exposure: NotRequired[Optional[Literal["existing", "none"]]] + """ + The individual's political exposure. + """ + relationship: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualRelationship" + ] + ] + """ + The relationship that this individual has with the account's identity. + """ + script_addresses: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptAddresses" + ] + ] + """ + The script addresses (e.g., non-Latin characters) associated with the individual. + """ + script_names: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptNames" + ] + ] + """ + The individuals primary name in non latin script. + """ + surname: NotRequired[Optional[str]] + """ + The individual's last name. + """ + + class UpdateParamsIdentityIndividualAdditionalAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityIndividualAdditionalName(TypedDict): + full_name: NotRequired[str] + """ + The person's full name. + """ + given_name: NotRequired[str] + """ + The person's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class UpdateParamsIdentityIndividualAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityIndividualDateOfBirth(TypedDict): + day: int + """ + The day of the birth. + """ + month: int + """ + The month of birth. + """ + year: int + """ + The year of birth. + """ + + class UpdateParamsIdentityIndividualDocuments(TypedDict): + company_authorization: NotRequired[ + "AccountService.UpdateParamsIdentityIndividualDocumentsCompanyAuthorization" + ] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: NotRequired[ + "AccountService.UpdateParamsIdentityIndividualDocumentsPassport" + ] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualDocumentsPrimaryVerification" + ] + ] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualDocumentsSecondaryVerification" + ] + ] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: NotRequired[ + "AccountService.UpdateParamsIdentityIndividualDocumentsVisa" + ] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + + class UpdateParamsIdentityIndividualDocumentsCompanyAuthorization( + TypedDict, + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityIndividualDocumentsPassport(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityIndividualDocumentsPrimaryVerification( + TypedDict + ): + front_back: "AccountService.UpdateParamsIdentityIndividualDocumentsPrimaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class UpdateParamsIdentityIndividualDocumentsPrimaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[Optional[str]] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class UpdateParamsIdentityIndividualDocumentsSecondaryVerification( + TypedDict, + ): + front_back: "AccountService.UpdateParamsIdentityIndividualDocumentsSecondaryVerificationFrontBack" + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class UpdateParamsIdentityIndividualDocumentsSecondaryVerificationFrontBack( + TypedDict, + ): + back: NotRequired[Optional[str]] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class UpdateParamsIdentityIndividualDocumentsVisa(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdentityIndividualIdNumber(TypedDict): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + value: str + """ + The value of the ID number. + """ + + class UpdateParamsIdentityIndividualRelationship(TypedDict): + director: NotRequired[Optional[bool]] + """ + Whether the person is a director of the account's identity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: NotRequired[Optional[bool]] + """ + Whether the person has significant responsibility to control, manage, or direct the organization. + """ + owner: NotRequired[Optional[bool]] + """ + Whether the person is an owner of the account's identity. + """ + percent_ownership: NotRequired[Optional[str]] + """ + The percent owned by the person of the account's legal entity. + """ + title: NotRequired[Optional[str]] + """ + The person's title (e.g., CEO, Support Engineer). + """ + + class UpdateParamsIdentityIndividualScriptAddresses(TypedDict): + kana: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptAddressesKana" + ] + ] + """ + Kana Address. + """ + kanji: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptAddressesKanji" + ] + ] + """ + Kanji Address. + """ + + class UpdateParamsIdentityIndividualScriptAddressesKana(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityIndividualScriptAddressesKanji(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsIdentityIndividualScriptNames(TypedDict): + kana: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptNamesKana" + ] + ] + """ + Persons name in kana script. + """ + kanji: NotRequired[ + Optional[ + "AccountService.UpdateParamsIdentityIndividualScriptNamesKanji" + ] + ] + """ + Persons name in kanji script. + """ + + class UpdateParamsIdentityIndividualScriptNamesKana(TypedDict): + given_name: NotRequired[Optional[str]] + """ + The person's first or given name. + """ + surname: NotRequired[Optional[str]] + """ + The person's last or family name. + """ + + class UpdateParamsIdentityIndividualScriptNamesKanji(TypedDict): + given_name: NotRequired[Optional[str]] + """ + The person's first or given name. + """ + surname: NotRequired[Optional[str]] + """ + The person's last or family name. + """ + + def close( + self, + id: str, + params: "AccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Removes access to the Account and its associated resources. + """ + return cast( + Account, + self._request( + "post", + "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def close_async( + self, + id: str, + params: "AccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Removes access to the Account and its associated resources. + """ + return cast( + Account, + await self._request_async( + "post", + "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "AccountService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient. + """ + return cast( + Account, + self._request( + "post", + "/v2/core/accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "AccountService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient. + """ + return cast( + Account, + await self._request_async( + "post", + "/v2/core/accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "AccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Account]: + """ + Returns a list of Accounts. + """ + return cast( + ListObject[Account], + self._request( + "get", + "/v2/core/accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "AccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Account]: + """ + Returns a list of Accounts. + """ + return cast( + ListObject[Account], + await self._request_async( + "get", + "/v2/core/accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "AccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Retrieves the details of an Account. + """ + return cast( + Account, + self._request( + "get", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "AccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Retrieves the details of an Account. + """ + return cast( + Account, + await self._request_async( + "get", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "AccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Updates the details of an Account. + """ + return cast( + Account, + self._request( + "post", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "AccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Account: + """ + Updates the details of an Account. + """ + return cast( + Account, + await self._request_async( + "post", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_person.py b/stripe/v2/core/_person.py new file mode 100644 index 000000000..5369a8e09 --- /dev/null +++ b/stripe/v2/core/_person.py @@ -0,0 +1,1767 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class Person(StripeObject): + """ + Person retrieval response schema. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.account_person"]] = ( + "v2.core.account_person" + ) + + class AdditionalAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class AdditionalName(StripeObject): + full_name: Optional[str] + """ + The individual's full name. + """ + given_name: Optional[str] + """ + The individual's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: Optional[str] + """ + The individual's last or family name. + """ + + class AdditionalTermsOfService(StripeObject): + class Account(StripeObject): + date: Optional[str] + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: Optional[str] + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: Optional[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + account: Optional[Account] + """ + Stripe terms of service agreement. + """ + _inner_class_types = {"account": Account} + + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class DateOfBirth(StripeObject): + day: int + """ + The day of birth, between 1 and 31. + """ + month: int + """ + The month of birth, between 1 and 12. + """ + year: int + """ + The four-digit year of birth. + """ + + class Documents(StripeObject): + class CompanyAuthorization(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class Passport(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class PrimaryVerification(StripeObject): + class FrontBack(StripeObject): + back: Optional[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + front_back: FrontBack + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + _inner_class_types = {"front_back": FrontBack} + + class SecondaryVerification(StripeObject): + class FrontBack(StripeObject): + back: Optional[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + front_back: FrontBack + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + _inner_class_types = {"front_back": FrontBack} + + class Visa(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + company_authorization: Optional[CompanyAuthorization] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: Optional[Passport] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: Optional[PrimaryVerification] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: Optional[SecondaryVerification] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: Optional[Visa] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + _inner_class_types = { + "company_authorization": CompanyAuthorization, + "passport": Passport, + "primary_verification": PrimaryVerification, + "secondary_verification": SecondaryVerification, + "visa": Visa, + } + + class IdNumber(StripeObject): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + + class Relationship(StripeObject): + authorizer: Optional[bool] + """ + Whether the individual is an authorizer of the Account's legal entity. + """ + director: Optional[bool] + """ + Whether the individual is a director of the Account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + """ + executive: Optional[bool] + """ + Whether the individual has significant responsibility to control, manage, or direct the organization. + """ + legal_guardian: Optional[bool] + """ + Whether the individual is the legal guardian of the Account's representative. + """ + owner: Optional[bool] + """ + Whether the individual is an owner of the Account's legal entity. + """ + percent_ownership: Optional[str] + """ + The percent owned by the individual of the Account's legal entity. + """ + representative: Optional[bool] + """ + Whether the individual is authorized as the primary representative of the Account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + """ + title: Optional[str] + """ + The individual's title (e.g., CEO, Support Engineer). + """ + + class ScriptAddresses(StripeObject): + class Kana(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + class Kanji(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + """ + 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 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or cho-me. + """ + + kana: Optional[Kana] + """ + Kana Address. + """ + kanji: Optional[Kanji] + """ + Kanji Address. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + class ScriptNames(StripeObject): + class Kana(StripeObject): + given_name: Optional[str] + """ + The person's first or given name. + """ + surname: Optional[str] + """ + The person's last or family name. + """ + + class Kanji(StripeObject): + given_name: Optional[str] + """ + The person's first or given name. + """ + surname: Optional[str] + """ + The person's last or family name. + """ + + kana: Optional[Kana] + """ + Persons name in kana script. + """ + kanji: Optional[Kanji] + """ + Persons name in kanji script. + """ + _inner_class_types = {"kana": Kana, "kanji": Kanji} + + account: str + """ + The account ID which the individual belongs to. + """ + additional_addresses: Optional[List[AdditionalAddress]] + """ + Additional addresses associated with the person. + """ + additional_names: Optional[List[AdditionalName]] + """ + Additional names (e.g. aliases) associated with the person. + """ + additional_terms_of_service: Optional[AdditionalTermsOfService] + """ + Attestations of accepted terms of service agreements. + """ + address: Optional[Address] + """ + The person's residential address. + """ + created: str + """ + Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + date_of_birth: Optional[DateOfBirth] + """ + The person's date of birth. + """ + documents: Optional[Documents] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: Optional[str] + """ + The person's email address. + """ + given_name: Optional[str] + """ + The person's first name. + """ + id: str + """ + Unique identifier for the Person. + """ + id_numbers: Optional[List[IdNumber]] + """ + The identification numbers (e.g., SSN) associated with the person. + """ + legal_gender: Optional[Literal["female", "male"]] + """ + The person's gender (International regulations require either "male" or "female"). + """ + metadata: Optional[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: Optional[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The countries where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + object: Literal["v2.core.account_person"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + phone: Optional[str] + """ + The person's phone number. + """ + political_exposure: Optional[Literal["existing", "none"]] + """ + The person's political exposure. + """ + relationship: Optional[Relationship] + """ + The relationship that this person has with the Account's business or legal entity. + """ + script_addresses: Optional[ScriptAddresses] + """ + The script addresses (e.g., non-Latin characters) associated with the person. + """ + script_names: Optional[ScriptNames] + """ + The script names (e.g. non-Latin characters) associated with the person. + """ + surname: Optional[str] + """ + The person's last name. + """ + updated: str + """ + Time at which the object was last updated. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "additional_addresses": AdditionalAddress, + "additional_names": AdditionalName, + "additional_terms_of_service": AdditionalTermsOfService, + "address": Address, + "date_of_birth": DateOfBirth, + "documents": Documents, + "id_numbers": IdNumber, + "relationship": Relationship, + "script_addresses": ScriptAddresses, + "script_names": ScriptNames, + } diff --git a/stripe/v2/core/_vault_service.py b/stripe/v2/core/_vault_service.py new file mode 100644 index 000000000..279d8b8b7 --- /dev/null +++ b/stripe/v2/core/_vault_service.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe.v2.core.vault._gb_bank_account_service import GbBankAccountService +from stripe.v2.core.vault._us_bank_account_service import UsBankAccountService + + +class VaultService(StripeService): + def __init__(self, requestor): + super().__init__(requestor) + self.gb_bank_accounts = GbBankAccountService(self._requestor) + self.us_bank_accounts = UsBankAccountService(self._requestor) diff --git a/stripe/v2/core/accounts/__init__.py b/stripe/v2/core/accounts/__init__.py new file mode 100644 index 000000000..4ef30eabe --- /dev/null +++ b/stripe/v2/core/accounts/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core.accounts._person_service import ( + PersonService as PersonService, +) diff --git a/stripe/v2/core/accounts/_person_service.py b/stripe/v2/core/accounts/_person_service.py new file mode 100644 index 000000000..130750090 --- /dev/null +++ b/stripe/v2/core/accounts/_person_service.py @@ -0,0 +1,3725 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.core._person import Person +from typing import Dict, List, Optional, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PersonService(StripeService): + class CreateParams(TypedDict): + additional_addresses: NotRequired[ + List["PersonService.CreateParamsAdditionalAddress"] + ] + """ + Additional addresses associated with the person. + """ + additional_names: NotRequired[ + List["PersonService.CreateParamsAdditionalName"] + ] + """ + Additional names (e.g. aliases) associated with the person. + """ + additional_terms_of_service: NotRequired[ + "PersonService.CreateParamsAdditionalTermsOfService" + ] + """ + Attestations of accepted terms of service agreements. + """ + address: NotRequired["PersonService.CreateParamsAddress"] + """ + The person's residential address. + """ + date_of_birth: NotRequired["PersonService.CreateParamsDateOfBirth"] + """ + The person's date of birth. + """ + documents: NotRequired["PersonService.CreateParamsDocuments"] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: NotRequired[str] + """ + Email. + """ + given_name: NotRequired[str] + """ + The person's first name. + """ + id_numbers: NotRequired[List["PersonService.CreateParamsIdNumber"]] + """ + The identification numbers (e.g., SSN) associated with the person. + """ + legal_gender: NotRequired[Literal["female", "male"]] + """ + The person's gender (International regulations require either "male" or "female"). + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: NotRequired[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The nationalities (countries) this person is associated with. + """ + phone: NotRequired[str] + """ + The phone number for this person. + """ + political_exposure: NotRequired[Literal["existing", "none"]] + """ + The person's political exposure. + """ + relationship: NotRequired["PersonService.CreateParamsRelationship"] + """ + The relationship that this person has with the Account's business or legal entity. + """ + script_addresses: NotRequired[ + "PersonService.CreateParamsScriptAddresses" + ] + """ + The script addresses (e.g., non-Latin characters) associated with the person. + """ + script_names: NotRequired["PersonService.CreateParamsScriptNames"] + """ + The script names (e.g. non-Latin characters) associated with the person. + """ + surname: NotRequired[str] + """ + The person's last name. + """ + + class CreateParamsAdditionalAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsAdditionalName(TypedDict): + full_name: NotRequired[str] + """ + The person's full name. + """ + given_name: NotRequired[str] + """ + The person's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class CreateParamsAdditionalTermsOfService(TypedDict): + account: NotRequired[ + "PersonService.CreateParamsAdditionalTermsOfServiceAccount" + ] + """ + Stripe terms of service agreement. + """ + + class CreateParamsAdditionalTermsOfServiceAccount(TypedDict): + date: str + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: str + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + class CreateParamsAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsDateOfBirth(TypedDict): + day: int + """ + The day of birth. + """ + month: int + """ + The month of birth. + """ + year: int + """ + The year of birth. + """ + + class CreateParamsDocuments(TypedDict): + company_authorization: NotRequired[ + "PersonService.CreateParamsDocumentsCompanyAuthorization" + ] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: NotRequired["PersonService.CreateParamsDocumentsPassport"] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: NotRequired[ + "PersonService.CreateParamsDocumentsPrimaryVerification" + ] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: NotRequired[ + "PersonService.CreateParamsDocumentsSecondaryVerification" + ] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: NotRequired["PersonService.CreateParamsDocumentsVisa"] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + + class CreateParamsDocumentsCompanyAuthorization(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsDocumentsPassport(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsDocumentsPrimaryVerification(TypedDict): + front_back: ( + "PersonService.CreateParamsDocumentsPrimaryVerificationFrontBack" + ) + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class CreateParamsDocumentsPrimaryVerificationFrontBack(TypedDict): + back: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class CreateParamsDocumentsSecondaryVerification(TypedDict): + front_back: ( + "PersonService.CreateParamsDocumentsSecondaryVerificationFrontBack" + ) + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class CreateParamsDocumentsSecondaryVerificationFrontBack(TypedDict): + back: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: str + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class CreateParamsDocumentsVisa(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class CreateParamsIdNumber(TypedDict): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + value: str + """ + The value of the ID number. + """ + + class CreateParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the individual is an authorizer of the Account's legal entity. + """ + director: NotRequired[bool] + """ + Indicates whether the person is a director of the associated legal entity. + """ + executive: NotRequired[bool] + """ + Indicates whether the person is an executive of the associated legal entity. + """ + legal_guardian: NotRequired[bool] + """ + Indicates whether the person is a legal guardian of the associated legal entity. + """ + owner: NotRequired[bool] + """ + Indicates whether the person is an owner of the associated legal entity. + """ + percent_ownership: NotRequired[str] + """ + The percentage of ownership the person has in the associated legal entity. + """ + representative: NotRequired[bool] + """ + Indicates whether the person is a representative of the associated legal entity. + """ + title: NotRequired[str] + """ + The title or position the person holds in the associated legal entity. + """ + + class CreateParamsScriptAddresses(TypedDict): + kana: NotRequired["PersonService.CreateParamsScriptAddressesKana"] + """ + Kana Address. + """ + kanji: NotRequired["PersonService.CreateParamsScriptAddressesKanji"] + """ + Kanji Address. + """ + + class CreateParamsScriptAddressesKana(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsScriptAddressesKanji(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or cho-me. + """ + + class CreateParamsScriptNames(TypedDict): + kana: NotRequired["PersonService.CreateParamsScriptNamesKana"] + """ + Persons name in kana script. + """ + kanji: NotRequired["PersonService.CreateParamsScriptNamesKanji"] + """ + Persons name in kanji script. + """ + + class CreateParamsScriptNamesKana(TypedDict): + given_name: NotRequired[str] + """ + The person's first or given name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class CreateParamsScriptNamesKanji(TypedDict): + given_name: NotRequired[str] + """ + The person's first or given name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class DeleteParams(TypedDict): + pass + + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The upper limit on the number of accounts returned by the List Account request. + """ + + class RetrieveParams(TypedDict): + pass + + class UpdateParams(TypedDict): + additional_addresses: NotRequired[ + List["PersonService.UpdateParamsAdditionalAddress"] + ] + """ + Additional addresses associated with the person. + """ + additional_names: NotRequired[ + List["PersonService.UpdateParamsAdditionalName"] + ] + """ + Additional names (e.g. aliases) associated with the person. + """ + additional_terms_of_service: NotRequired[ + "PersonService.UpdateParamsAdditionalTermsOfService" + ] + """ + Attestations of accepted terms of service agreements. + """ + address: NotRequired["PersonService.UpdateParamsAddress"] + """ + The primary address associated with the person. + """ + date_of_birth: NotRequired["PersonService.UpdateParamsDateOfBirth"] + """ + The person's date of birth. + """ + documents: NotRequired["PersonService.UpdateParamsDocuments"] + """ + Documents that may be submitted to satisfy various informational requests. + """ + email: NotRequired[str] + """ + Email. + """ + given_name: NotRequired[str] + """ + The person's first name. + """ + id_numbers: NotRequired[List["PersonService.UpdateParamsIdNumber"]] + """ + The identification numbers (e.g., SSN) associated with the person. + """ + legal_gender: NotRequired[Literal["female", "male"]] + """ + The person's gender (International regulations require either "male" or "female"). + """ + metadata: NotRequired[Dict[str, Optional[str]]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + nationalities: NotRequired[ + List[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + The nationalities (countries) this person is associated with. + """ + phone: NotRequired[str] + """ + The phone number for this person. + """ + political_exposure: NotRequired[Literal["existing", "none"]] + """ + The person's political exposure. + """ + relationship: NotRequired["PersonService.UpdateParamsRelationship"] + """ + The relationship that this person has with the Account's business or legal entity. + """ + script_addresses: NotRequired[ + Optional["PersonService.UpdateParamsScriptAddresses"] + ] + """ + The script addresses (e.g., non-Latin characters) associated with the person. + """ + script_names: NotRequired[ + Optional["PersonService.UpdateParamsScriptNames"] + ] + """ + The script names (e.g. non-Latin characters) associated with the person. + """ + surname: NotRequired[str] + """ + The person's last name. + """ + + class UpdateParamsAdditionalAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + purpose: Literal["registered"] + """ + Purpose of additional address. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsAdditionalName(TypedDict): + full_name: NotRequired[str] + """ + The person's full name. + """ + given_name: NotRequired[str] + """ + The person's first or given name. + """ + purpose: Literal["alias", "maiden"] + """ + The purpose or type of the additional name. + """ + surname: NotRequired[str] + """ + The person's last or family name. + """ + + class UpdateParamsAdditionalTermsOfService(TypedDict): + account: NotRequired[ + "PersonService.UpdateParamsAdditionalTermsOfServiceAccount" + ] + """ + Stripe terms of service agreement. + """ + + class UpdateParamsAdditionalTermsOfServiceAccount(TypedDict): + date: NotRequired[str] + """ + The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + ip: NotRequired[str] + """ + The IP address from which the Account's representative accepted the terms of service. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the Account's representative accepted the terms of service. + """ + + class UpdateParamsAddress(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsDateOfBirth(TypedDict): + day: int + """ + The day of the birth. + """ + month: int + """ + The month of birth. + """ + year: int + """ + The year of birth. + """ + + class UpdateParamsDocuments(TypedDict): + company_authorization: NotRequired[ + "PersonService.UpdateParamsDocumentsCompanyAuthorization" + ] + """ + One or more documents that demonstrate proof that this person is authorized to represent the company. + """ + passport: NotRequired["PersonService.UpdateParamsDocumentsPassport"] + """ + One or more documents showing the person's passport page with photo and personal data. + """ + primary_verification: NotRequired[ + Optional["PersonService.UpdateParamsDocumentsPrimaryVerification"] + ] + """ + An identifying document showing the person's name, either a passport or local ID card. + """ + secondary_verification: NotRequired[ + Optional[ + "PersonService.UpdateParamsDocumentsSecondaryVerification" + ] + ] + """ + A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + """ + visa: NotRequired["PersonService.UpdateParamsDocumentsVisa"] + """ + One or more documents showing the person's visa required for living in the country where they are residing. + """ + + class UpdateParamsDocumentsCompanyAuthorization(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsDocumentsPassport(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsDocumentsPrimaryVerification(TypedDict): + front_back: ( + "PersonService.UpdateParamsDocumentsPrimaryVerificationFrontBack" + ) + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class UpdateParamsDocumentsPrimaryVerificationFrontBack(TypedDict): + back: NotRequired[Optional[str]] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class UpdateParamsDocumentsSecondaryVerification(TypedDict): + front_back: ( + "PersonService.UpdateParamsDocumentsSecondaryVerificationFrontBack" + ) + """ + The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. + """ + type: Literal["front_back"] + """ + The format of the verification document. Currently supports `front_back` only. + """ + + class UpdateParamsDocumentsSecondaryVerificationFrontBack(TypedDict): + back: NotRequired[Optional[str]] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + front: NotRequired[str] + """ + A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + """ + + class UpdateParamsDocumentsVisa(TypedDict): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + + class UpdateParamsIdNumber(TypedDict): + type: Literal[ + "ae_eid", + "br_cpf", + "de_stn", + "hk_id", + "mx_rfc", + "my_nric", + "nl_bsn", + "sg_fin", + "sg_nric", + "th_lc", + "th_pin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + ] + """ + The ID number type of an individual. + """ + value: str + """ + The value of the ID number. + """ + + class UpdateParamsRelationship(TypedDict): + authorizer: NotRequired[bool] + """ + Whether the individual is an authorizer of the Account's legal entity. + """ + director: NotRequired[bool] + """ + Indicates whether the person is a director of the associated legal entity. + """ + executive: NotRequired[bool] + """ + Indicates whether the person is an executive of the associated legal entity. + """ + legal_guardian: NotRequired[bool] + """ + Indicates whether the person is a legal guardian of the associated legal entity. + """ + owner: NotRequired[bool] + """ + Indicates whether the person is an owner of the associated legal entity. + """ + percent_ownership: NotRequired[str] + """ + The percentage of ownership the person has in the associated legal entity. + """ + representative: NotRequired[bool] + """ + Indicates whether the person is a representative of the associated legal entity. + """ + title: NotRequired[str] + """ + The title or position the person holds in the associated legal entity. + """ + + class UpdateParamsScriptAddresses(TypedDict): + kana: NotRequired[ + Optional["PersonService.UpdateParamsScriptAddressesKana"] + ] + """ + Kana Address. + """ + kanji: NotRequired[ + Optional["PersonService.UpdateParamsScriptAddressesKanji"] + ] + """ + Kanji Address. + """ + + class UpdateParamsScriptAddressesKana(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsScriptAddressesKanji(TypedDict): + city: NotRequired[Optional[str]] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[ + Optional[ + Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + ] + ] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[Optional[str]] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[Optional[str]] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[Optional[str]] + """ + ZIP or postal code. + """ + state: NotRequired[Optional[str]] + """ + State, county, province, or region. + """ + town: NotRequired[Optional[str]] + """ + Town or cho-me. + """ + + class UpdateParamsScriptNames(TypedDict): + kana: NotRequired[ + Optional["PersonService.UpdateParamsScriptNamesKana"] + ] + """ + Persons name in kana script. + """ + kanji: NotRequired[ + Optional["PersonService.UpdateParamsScriptNamesKanji"] + ] + """ + Persons name in kanji script. + """ + + class UpdateParamsScriptNamesKana(TypedDict): + given_name: NotRequired[Optional[str]] + """ + The person's first or given name. + """ + surname: NotRequired[Optional[str]] + """ + The person's last or family name. + """ + + class UpdateParamsScriptNamesKanji(TypedDict): + given_name: NotRequired[Optional[str]] + """ + The person's first or given name. + """ + surname: NotRequired[Optional[str]] + """ + The person's last or family name. + """ + + def create( + self, + account_id: str, + params: "PersonService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Create a Person associated with an Account. + """ + return cast( + Person, + self._request( + "post", + "/v2/core/accounts/{account_id}/persons".format( + account_id=sanitize_id(account_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + account_id: str, + params: "PersonService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Create a Person associated with an Account. + """ + return cast( + Person, + await self._request_async( + "post", + "/v2/core/accounts/{account_id}/persons".format( + account_id=sanitize_id(account_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def delete( + self, + account_id: str, + id: str, + params: "PersonService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Delete a Person associated with an Account. + """ + return cast( + Person, + self._request( + "delete", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def delete_async( + self, + account_id: str, + id: str, + params: "PersonService.DeleteParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Delete a Person associated with an Account. + """ + return cast( + Person, + await self._request_async( + "delete", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + account_id: str, + params: "PersonService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Person]: + """ + Returns a list of Persons associated with an Account. + """ + return cast( + ListObject[Person], + self._request( + "get", + "/v2/core/accounts/{account_id}/persons".format( + account_id=sanitize_id(account_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + account_id: str, + params: "PersonService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Person]: + """ + Returns a list of Persons associated with an Account. + """ + return cast( + ListObject[Person], + await self._request_async( + "get", + "/v2/core/accounts/{account_id}/persons".format( + account_id=sanitize_id(account_id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + account_id: str, + id: str, + params: "PersonService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Retrieves a Person associated with an Account. + """ + return cast( + Person, + self._request( + "get", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + account_id: str, + id: str, + params: "PersonService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Retrieves a Person associated with an Account. + """ + return cast( + Person, + await self._request_async( + "get", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + account_id: str, + id: str, + params: "PersonService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Updates a Person associated with an Account. + """ + return cast( + Person, + self._request( + "post", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + account_id: str, + id: str, + params: "PersonService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> Person: + """ + Updates a Person associated with an Account. + """ + return cast( + Person, + await self._request_async( + "post", + "/v2/core/accounts/{account_id}/persons/{id}".format( + account_id=sanitize_id(account_id), + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/vault/__init__.py b/stripe/v2/core/vault/__init__.py new file mode 100644 index 000000000..6cb1aa747 --- /dev/null +++ b/stripe/v2/core/vault/__init__.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core.vault._gb_bank_account import ( + GbBankAccount as GbBankAccount, +) +from stripe.v2.core.vault._gb_bank_account_service import ( + GbBankAccountService as GbBankAccountService, +) +from stripe.v2.core.vault._us_bank_account import ( + UsBankAccount as UsBankAccount, +) +from stripe.v2.core.vault._us_bank_account_service import ( + UsBankAccountService as UsBankAccountService, +) diff --git a/stripe/v2/core/vault/_gb_bank_account.py b/stripe/v2/core/vault/_gb_bank_account.py new file mode 100644 index 000000000..7cf9c147e --- /dev/null +++ b/stripe/v2/core/vault/_gb_bank_account.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class GbBankAccount(StripeObject): + """ + Use the GBBankAccounts API to create and manage GB bank account objects + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.vault.gb_bank_account"]] = ( + "v2.core.vault.gb_bank_account" + ) + + class ConfirmationOfPayee(StripeObject): + class Result(StripeObject): + class Matched(StripeObject): + business_type: Optional[Literal["business", "personal"]] + """ + The business type given by the bank for this account, in case of a MATCH or PARTIAL_MATCH. + Closed enum. + """ + name: Optional[str] + """ + The name given by the bank for this account, in case of a MATCH or PARTIAL_MATCH. + """ + + class Provided(StripeObject): + business_type: Literal["business", "personal"] + """ + The provided or Legal Entity business type to match against the CoP service. Closed enum. + """ + name: str + """ + The provided or Legal Entity name to match against the CoP service. + """ + + created: str + """ + When the CoP result was created. + """ + match_result: Literal[ + "match", "mismatch", "partial_match", "unavailable" + ] + """ + Whether or not the information of the bank account matches what you have provided. Closed enum. + """ + matched: Matched + """ + The fields that CoP service matched against. Only has value if MATCH or PARTIAL_MATCH, empty otherwise. + """ + message: str + """ + Human-readable message describing the match result. + """ + provided: Provided + """ + The fields that are matched against what the network has on file. + """ + _inner_class_types = {"matched": Matched, "provided": Provided} + + result: Result + """ + The result of the Confirmation of Payee check, once the check has been initiated. Closed enum. + """ + status: Literal["awaiting_acknowledgement", "confirmed", "uninitiated"] + """ + The current state of Confirmation of Payee on this bank account. Closed enum. + """ + _inner_class_types = {"result": Result} + + archived: bool + """ + Whether this bank account object was archived. Bank account objects can be archived through + the /archive API, and they will not be automatically archived by Stripe. Archived bank account objects + cannot be used as outbound destinations and will not appear in the outbound destination list. + """ + bank_account_type: Literal["checking", "savings"] + """ + Closed Enum. The type of the bank account (checking or savings). + """ + bank_name: str + """ + The name of the bank. + """ + confirmation_of_payee: ConfirmationOfPayee + """ + Information around the status of Confirmation of Payee matching done on this bank account. + Confirmation of Payee is a name matching service that must be done before making OutboundPayments in the UK. + """ + created: str + """ + Creation time. + """ + id: str + """ + The ID of the GBBankAccount object. + """ + last4: str + """ + The last 4 digits of the account number or IBAN. + """ + object: Literal["v2.core.vault.gb_bank_account"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + sort_code: str + """ + The Sort Code of the bank account. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"confirmation_of_payee": ConfirmationOfPayee} diff --git a/stripe/v2/core/vault/_gb_bank_account_service.py b/stripe/v2/core/vault/_gb_bank_account_service.py new file mode 100644 index 000000000..2203da0ff --- /dev/null +++ b/stripe/v2/core/vault/_gb_bank_account_service.py @@ -0,0 +1,294 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2.core.vault._gb_bank_account import GbBankAccount +from typing import cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class GbBankAccountService(StripeService): + class AcknowledgeConfirmationOfPayeeParams(TypedDict): + pass + + class ArchiveParams(TypedDict): + pass + + class CreateParams(TypedDict): + account_number: str + """ + The Account Number of the bank account. + """ + bank_account_type: NotRequired[Literal["checking", "savings"]] + """ + Closed Enum. The type of the bank account (checking or savings). + """ + confirmation_of_payee: NotRequired[ + "GbBankAccountService.CreateParamsConfirmationOfPayee" + ] + """ + Whether or not to automatically perform Confirmation of Payee to verify the users information + against what was provided by the bank. Doing so is required for all bank accounts not owned + by you before making domestic UK OutboundPayments. + """ + sort_code: str + """ + The Sort Code of the bank account. + """ + + class CreateParamsConfirmationOfPayee(TypedDict): + business_type: NotRequired[Literal["business", "personal"]] + """ + The business type to be checked against. Legal entity information will be used if unspecified. + Closed enum. + """ + initiate: bool + """ + User specifies whether Confirmation of Payee is automatically initiated when creating the bank account. + """ + name: NotRequired[str] + """ + The name to be checked against. Legal entity information will be used if unspecified. + """ + + class InitiateConfirmationOfPayeeParams(TypedDict): + business_type: NotRequired[Literal["business", "personal"]] + """ + The business type to be checked against. Legal entity information will be used if unspecified. + """ + name: NotRequired[str] + """ + The name of the user to be checked against. Legal entity information will be used if unspecified. + """ + + class RetrieveParams(TypedDict): + pass + + def acknowledge_confirmation_of_payee( + self, + id: str, + params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with + proceeding to pay out to this bank account despite the account not matching, partially matching, or the service + being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to + funds being sent to the wrong account, which we might not be able to recover. + """ + return cast( + GbBankAccount, + self._request( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def acknowledge_confirmation_of_payee_async( + self, + id: str, + params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with + proceeding to pay out to this bank account despite the account not matching, partially matching, or the service + being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to + funds being sent to the wrong account, which we might not be able to recover. + """ + return cast( + GbBankAccount, + await self._request_async( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def archive( + self, + id: str, + params: "GbBankAccountService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. + """ + return cast( + GbBankAccount, + self._request( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def archive_async( + self, + id: str, + params: "GbBankAccountService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. + """ + return cast( + GbBankAccount, + await self._request_async( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "GbBankAccountService.CreateParams", + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Create a GB bank account. + """ + return cast( + GbBankAccount, + self._request( + "post", + "/v2/core/vault/gb_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "GbBankAccountService.CreateParams", + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Create a GB bank account. + """ + return cast( + GbBankAccount, + await self._request_async( + "post", + "/v2/core/vault/gb_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def initiate_confirmation_of_payee( + self, + id: str, + params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches + who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If + the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee + is required before sending funds. + """ + return cast( + GbBankAccount, + self._request( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def initiate_confirmation_of_payee_async( + self, + id: str, + params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches + who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If + the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee + is required before sending funds. + """ + return cast( + GbBankAccount, + await self._request_async( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "GbBankAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Retrieve a GB bank account. + """ + return cast( + GbBankAccount, + self._request( + "get", + "/v2/core/vault/gb_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "GbBankAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> GbBankAccount: + """ + Retrieve a GB bank account. + """ + return cast( + GbBankAccount, + await self._request_async( + "get", + "/v2/core/vault/gb_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/vault/_us_bank_account.py b/stripe/v2/core/vault/_us_bank_account.py new file mode 100644 index 000000000..bd92361f4 --- /dev/null +++ b/stripe/v2/core/vault/_us_bank_account.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class UsBankAccount(StripeObject): + """ + Use the USBankAccounts API to create and manage US bank accounts objects that you can use to receive funds. Note that these are not interchangeable with v1 Tokens. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.vault.us_bank_account"]] = ( + "v2.core.vault.us_bank_account" + ) + archived: bool + """ + Whether this USBankAccount object was archived. + """ + bank_account_type: Literal["checking", "savings"] + """ + Closed Enum. The type of bank account (checking or savings). + """ + bank_name: str + """ + The name of the bank this bank account belongs to. This field is populated automatically by Stripe based on the routing number. + """ + created: str + """ + Creation time of the object. + """ + fedwire_routing_number: Optional[str] + """ + The fedwire routing number of the bank account. + """ + id: str + """ + The ID of the USBankAccount object. + """ + last4: str + """ + The last 4 digits of the account number. + """ + object: Literal["v2.core.vault.us_bank_account"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + routing_number: Optional[str] + """ + The ACH routing number of the bank account. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ diff --git a/stripe/v2/core/vault/_us_bank_account_service.py b/stripe/v2/core/vault/_us_bank_account_service.py new file mode 100644 index 000000000..e2848141e --- /dev/null +++ b/stripe/v2/core/vault/_us_bank_account_service.py @@ -0,0 +1,218 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2.core.vault._us_bank_account import UsBankAccount +from typing import cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class UsBankAccountService(StripeService): + class ArchiveParams(TypedDict): + pass + + class CreateParams(TypedDict): + account_number: str + """ + The account number of the bank account. + """ + bank_account_type: NotRequired[Literal["checking", "savings"]] + """ + Closed Enum. The type of the bank account (checking or savings). + """ + fedwire_routing_number: NotRequired[str] + """ + The fedwire routing number of the bank account. Note that certain banks have the same ACH and wire routing number. + """ + routing_number: NotRequired[str] + """ + The ACH routing number of the bank account. Note that certain banks have the same ACH and wire routing number. + """ + + class RetrieveParams(TypedDict): + pass + + class UpdateParams(TypedDict): + fedwire_routing_number: NotRequired[str] + """ + The bank account's fedwire routing number can be provided for update it was were empty previously. + """ + routing_number: NotRequired[str] + """ + The bank account's ACH routing number can be provided for update if it was empty previously. + """ + + def archive( + self, + id: str, + params: "UsBankAccountService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. + Archived USBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. + """ + return cast( + UsBankAccount, + self._request( + "post", + "/v2/core/vault/us_bank_accounts/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def archive_async( + self, + id: str, + params: "UsBankAccountService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. + Archived USBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. + """ + return cast( + UsBankAccount, + await self._request_async( + "post", + "/v2/core/vault/us_bank_accounts/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "UsBankAccountService.CreateParams", + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Create a USBankAccount object. + """ + return cast( + UsBankAccount, + self._request( + "post", + "/v2/core/vault/us_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "UsBankAccountService.CreateParams", + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Create a USBankAccount object. + """ + return cast( + UsBankAccount, + await self._request_async( + "post", + "/v2/core/vault/us_bank_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "UsBankAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Retrieve a USBankAccount object. + """ + return cast( + UsBankAccount, + self._request( + "get", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "UsBankAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Retrieve a USBankAccount object. + """ + return cast( + UsBankAccount, + await self._request_async( + "get", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "UsBankAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. + """ + return cast( + UsBankAccount, + self._request( + "post", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "UsBankAccountService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> UsBankAccount: + """ + Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. + """ + return cast( + UsBankAccount, + await self._request_async( + "post", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/__init__.py b/stripe/v2/money_management/__init__.py new file mode 100644 index 000000000..c8dc37f39 --- /dev/null +++ b/stripe/v2/money_management/__init__.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.money_management._adjustment import Adjustment as Adjustment +from stripe.v2.money_management._adjustment_service import ( + AdjustmentService as AdjustmentService, +) +from stripe.v2.money_management._financial_account import ( + FinancialAccount as FinancialAccount, +) +from stripe.v2.money_management._financial_account_service import ( + FinancialAccountService as FinancialAccountService, +) +from stripe.v2.money_management._financial_address import ( + FinancialAddress as FinancialAddress, +) +from stripe.v2.money_management._financial_address_service import ( + FinancialAddressService as FinancialAddressService, +) +from stripe.v2.money_management._inbound_transfer import ( + InboundTransfer as InboundTransfer, +) +from stripe.v2.money_management._inbound_transfer_service import ( + InboundTransferService as InboundTransferService, +) +from stripe.v2.money_management._outbound_payment import ( + OutboundPayment as OutboundPayment, +) +from stripe.v2.money_management._outbound_payment_quote import ( + OutboundPaymentQuote as OutboundPaymentQuote, +) +from stripe.v2.money_management._outbound_payment_quote_service import ( + OutboundPaymentQuoteService as OutboundPaymentQuoteService, +) +from stripe.v2.money_management._outbound_payment_service import ( + OutboundPaymentService as OutboundPaymentService, +) +from stripe.v2.money_management._outbound_setup_intent import ( + OutboundSetupIntent as OutboundSetupIntent, +) +from stripe.v2.money_management._outbound_setup_intent_service import ( + OutboundSetupIntentService as OutboundSetupIntentService, +) +from stripe.v2.money_management._outbound_transfer import ( + OutboundTransfer as OutboundTransfer, +) +from stripe.v2.money_management._outbound_transfer_service import ( + OutboundTransferService as OutboundTransferService, +) +from stripe.v2.money_management._payout_method import ( + PayoutMethod as PayoutMethod, +) +from stripe.v2.money_management._payout_method_service import ( + PayoutMethodService as PayoutMethodService, +) +from stripe.v2.money_management._payout_methods_bank_account_spec import ( + PayoutMethodsBankAccountSpec as PayoutMethodsBankAccountSpec, +) +from stripe.v2.money_management._payout_methods_bank_account_spec_service import ( + PayoutMethodsBankAccountSpecService as PayoutMethodsBankAccountSpecService, +) +from stripe.v2.money_management._received_credit import ( + ReceivedCredit as ReceivedCredit, +) +from stripe.v2.money_management._received_credit_service import ( + ReceivedCreditService as ReceivedCreditService, +) +from stripe.v2.money_management._received_debit import ( + ReceivedDebit as ReceivedDebit, +) +from stripe.v2.money_management._received_debit_service import ( + ReceivedDebitService as ReceivedDebitService, +) +from stripe.v2.money_management._transaction import Transaction as Transaction +from stripe.v2.money_management._transaction_entry import ( + TransactionEntry as TransactionEntry, +) +from stripe.v2.money_management._transaction_entry_service import ( + TransactionEntryService as TransactionEntryService, +) +from stripe.v2.money_management._transaction_service import ( + TransactionService as TransactionService, +) diff --git a/stripe/v2/money_management/_adjustment.py b/stripe/v2/money_management/_adjustment.py new file mode 100644 index 000000000..0cc7c72fe --- /dev/null +++ b/stripe/v2/money_management/_adjustment.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class Adjustment(StripeObject): + """ + Adjustments represent Stripe-initiated credits or debits to a user balance. They might be used to amend balances due to technical or operational error. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.adjustment"]] = ( + "v2.money_management.adjustment" + ) + + class AdjustedFlow(StripeObject): + type: Literal[ + "adjustment", + "balance_exchange", + "inbound_payment", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Closed Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. + """ + adjustment: Optional[str] + """ + If applicable, the ID of the Adjustment linked to this Adjustment. + """ + inbound_transfer: Optional[str] + """ + If applicable, the ID of the InboundTransfer linked to this Adjustment. + """ + outbound_payment: Optional[str] + """ + If applicable, the ID of the OutboundPayment linked to this Adjustment. + """ + outbound_transfer: Optional[str] + """ + If applicable, the ID of the OutboundTransfer linked to this Adjustment. + """ + received_credit: Optional[str] + """ + If applicable, the ID of the ReceivedCredit linked to this Adjustment. + """ + received_debit: Optional[str] + """ + If applicable, the ID of the ReceivedDebit linked to this Adjustment. + """ + + adjusted_flow: Optional[AdjustedFlow] + """ + If applicable, contains information about the original flow linked to this Adjustment. + """ + amount: Amount + """ + The amount of the Adjustment. + """ + created: str + """ + Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + description: Optional[str] + """ + Description of the Adjustment and what it was used for. + """ + financial_account: str + """ + The FinancialAccount that this adjustment is for. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["v2.money_management.adjustment"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + receipt_url: Optional[str] + """ + A link to the Stripe-hosted receipt that is provided when money movement is considered regulated under Stripe's money transmission licenses. The receipt link remains active for 60 days from the Adjustment creation date. After this period, the link will expire and the receipt url value will be null. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"adjusted_flow": AdjustedFlow} diff --git a/stripe/v2/money_management/_adjustment_service.py b/stripe/v2/money_management/_adjustment_service.py new file mode 100644 index 000000000..02ef10921 --- /dev/null +++ b/stripe/v2/money_management/_adjustment_service.py @@ -0,0 +1,131 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._adjustment import Adjustment +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class AdjustmentService(StripeService): + class ListParams(TypedDict): + adjusted_flow: NotRequired[str] + """ + Filter for Adjustments linked to a Flow. + """ + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "AdjustmentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Adjustment]: + """ + Returns a list of Adjustments that match the provided filters. + """ + return cast( + ListObject[Adjustment], + self._request( + "get", + "/v2/money_management/adjustments", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "AdjustmentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Adjustment]: + """ + Returns a list of Adjustments that match the provided filters. + """ + return cast( + ListObject[Adjustment], + await self._request_async( + "get", + "/v2/money_management/adjustments", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "AdjustmentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Adjustment: + """ + Retrieves the details of an Adjustment by ID. + """ + return cast( + Adjustment, + self._request( + "get", + "/v2/money_management/adjustments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "AdjustmentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Adjustment: + """ + Retrieves the details of an Adjustment by ID. + """ + return cast( + Adjustment, + await self._request_async( + "get", + "/v2/money_management/adjustments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py new file mode 100644 index 000000000..6068ef690 --- /dev/null +++ b/stripe/v2/money_management/_financial_account.py @@ -0,0 +1,524 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class FinancialAccount(StripeObject): + """ + The Financial Account is the container that allows for the configuration of money movement. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.financial_account"]] = ( + "v2.money_management.financial_account" + ) + + class Balance(StripeObject): + available: Dict[str, Amount] + """ + Balance that can be used for money movement. + """ + inbound_pending: Dict[str, Amount] + """ + Balance of inbound funds that will later transition to the `cash` balance. + """ + outbound_pending: Dict[str, Amount] + """ + Balance of funds that are being used for a pending outbound money movement. + """ + + class Other(StripeObject): + type: str + """ + The type of the FinancialAccount, represented as a string. Upgrade your API version to see the type reflected in `financial_account.type`. + """ + + class Storage(StripeObject): + holds_currencies: List[ + Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + ] + """ + The currencies that this FinancialAccount can hold. + """ + + balance: Balance + """ + Multi-currency balance of this FinancialAccount, split by availability state. Each balance is represented as a hash where the key is the three-letter ISO currency code, in lowercase, and the value is the amount for that currency. + """ + country: Literal[ + "ad", + "ae", + "af", + "ag", + "ai", + "al", + "am", + "ao", + "aq", + "ar", + "as", + "at", + "au", + "aw", + "ax", + "az", + "ba", + "bb", + "bd", + "be", + "bf", + "bg", + "bh", + "bi", + "bj", + "bl", + "bm", + "bn", + "bo", + "bq", + "br", + "bs", + "bt", + "bv", + "bw", + "by", + "bz", + "ca", + "cc", + "cd", + "cf", + "cg", + "ch", + "ci", + "ck", + "cl", + "cm", + "cn", + "co", + "cr", + "cu", + "cv", + "cw", + "cx", + "cy", + "cz", + "de", + "dj", + "dk", + "dm", + "do", + "dz", + "ec", + "ee", + "eg", + "eh", + "er", + "es", + "et", + "fi", + "fj", + "fk", + "fm", + "fo", + "fr", + "ga", + "gb", + "gd", + "ge", + "gf", + "gg", + "gh", + "gi", + "gl", + "gm", + "gn", + "gp", + "gq", + "gr", + "gs", + "gt", + "gu", + "gw", + "gy", + "hk", + "hm", + "hn", + "hr", + "ht", + "hu", + "id", + "ie", + "il", + "im", + "in", + "io", + "iq", + "ir", + "is", + "it", + "je", + "jm", + "jo", + "jp", + "ke", + "kg", + "kh", + "ki", + "km", + "kn", + "kp", + "kr", + "kw", + "ky", + "kz", + "la", + "lb", + "lc", + "li", + "lk", + "lr", + "ls", + "lt", + "lu", + "lv", + "ly", + "ma", + "mc", + "md", + "me", + "mf", + "mg", + "mh", + "mk", + "ml", + "mm", + "mn", + "mo", + "mp", + "mq", + "mr", + "ms", + "mt", + "mu", + "mv", + "mw", + "mx", + "my", + "mz", + "na", + "nc", + "ne", + "nf", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nu", + "nz", + "om", + "pa", + "pe", + "pf", + "pg", + "ph", + "pk", + "pl", + "pm", + "pn", + "pr", + "ps", + "pt", + "pw", + "py", + "qa", + "qz", + "re", + "ro", + "rs", + "ru", + "rw", + "sa", + "sb", + "sc", + "sd", + "se", + "sg", + "sh", + "si", + "sj", + "sk", + "sl", + "sm", + "sn", + "so", + "sr", + "ss", + "st", + "sv", + "sx", + "sy", + "sz", + "tc", + "td", + "tf", + "tg", + "th", + "tj", + "tk", + "tl", + "tm", + "tn", + "to", + "tr", + "tt", + "tv", + "tw", + "tz", + "ua", + "ug", + "um", + "us", + "uy", + "uz", + "va", + "vc", + "ve", + "vg", + "vi", + "vn", + "vu", + "wf", + "ws", + "ye", + "yt", + "za", + "zm", + "zw", + ] + """ + Open Enum. Two-letter country code that represents the country where the LegalEntity associated with the FinancialAccount is based in. + """ + created: str + """ + Time at which the object was created. + """ + description: Optional[str] + id: str + """ + Unique identifier for the object. + """ + object: Literal["v2.money_management.financial_account"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + other: Optional[Other] + """ + If this is a `other` FinancialAccount, this hash indicates what the actual type is. Upgrade your API version to see it reflected in `type`. + """ + status: Literal["closed", "open"] + """ + Closed Enum. An enum representing the status of the FinancialAccount. This indicates whether or not the FinancialAccount can be used for any money movement flows. + """ + storage: Optional[Storage] + """ + If this is a `storage` FinancialAccount, this hash includes details specific to `storage` FinancialAccounts. + """ + type: Literal["other", "storage"] + """ + Type of the FinancialAccount. An additional hash is included on the FinancialAccount with a name matching this value. + It contains additional information specific to the FinancialAccount type. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "balance": Balance, + "other": Other, + "storage": Storage, + } diff --git a/stripe/v2/money_management/_financial_account_service.py b/stripe/v2/money_management/_financial_account_service.py new file mode 100644 index 000000000..01175db66 --- /dev/null +++ b/stripe/v2/money_management/_financial_account_service.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._financial_account import FinancialAccount +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class FinancialAccountService(StripeService): + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "FinancialAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancialAccount]: + """ + Lists FinancialAccounts in this compartment. + """ + return cast( + ListObject[FinancialAccount], + self._request( + "get", + "/v2/money_management/financial_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FinancialAccountService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancialAccount]: + """ + Lists FinancialAccounts in this compartment. + """ + return cast( + ListObject[FinancialAccount], + await self._request_async( + "get", + "/v2/money_management/financial_accounts", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "FinancialAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Retrieves the details of an existing FinancialAccount. + """ + return cast( + FinancialAccount, + self._request( + "get", + "/v2/money_management/financial_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "FinancialAccountService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Retrieves the details of an existing FinancialAccount. + """ + return cast( + FinancialAccount, + await self._request_async( + "get", + "/v2/money_management/financial_accounts/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_financial_address.py b/stripe/v2/money_management/_financial_address.py new file mode 100644 index 000000000..420d945dc --- /dev/null +++ b/stripe/v2/money_management/_financial_address.py @@ -0,0 +1,292 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class FinancialAddress(StripeObject): + """ + A FinancialAddress contains information needed to transfer money to a Financial Account. A Financial Account can have more than one Financial Address. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.financial_address"]] = ( + "v2.money_management.financial_address" + ) + + class Credentials(StripeObject): + class GbBankAccount(StripeObject): + account_holder_name: str + """ + The account holder name to be used during bank transference. + """ + account_number: Optional[str] + """ + The account number of the UK Bank Account. + """ + last4: str + """ + The last four digits of the UK Bank Account number. This will always be returned. + To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. + """ + sort_code: str + """ + The sort code of the UK Bank Account. + """ + + class UsBankAccount(StripeObject): + account_number: Optional[str] + """ + The account number of the US Bank Account. + """ + bank_name: Optional[str] + """ + The name of the Bank. + """ + last4: str + """ + The last four digits of the US Bank Account number. This will always be returned. + To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. + """ + routing_number: str + """ + The routing number of the US Bank Account. + """ + swift_code: Optional[str] + """ + The swift code of the bank or financial institution. + """ + + type: Literal["gb_bank_account", "us_bank_account"] + """ + Open Enum. The type of Credentials that are provisioned for the FinancialAddress. + """ + gb_bank_account: Optional[GbBankAccount] + """ + The credentials of the UK Bank Account for the FinancialAddress. This contains unique banking details such as the sort code, account number, etc. of a UK bank account. + """ + us_bank_account: Optional[UsBankAccount] + """ + The credentials of the US Bank Account for the FinancialAddress. This contains unique banking details such as the routing number, account number, etc. of a US bank account. + """ + _inner_class_types = { + "gb_bank_account": GbBankAccount, + "us_bank_account": UsBankAccount, + } + + created: str + """ + The creation timestamp of the FinancialAddress. + """ + credentials: Optional[Credentials] + """ + Object indicates the type of credentials that have been allocated and attached to the FinancialAddress. + It contains all necessary banking details with which to perform money movements with the FinancialAddress. + This field is only available for FinancialAddresses with an active status. + """ + currency: Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + """ + Open Enum. The currency the FinancialAddress supports. + """ + financial_account: str + """ + A ID of the FinancialAccount this FinancialAddress corresponds to. + """ + id: str + """ + The ID of a FinancialAddress. + """ + object: Literal["v2.money_management.financial_address"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["active", "archived", "failed", "pending"] + """ + Closed Enum. An enum representing the status of the FinancialAddress. This indicates whether or not the FinancialAddress can be used for any money movement flows. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"credentials": Credentials} diff --git a/stripe/v2/money_management/_financial_address_service.py b/stripe/v2/money_management/_financial_address_service.py new file mode 100644 index 000000000..5c3f74d54 --- /dev/null +++ b/stripe/v2/money_management/_financial_address_service.py @@ -0,0 +1,356 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._financial_address import FinancialAddress +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class FinancialAddressService(StripeService): + class CreateParams(TypedDict): + currency: Literal[ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bhd", + "bif", + "bmd", + "bnd", + "bob", + "bov", + "brl", + "bsd", + "btn", + "bwp", + "byn", + "byr", + "bzd", + "cad", + "cdf", + "che", + "chf", + "chw", + "clf", + "clp", + "cny", + "cop", + "cou", + "crc", + "cuc", + "cup", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "ern", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "ghc", + "ghs", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "iqd", + "irr", + "isk", + "jmd", + "jod", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "kpw", + "krw", + "kwd", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "lyd", + "mad", + "mdl", + "mga", + "mkd", + "mmk", + "mnt", + "mop", + "mro", + "mru", + "mur", + "mvr", + "mwk", + "mxn", + "mxv", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "omr", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sdg", + "sek", + "sgd", + "shp", + "sle", + "sll", + "sos", + "srd", + "ssp", + "std", + "stn", + "svc", + "syp", + "szl", + "thb", + "tjs", + "tmt", + "tnd", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "usdb", + "usdc", + "usn", + "uyi", + "uyu", + "uzs", + "vef", + "ves", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xcg", + "xof", + "xpf", + "yer", + "zar", + "zmk", + "zmw", + "zwd", + "zwg", + "zwl", + ] + """ + Open Enum. The currency the FinancialAddress should support. Currently, only the `usd` and `gbp` values are supported. + """ + financial_account: str + """ + The ID of the FinancialAccount the new FinancialAddress should be associated with. + """ + + class ListParams(TypedDict): + financial_account: NotRequired[str] + """ + The ID of the FinancialAccount for which FinancialAddresses are to be returned. + """ + include: NotRequired[ + List[ + Literal[ + "credentials.gb_bank_account.account_number", + "credentials.us_bank_account.account_number", + ] + ] + ] + """ + Open Enum. A list of fields to reveal in the FinancialAddresses returned. + """ + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + include: NotRequired[ + List[ + Literal[ + "credentials.gb_bank_account.account_number", + "credentials.us_bank_account.account_number", + ] + ] + ] + """ + Open Enum. A list of fields to reveal in the FinancialAddresses returned. + """ + + def create( + self, + params: "FinancialAddressService.CreateParams", + options: RequestOptions = {}, + ) -> FinancialAddress: + """ + Create a new FinancialAddress for a FinancialAccount. + """ + return cast( + FinancialAddress, + self._request( + "post", + "/v2/money_management/financial_addresses", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "FinancialAddressService.CreateParams", + options: RequestOptions = {}, + ) -> FinancialAddress: + """ + Create a new FinancialAddress for a FinancialAccount. + """ + return cast( + FinancialAddress, + await self._request_async( + "post", + "/v2/money_management/financial_addresses", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "FinancialAddressService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancialAddress]: + """ + List all FinancialAddresses for a FinancialAccount. + """ + return cast( + ListObject[FinancialAddress], + self._request( + "get", + "/v2/money_management/financial_addresses", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "FinancialAddressService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[FinancialAddress]: + """ + List all FinancialAddresses for a FinancialAccount. + """ + return cast( + ListObject[FinancialAddress], + await self._request_async( + "get", + "/v2/money_management/financial_addresses", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "FinancialAddressService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAddress: + """ + Retrieve a FinancialAddress. By default, the FinancialAddress will be returned in its unexpanded state, revealing only the last 4 digits of the account number. + """ + return cast( + FinancialAddress, + self._request( + "get", + "/v2/money_management/financial_addresses/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "FinancialAddressService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAddress: + """ + Retrieve a FinancialAddress. By default, the FinancialAddress will be returned in its unexpanded state, revealing only the last 4 digits of the account number. + """ + return cast( + FinancialAddress, + await self._request_async( + "get", + "/v2/money_management/financial_addresses/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py new file mode 100644 index 000000000..5704cc52a --- /dev/null +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class InboundTransfer(StripeObject): + """ + An InboundTransfer object, representing a money movement from a + user owned PaymentMethod to a FinancialAccount belonging to the same user. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.inbound_transfer"]] = ( + "v2.money_management.inbound_transfer" + ) + + class From(StripeObject): + class PaymentMethod(StripeObject): + type: str + """ + The type of object this destination represents. For a us bank account, we expect us_bank_account. + """ + us_bank_account: Optional[str] + """ + The destination US bank account identifier. eg "usba_***". + """ + + debited: Amount + """ + The amount in specified currency that was debited from the Payment Method. + """ + payment_method: PaymentMethod + """ + The Payment Method object used to create the InboundTransfer. + """ + _inner_class_types = {"payment_method": PaymentMethod} + + class To(StripeObject): + credited: Amount + """ + The amount by which the FinancialAccount balance is credited. + """ + financial_account: str + """ + The FinancialAccount that funds will land in. + """ + + class TransferHistory(StripeObject): + class BankDebitFailed(StripeObject): + failure_reason: Literal[ + "bank_account_closed", + "bank_account_not_found", + "bank_debit_could_not_be_processed", + "bank_debit_not_authorized", + "insufficient_funds", + ] + """ + Open Enum. The return reason for the failed InboundTransfer. + """ + + class BankDebitProcessing(StripeObject): + pass + + class BankDebitQueued(StripeObject): + pass + + class BankDebitReturned(StripeObject): + return_reason: Literal[ + "bank_account_closed", + "bank_account_not_found", + "bank_debit_could_not_be_processed", + "bank_debit_not_authorized", + "insufficient_funds", + ] + """ + Open Enum. The return reason for the returned InboundTransfer. + """ + + class BankDebitSucceeded(StripeObject): + pass + + created: str + """ + Creation time of the HistoryEntry in RFC 3339 format and UTC. + """ + effective_at: str + """ + Effective at time of the HistoryEntry in RFC 3339 format and UTC. + """ + id: str + """ + A unique ID for the HistoryEntry. + """ + level: Literal["canonical", "debug"] + """ + Open Enum. The Level of the HistoryEntry. + """ + type: Literal[ + "bank_debit_failed", + "bank_debit_processing", + "bank_debit_queued", + "bank_debit_returned", + "bank_debit_succeeded", + ] + """ + Open Enum. The type of the HistoryEntry. + """ + bank_debit_failed: Optional[BankDebitFailed] + """ + The history entry for a failed InboundTransfer. + """ + bank_debit_processing: Optional[BankDebitProcessing] + """ + The history entry for a processing InboundTransfer. + """ + bank_debit_queued: Optional[BankDebitQueued] + """ + The history entry for a queued InboundTransfer. + """ + bank_debit_returned: Optional[BankDebitReturned] + """ + The history entry for a returned InboundTransfer. + """ + bank_debit_succeeded: Optional[BankDebitSucceeded] + """ + The history entry for a succeeded InboundTransfer. + """ + _inner_class_types = { + "bank_debit_failed": BankDebitFailed, + "bank_debit_processing": BankDebitProcessing, + "bank_debit_queued": BankDebitQueued, + "bank_debit_returned": BankDebitReturned, + "bank_debit_succeeded": BankDebitSucceeded, + } + + amount: Amount + """ + The amount in specified currency that will land in the FinancialAccount balance. + """ + created: str + """ + Creation time of the InboundTransfer. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + description: str + """ + A freeform text field provided by user, containing metadata. + """ + from_: From + """ + A nested object containing information about the origin of the InboundTransfer. + """ + id: str + """ + Unique identifier for the InboundTransfer. + """ + object: Literal["v2.money_management.inbound_transfer"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + receipt_url: Optional[str] + """ + A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + """ + to: To + """ + A nested object containing information about the destination of the InboundTransfer. + """ + transfer_history: List[TransferHistory] + """ + A list of history objects, representing changes in the state of the InboundTransfer. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "from": From, + "to": To, + "transfer_history": TransferHistory, + } + _field_remappings = {"from_": "from"} diff --git a/stripe/v2/money_management/_inbound_transfer_service.py b/stripe/v2/money_management/_inbound_transfer_service.py new file mode 100644 index 000000000..39fd3d4f2 --- /dev/null +++ b/stripe/v2/money_management/_inbound_transfer_service.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._inbound_transfer import InboundTransfer +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class InboundTransferService(StripeService): + _CreateParamsBase = TypedDict( + "CreateParams", + {"from": "InboundTransferService.CreateParamsFrom"}, + ) + + class CreateParams(_CreateParamsBase): + amount: AmountParam + """ + The amount, in specified currency, by which the FinancialAccount balance will increase due to the InboundTransfer. + """ + description: NotRequired[str] + """ + An optional, freeform description field intended to store metadata. + """ + to: "InboundTransferService.CreateParamsTo" + """ + Object containing details about where the funds will land. + """ + + class CreateParamsFrom(TypedDict): + currency: NotRequired[str] + """ + An optional currency field used to specify which currency is debited from the Payment Method. + Since many Payment Methods support only one currency, this field is optional. + """ + payment_method: str + """ + ID of the Payment Method using which IBT will be made. + """ + + class CreateParamsTo(TypedDict): + currency: str + """ + The currency in which funds will land in. + """ + financial_account: str + """ + The FinancialAccount that funds will land in. + """ + + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def create( + self, + params: "InboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + InboundTransfers APIs are used to create, retrieve or list InboundTransfers. + """ + return cast( + InboundTransfer, + self._request( + "post", + "/v2/money_management/inbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "InboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + InboundTransfers APIs are used to create, retrieve or list InboundTransfers. + """ + return cast( + InboundTransfer, + await self._request_async( + "post", + "/v2/money_management/inbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "InboundTransferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InboundTransfer]: + """ + Retrieves a list of InboundTransfers. + """ + return cast( + ListObject[InboundTransfer], + self._request( + "get", + "/v2/money_management/inbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "InboundTransferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[InboundTransfer]: + """ + Retrieves a list of InboundTransfers. + """ + return cast( + ListObject[InboundTransfer], + await self._request_async( + "get", + "/v2/money_management/inbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "InboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Retrieve an InboundTransfer by ID. + """ + return cast( + InboundTransfer, + self._request( + "get", + "/v2/money_management/inbound_transfers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "InboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> InboundTransfer: + """ + Retrieve an InboundTransfer by ID. + """ + return cast( + InboundTransfer, + await self._request_async( + "get", + "/v2/money_management/inbound_transfers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py new file mode 100644 index 000000000..3a2656e48 --- /dev/null +++ b/stripe/v2/money_management/_outbound_payment.py @@ -0,0 +1,226 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, Optional +from typing_extensions import Literal + + +class OutboundPayment(StripeObject): + """ + OutboundPayment represents a single money movement from one FinancialAccount you own to a payout method someone else owns. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.outbound_payment"]] = ( + "v2.money_management.outbound_payment" + ) + + class DeliveryOptions(StripeObject): + bank_account: Optional[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class From(StripeObject): + debited: Amount + """ + The monetary amount debited from the sender, only set on responses. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class RecipientNotification(StripeObject): + setting: Literal["configured", "none"] + """ + Closed Enum. Configuration option to enable or disable notifications to recipients. + Do not send notifications when setting is NONE. Default to account setting when setting is CONFIGURED or not set. + """ + + class StatusDetails(StripeObject): + class Failed(StripeObject): + reason: Literal[ + "payout_method_declined", + "payout_method_does_not_exist", + "payout_method_expired", + "payout_method_unsupported", + "payout_method_usage_frequency_limit_exceeded", + "unknown_failure", + ] + """ + Open Enum. The `failed` status reason. + """ + + class Returned(StripeObject): + reason: Literal[ + "payout_method_canceled_by_customer", + "payout_method_closed", + "payout_method_currency_unsupported", + "payout_method_does_not_exist", + "payout_method_holder_address_incorrect", + "payout_method_holder_details_incorrect", + "payout_method_holder_name_incorrect", + "payout_method_invalid_account_number", + "payout_method_restricted", + "recalled", + "unknown_failure", + ] + """ + Open Enum. The `returned` status reason. + """ + + failed: Optional[Failed] + """ + The `failed` status reason. + """ + returned: Optional[Returned] + """ + The `returned` status reason. + """ + _inner_class_types = {"failed": Failed, "returned": Returned} + + class StatusTransitions(StripeObject): + canceled_at: Optional[str] + """ + Timestamp describing when an OutboundPayment changed status to `canceled`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + failed_at: Optional[str] + """ + Timestamp describing when an OutboundPayment changed status to `failed`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + posted_at: Optional[str] + """ + Timestamp describing when an OutboundPayment changed status to `posted`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + returned_at: Optional[str] + """ + Timestamp describing when an OutboundPayment changed status to `returned`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + + class To(StripeObject): + credited: Amount + """ + The monetary amount being credited to the destination. + """ + payout_method: str + """ + The payout method which the OutboundPayment uses to send payout. + """ + recipient: str + """ + To which account the OutboundPayment is sent. + """ + + class TraceId(StripeObject): + status: Literal["pending", "supported", "unsupported"] + """ + Possible values are `pending`, `supported`, and `unsupported`. Initially set to `pending`, it changes to + `supported` when the recipient bank provides a trace ID, or `unsupported` if the recipient bank doesn't support it. + Note that this status may not align with the OutboundPayment or OutboundTransfer status and can remain `pending` + even after the payment or transfer is posted. + """ + value: Optional[str] + """ + The trace ID value if `trace_id.status` is `supported`, otherwise empty. + """ + + amount: Amount + """ + The "presentment amount" for the OutboundPayment. + """ + cancelable: bool + """ + Returns true if the OutboundPayment can be canceled, and false otherwise. + """ + created: str + """ + Time at which the OutboundPayment was created. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + delivery_options: Optional[DeliveryOptions] + """ + Delivery options to be used to send the OutboundPayment. + """ + description: Optional[str] + """ + An arbitrary string attached to the OutboundPayment. Often useful for displaying to users. + """ + expected_arrival_date: Optional[str] + """ + The date when funds are expected to arrive in the payout method. This field is not set if the payout method is in a `failed`, `canceled`, or `returned` state. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + from_: From + """ + The FinancialAccount that funds were pulled from. + """ + id: str + """ + Unique identifier for the OutboundPayment. + """ + metadata: Optional[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["v2.money_management.outbound_payment"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + outbound_payment_quote: Optional[str] + """ + The quote for this OutboundPayment. Only required for countries with regulatory mandates to display fee estimates before OutboundPayment creation. + """ + receipt_url: Optional[str] + """ + A link to the Stripe-hosted receipt for this OutboundPayment. The receipt link remains active for 60 days from the OutboundPayment creation date. After this period, the link will expire and the receipt url value will be null. + """ + recipient_notification: RecipientNotification + """ + Details about the OutboundPayment notification settings for recipient. + """ + statement_descriptor: str + """ + The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + """ + status: Literal["canceled", "failed", "posted", "processing", "returned"] + """ + Closed Enum. Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. + An OutboundPayment is `processing` if it has been created and is processing. + The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + If an OutboundPayment fails to arrive at its payout method, its status will change to `returned`. + """ + status_details: Optional[StatusDetails] + """ + Status details for an OutboundPayment in a `failed` or `returned` state. + """ + status_transitions: Optional[StatusTransitions] + """ + Hash containing timestamps of when the object transitioned to a particular status. + """ + to: To + """ + To which payout method the OutboundPayment was sent. + """ + trace_id: TraceId + """ + A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks might call this a “reference number” or something similar. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "delivery_options": DeliveryOptions, + "from": From, + "recipient_notification": RecipientNotification, + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + "to": To, + "trace_id": TraceId, + } + _field_remappings = {"from_": "from"} diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py new file mode 100644 index 000000000..66a9dd4c7 --- /dev/null +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, List, Optional +from typing_extensions import Literal + + +class OutboundPaymentQuote(StripeObject): + """ + OutboundPaymentQuote represents a quote + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.money_management.outbound_payment_quote"] + ] = "v2.money_management.outbound_payment_quote" + + class DeliveryOptions(StripeObject): + bank_account: Optional[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class EstimatedFee(StripeObject): + amount: Amount + """ + The fee amount for corresponding fee type. + """ + type: Literal[ + "cross_border_payout_fee", + "foreign_exchange_fee", + "instant_payout_fee", + "standard_payout_fee", + "wire_payout_fee", + ] + """ + The fee type. + """ + + class From(StripeObject): + debited: Amount + """ + The monetary amount debited from the sender, only set on responses. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class FxQuote(StripeObject): + class Rates(StripeObject): + exchange_rate: str + """ + The exchange rate going from_currency -> to_currency. + """ + + lock_duration: Literal["five_minutes"] + """ + The duration the exchange rate lock remains valid from creation time. Allowed value is five_minutes. + """ + lock_expires_at: str + """ + Time at which the rate lock will expire, measured in seconds since the Unix epoch. + """ + lock_status: Literal["active", "expired"] + """ + Lock status of the quote. Transitions from active to expired once past the lock_expires_at timestamp. Value can be active or expired. + """ + rates: Dict[str, Rates] + """ + Key pair: from currency Value: exchange rate going from_currency -> to_currency. + """ + to_currency: str + """ + The currency that the transaction is exchanging to. + """ + _inner_class_types = {"rates": Rates} + _inner_class_dicts = ["rates"] + + class To(StripeObject): + credited: Amount + """ + The monetary amount being credited to the destination. + """ + payout_method: str + """ + The payout method which the OutboundPayment uses to send payout. + """ + recipient: str + """ + To which account the OutboundPayment is sent. + """ + + amount: Amount + """ + The "presentment amount" for the OutboundPaymentQuote. + """ + created: str + """ + Time at which the OutboundPaymentQuote was created. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + delivery_options: Optional[DeliveryOptions] + """ + Delivery options to be used to send the OutboundPayment. + """ + estimated_fees: List[EstimatedFee] + """ + The estimated fees for the OutboundPaymentQuote. + """ + from_: From + """ + Details about the sender of an OutboundPaymentQuote. + """ + fx_quote: FxQuote + """ + The underlying FXQuote details for the OutboundPaymentQuote. + """ + id: str + """ + Unique identifier for the OutboundPaymentQuote. + """ + object: Literal["v2.money_management.outbound_payment_quote"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + to: To + """ + Details about the recipient of an OutboundPaymentQuote. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "delivery_options": DeliveryOptions, + "estimated_fees": EstimatedFee, + "from": From, + "fx_quote": FxQuote, + "to": To, + } + _field_remappings = {"from_": "from"} diff --git a/stripe/v2/money_management/_outbound_payment_quote_service.py b/stripe/v2/money_management/_outbound_payment_quote_service.py new file mode 100644 index 000000000..0f67e9399 --- /dev/null +++ b/stripe/v2/money_management/_outbound_payment_quote_service.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2.money_management._outbound_payment_quote import ( + OutboundPaymentQuote, +) +from typing import cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OutboundPaymentQuoteService(StripeService): + _CreateParamsBase = TypedDict( + "CreateParams", + {"from": "OutboundPaymentQuoteService.CreateParamsFrom"}, + ) + + class CreateParams(_CreateParamsBase): + amount: AmountParam + """ + The "presentment amount" to be sent to the recipient. + """ + delivery_options: NotRequired[ + "OutboundPaymentQuoteService.CreateParamsDeliveryOptions" + ] + """ + Method to be used to send the OutboundPayment. + """ + to: "OutboundPaymentQuoteService.CreateParamsTo" + """ + Request details about the recipient of an OutboundPaymentQuote. + """ + + class CreateParamsDeliveryOptions(TypedDict): + bank_account: NotRequired[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class CreateParamsFrom(TypedDict): + currency: str + """ + Describes the FinancialAccount's currency drawn from. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class CreateParamsTo(TypedDict): + currency: NotRequired[str] + """ + Describes the currency to send to the recipient. + If included, this currency must match a currency supported by the destination. + Can be omitted in the following cases: + - destination only supports one currency + - destination supports multiple currencies and one of the currencies matches the FA currency + - destination supports multiple currencies and one of the currencies matches the presentment currency + Note - when both FA currency and presentment currency are supported, we pick the FA currency to minimize FX. + """ + payout_method: NotRequired[str] + """ + The payout method which the OutboundPayment uses to send payout. + """ + recipient: str + """ + To which account the OutboundPayment is sent. + """ + + class RetrieveParams(TypedDict): + pass + + def create( + self, + params: "OutboundPaymentQuoteService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundPaymentQuote: + """ + Creates an OutboundPaymentQuote usable in an OutboundPayment. + """ + return cast( + OutboundPaymentQuote, + self._request( + "post", + "/v2/money_management/outbound_payment_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "OutboundPaymentQuoteService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundPaymentQuote: + """ + Creates an OutboundPaymentQuote usable in an OutboundPayment. + """ + return cast( + OutboundPaymentQuote, + await self._request_async( + "post", + "/v2/money_management/outbound_payment_quotes", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OutboundPaymentQuoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPaymentQuote: + """ + Retrieves the details of an existing OutboundPaymentQuote by passing the unique OutboundPaymentQuote ID. + """ + return cast( + OutboundPaymentQuote, + self._request( + "get", + "/v2/money_management/outbound_payment_quotes/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OutboundPaymentQuoteService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPaymentQuote: + """ + Retrieves the details of an existing OutboundPaymentQuote by passing the unique OutboundPaymentQuote ID. + """ + return cast( + OutboundPaymentQuote, + await self._request_async( + "get", + "/v2/money_management/outbound_payment_quotes/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_outbound_payment_service.py b/stripe/v2/money_management/_outbound_payment_service.py new file mode 100644 index 000000000..4b4d4f5ee --- /dev/null +++ b/stripe/v2/money_management/_outbound_payment_service.py @@ -0,0 +1,309 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._outbound_payment import OutboundPayment +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OutboundPaymentService(StripeService): + class CancelParams(TypedDict): + pass + + _CreateParamsBase = TypedDict( + "CreateParams", + {"from": "OutboundPaymentService.CreateParamsFrom"}, + ) + + class CreateParams(_CreateParamsBase): + amount: AmountParam + """ + The "presentment amount" to be sent to the recipient. + """ + delivery_options: NotRequired[ + "OutboundPaymentService.CreateParamsDeliveryOptions" + ] + """ + Delivery options to be used to send the OutboundPayment. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the OutboundPayment. Often useful for displaying to users. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + outbound_payment_quote: NotRequired[str] + """ + The quote for this OutboundPayment. Only required for countries with regulatory mandates to display fee estimates before OutboundPayment creation. + """ + recipient_notification: NotRequired[ + "OutboundPaymentService.CreateParamsRecipientNotification" + ] + """ + Details about the notification settings for the OutboundPayment recipient. + """ + to: "OutboundPaymentService.CreateParamsTo" + """ + To which payout method to send the OutboundPayment. + """ + + class CreateParamsDeliveryOptions(TypedDict): + bank_account: NotRequired[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class CreateParamsFrom(TypedDict): + currency: str + """ + Describes the FinancialAmount's currency drawn from. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class CreateParamsRecipientNotification(TypedDict): + setting: Literal["configured", "none"] + """ + Closed Enum. Configuration option to enable or disable notifications to recipients. + Do not send notifications when setting is NONE. Default to account setting when setting is CONFIGURED or not set. + """ + + class CreateParamsTo(TypedDict): + currency: NotRequired[str] + """ + Describes the currency to send to the recipient. + If included, this currency must match a currency supported by the destination. + Can be omitted in the following cases: + - destination only supports one currency + - destination supports multiple currencies and one of the currencies matches the FA currency + - destination supports multiple currencies and one of the currencies matches the presentment currency + Note - when both FA currency and presentment currency are supported, we pick the FA currency to minimize FX. + """ + payout_method: NotRequired[str] + """ + The payout method which the OutboundPayment uses to send payout. + """ + recipient: str + """ + To which account the OutboundPayment is sent. + """ + + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + limit: NotRequired[int] + """ + The maximum number of results to return. + """ + recipient: NotRequired[str] + """ + Only return OutboundPayments sent to this recipient. + """ + status: NotRequired[ + List[ + Literal[ + "canceled", "failed", "posted", "processing", "returned" + ] + ] + ] + """ + Closed Enum. Only return OutboundPayments with this status. + """ + + class RetrieveParams(TypedDict): + pass + + def cancel( + self, + id: str, + params: "OutboundPaymentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. + """ + return cast( + OutboundPayment, + self._request( + "post", + "/v2/money_management/outbound_payments/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: "OutboundPaymentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v2/money_management/outbound_payments/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "OutboundPaymentService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Creates an OutboundPayment. + """ + return cast( + OutboundPayment, + self._request( + "post", + "/v2/money_management/outbound_payments", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "OutboundPaymentService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Creates an OutboundPayment. + """ + return cast( + OutboundPayment, + await self._request_async( + "post", + "/v2/money_management/outbound_payments", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "OutboundPaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundPayment]: + """ + Returns a list of OutboundPayments that match the provided filters. + """ + return cast( + ListObject[OutboundPayment], + self._request( + "get", + "/v2/money_management/outbound_payments", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "OutboundPaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundPayment]: + """ + Returns a list of OutboundPayments that match the provided filters. + """ + return cast( + ListObject[OutboundPayment], + await self._request_async( + "get", + "/v2/money_management/outbound_payments", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OutboundPaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. + """ + return cast( + OutboundPayment, + self._request( + "get", + "/v2/money_management/outbound_payments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OutboundPaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundPayment: + """ + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. + """ + return cast( + OutboundPayment, + await self._request_async( + "get", + "/v2/money_management/outbound_payments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_outbound_setup_intent.py b/stripe/v2/money_management/_outbound_setup_intent.py new file mode 100644 index 000000000..00950dd62 --- /dev/null +++ b/stripe/v2/money_management/_outbound_setup_intent.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.money_management._payout_method import PayoutMethod + + +class OutboundSetupIntent(StripeObject): + """ + Use the OutboundSetupIntent API to create and setup usable payout methods. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.money_management.outbound_setup_intent"] + ] = "v2.money_management.outbound_setup_intent" + + class NextAction(StripeObject): + class ConfirmationOfPayee(StripeObject): + object: str + """ + The type of the credential. + """ + status: Literal[ + "awaiting_acknowledgement", "confirmed", "uninitiated" + ] + """ + The Confirmation of Payee status. + """ + + type: Literal["confirmation_of_payee"] + """ + The type of next action. + """ + confirmation_of_payee: Optional[ConfirmationOfPayee] + """ + Confirmation of Payee details. + """ + _inner_class_types = {"confirmation_of_payee": ConfirmationOfPayee} + + created: str + """ + Created timestamp. + """ + id: str + """ + ID of the outbound setup intent. + """ + next_action: Optional[NextAction] + """ + Specifies which actions needs to be taken next to continue setup of the credential. + """ + object: Literal["v2.money_management.outbound_setup_intent"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + payout_method: "PayoutMethod" + """ + Information about the payout method that's created and linked to this outbound setup intent. + """ + status: Literal[ + "canceled", "requires_action", "requires_payout_method", "succeeded" + ] + """ + Closed Enum. Status of the outbound setup intent. + """ + usage_intent: Literal["payment", "transfer"] + """ + The intended money movement flow this payout method should be set up for, specified in params. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"next_action": NextAction} diff --git a/stripe/v2/money_management/_outbound_setup_intent_service.py b/stripe/v2/money_management/_outbound_setup_intent_service.py new file mode 100644 index 000000000..be5c41510 --- /dev/null +++ b/stripe/v2/money_management/_outbound_setup_intent_service.py @@ -0,0 +1,381 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._outbound_setup_intent import ( + OutboundSetupIntent, +) +from typing import cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OutboundSetupIntentService(StripeService): + class CancelParams(TypedDict): + pass + + class CreateParams(TypedDict): + payout_method: NotRequired[str] + """ + If provided, the existing payout method resource to link to this setup intent. + Any payout_method_data provided is used to update information on this linked payout method resource. + """ + payout_method_data: NotRequired[ + "OutboundSetupIntentService.CreateParamsPayoutMethodData" + ] + """ + If no payout_method provided, used to create the underlying credential that is set up for outbound money movement. + If a payout_method provided, used to update data on the credential linked to this setup intent. + """ + usage_intent: NotRequired[Literal["payment", "transfer"]] + """ + Specify which type of outbound money movement this credential should be set up for (payment | transfer). + If not provided, defaults to payment. + """ + + class CreateParamsPayoutMethodData(TypedDict): + type: Literal["bank_account", "card"] + """ + Closed Enum. The type of payout method to be created. + """ + bank_account: NotRequired[ + "OutboundSetupIntentService.CreateParamsPayoutMethodDataBankAccount" + ] + """ + The type specific details of the bank account payout method. + """ + card: NotRequired[ + "OutboundSetupIntentService.CreateParamsPayoutMethodDataCard" + ] + """ + The type specific details of the card payout method. + """ + + class CreateParamsPayoutMethodDataBankAccount(TypedDict): + account_number: str + """ + The account number or IBAN of the bank account. + """ + bank_account_type: NotRequired[Literal["checking", "savings"]] + """ + Closed Enum. The type of the bank account (checking or savings). + """ + branch_number: NotRequired[str] + """ + The branch number of the bank account, if present. + """ + country: str + """ + The country code of the bank account. + """ + routing_number: NotRequired[str] + """ + The routing number of the bank account, if present. + """ + swift_code: NotRequired[str] + """ + The swift code of the bank account, if present. + """ + + class CreateParamsPayoutMethodDataCard(TypedDict): + exp_month: str + """ + The expiration month of the card. + """ + exp_year: str + """ + The expiration year of the card. + """ + number: str + """ + The card number. + """ + + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page size. + """ + + class RetrieveParams(TypedDict): + pass + + class UpdateParams(TypedDict): + payout_method: NotRequired[str] + """ + If provided, the existing payout method resource to link to this outbound setup intent. + """ + payout_method_data: NotRequired[ + "OutboundSetupIntentService.UpdateParamsPayoutMethodData" + ] + """ + If no payout_method provided, used to create the underlying credential that is set up for outbound money movement. + If a payout_method provided, used to update data on the credential linked to this setup intent. + """ + + class UpdateParamsPayoutMethodData(TypedDict): + type: Literal["bank_account", "card"] + """ + Closed Enum. The type of payout method to be created/updated. + """ + bank_account: NotRequired[ + "OutboundSetupIntentService.UpdateParamsPayoutMethodDataBankAccount" + ] + """ + The type specific details of the bank account payout method. + """ + card: NotRequired[ + "OutboundSetupIntentService.UpdateParamsPayoutMethodDataCard" + ] + """ + The type specific details of the card payout method. + """ + + class UpdateParamsPayoutMethodDataBankAccount(TypedDict): + account_number: str + """ + The account number or IBAN of the bank account. + """ + bank_account_type: NotRequired[Literal["checking", "savings"]] + """ + Closed Enum. The type of the bank account (checking or savings). + """ + branch_number: NotRequired[str] + """ + The branch number of the bank account, if present. + """ + country: str + """ + The country code of the bank account. + """ + routing_number: NotRequired[str] + """ + The routing number of the bank account, if present. + """ + swift_code: NotRequired[str] + """ + The swift code of the bank account, if present. + """ + + class UpdateParamsPayoutMethodDataCard(TypedDict): + exp_month: NotRequired[str] + """ + The expiration month of the card. + """ + exp_year: NotRequired[str] + """ + The expiration year of the card. + """ + number: NotRequired[str] + """ + The card number. This can only be passed when creating a new credential on an outbound setup intent in the requires_payout_method state. + """ + + def cancel( + self, + id: str, + params: "OutboundSetupIntentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Cancel an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + self._request( + "post", + "/v2/money_management/outbound_setup_intents/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: "OutboundSetupIntentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Cancel an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + await self._request_async( + "post", + "/v2/money_management/outbound_setup_intents/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "OutboundSetupIntentService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Create an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + self._request( + "post", + "/v2/money_management/outbound_setup_intents", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "OutboundSetupIntentService.CreateParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Create an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + await self._request_async( + "post", + "/v2/money_management/outbound_setup_intents", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "OutboundSetupIntentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundSetupIntent]: + """ + List the OutboundSetupIntent objects. + """ + return cast( + ListObject[OutboundSetupIntent], + self._request( + "get", + "/v2/money_management/outbound_setup_intents", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "OutboundSetupIntentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundSetupIntent]: + """ + List the OutboundSetupIntent objects. + """ + return cast( + ListObject[OutboundSetupIntent], + await self._request_async( + "get", + "/v2/money_management/outbound_setup_intents", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OutboundSetupIntentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Retrieve an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + self._request( + "get", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OutboundSetupIntentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Retrieve an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + await self._request_async( + "get", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: "OutboundSetupIntentService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Update an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + self._request( + "post", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: "OutboundSetupIntentService.UpdateParams" = {}, + options: RequestOptions = {}, + ) -> OutboundSetupIntent: + """ + Update an OutboundSetupIntent object. + """ + return cast( + OutboundSetupIntent, + await self._request_async( + "post", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py new file mode 100644 index 000000000..e9302b8c9 --- /dev/null +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, Optional +from typing_extensions import Literal + + +class OutboundTransfer(StripeObject): + """ + OutboundTransfer represents a single money movement from one FinancialAccount you own to a payout method you also own. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.outbound_transfer"]] = ( + "v2.money_management.outbound_transfer" + ) + + class DeliveryOptions(StripeObject): + bank_account: Optional[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class From(StripeObject): + debited: Amount + """ + The monetary amount debited from the sender, only set on responses. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class StatusDetails(StripeObject): + class Failed(StripeObject): + reason: Literal[ + "payout_method_declined", + "payout_method_does_not_exist", + "payout_method_expired", + "payout_method_unsupported", + "payout_method_usage_frequency_limit_exceeded", + "unknown_failure", + ] + """ + Open Enum. The `failed` status reason. + """ + + class Returned(StripeObject): + reason: Literal[ + "payout_method_canceled_by_customer", + "payout_method_closed", + "payout_method_currency_unsupported", + "payout_method_does_not_exist", + "payout_method_holder_address_incorrect", + "payout_method_holder_details_incorrect", + "payout_method_holder_name_incorrect", + "payout_method_invalid_account_number", + "payout_method_restricted", + "recalled", + "unknown_failure", + ] + """ + Open Enum. The `returned` status reason. + """ + + failed: Optional[Failed] + """ + The `failed` status reason. + """ + returned: Optional[Returned] + """ + The `returned` status reason. + """ + _inner_class_types = {"failed": Failed, "returned": Returned} + + class StatusTransitions(StripeObject): + canceled_at: Optional[str] + """ + Timestamp describing when an OutboundTransfer changed status to `canceled`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + failed_at: Optional[str] + """ + Timestamp describing when an OutboundTransfer changed status to `failed`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + posted_at: Optional[str] + """ + Timestamp describing when an OutboundTransfer changed status to `posted`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + returned_at: Optional[str] + """ + Timestamp describing when an OutboundTransfer changed status to `returned`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + + class To(StripeObject): + credited: Amount + """ + The monetary amount being credited to the destination. + """ + payout_method: str + """ + The payout method which the OutboundTransfer uses to send payout. + """ + + class TraceId(StripeObject): + status: Literal["pending", "supported", "unsupported"] + """ + Possible values are `pending`, `supported`, and `unsupported`. Initially set to `pending`, it changes to + `supported` when the recipient bank provides a trace ID, or `unsupported` if the recipient bank doesn't support it. + Note that this status may not align with the OutboundPayment or OutboundTransfer status and can remain `pending` + even after the payment or transfer is posted. + """ + value: Optional[str] + """ + The trace ID value if `trace_id.status` is `supported`, otherwise empty. + """ + + amount: Amount + """ + The "presentment amount" for the OutboundTransfer. + """ + cancelable: bool + """ + Returns true if the OutboundTransfer can be canceled, and false otherwise. + """ + created: str + """ + Time at which the OutboundTransfer was created. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + delivery_options: Optional[DeliveryOptions] + """ + Delivery options to be used to send the OutboundTransfer. + """ + description: Optional[str] + """ + An arbitrary string attached to the OutboundTransfer. Often useful for displaying to users. + """ + expected_arrival_date: Optional[str] + """ + The date when funds are expected to arrive in the payout method. This field is not set if the payout method is in a `failed`, `canceled`, or `returned` state. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + from_: From + """ + The FinancialAccount that funds were pulled from. + """ + id: str + """ + Unique identifier for the OutboundTransfer. + """ + metadata: Optional[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["v2.money_management.outbound_transfer"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + receipt_url: Optional[str] + """ + A link to the Stripe-hosted receipt for this OutboundTransfer. The receipt link remains active for 60 days from the OutboundTransfer creation date. After this period, the link will expire and the receipt url value will be null. + """ + statement_descriptor: str + """ + The description that appears on the receiving end for an OutboundTransfer (for example, bank statement for external bank transfer). + """ + status: Literal["canceled", "failed", "posted", "processing", "returned"] + """ + Closed Enum. Current status of the OutboundTransfer: `processing`, `failed`, `posted`, `returned`, `canceled`. + An OutboundTransfer is `processing` if it has been created and is processing. + The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + If an OutboundTransfer fails to arrive at its payout method, its status will change to `returned`. + """ + status_details: Optional[StatusDetails] + """ + Status details for an OutboundTransfer in a `failed` or `returned` state. + """ + status_transitions: Optional[StatusTransitions] + """ + Hash containing timestamps of when the object transitioned to a particular status. + """ + to: To + """ + To which payout method the OutboundTransfer was sent. + """ + trace_id: TraceId + """ + A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks might call this a “reference number” or something similar. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "delivery_options": DeliveryOptions, + "from": From, + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + "to": To, + "trace_id": TraceId, + } + _field_remappings = {"from_": "from"} diff --git a/stripe/v2/money_management/_outbound_transfer_service.py b/stripe/v2/money_management/_outbound_transfer_service.py new file mode 100644 index 000000000..2f5cc96ad --- /dev/null +++ b/stripe/v2/money_management/_outbound_transfer_service.py @@ -0,0 +1,284 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._outbound_transfer import OutboundTransfer +from typing import Dict, List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OutboundTransferService(StripeService): + class CancelParams(TypedDict): + pass + + _CreateParamsBase = TypedDict( + "CreateParams", + {"from": "OutboundTransferService.CreateParamsFrom"}, + ) + + class CreateParams(_CreateParamsBase): + amount: AmountParam + """ + The "presentment amount" for the OutboundPayment. + """ + delivery_options: NotRequired[ + "OutboundTransferService.CreateParamsDeliveryOptions" + ] + """ + Delivery options to be used to send the OutboundTransfer. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the OutboundTransfer. Often useful for displaying to users. + """ + metadata: NotRequired[Dict[str, str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + to: "OutboundTransferService.CreateParamsTo" + """ + To which payout method to send the OutboundTransfer. + """ + + class CreateParamsDeliveryOptions(TypedDict): + bank_account: NotRequired[Literal["automatic", "local", "wire"]] + """ + Open Enum. Method for bank account. + """ + + class CreateParamsFrom(TypedDict): + currency: str + """ + Describes the FinancialAmount's currency drawn from. + """ + financial_account: str + """ + The FinancialAccount that funds were pulled from. + """ + + class CreateParamsTo(TypedDict): + currency: NotRequired[str] + """ + Describes the currency to send to the recipient. + If included, this currency must match a currency supported by the destination. + Can be omitted in the following cases: + - destination only supports one currency + - destination supports multiple currencies and one of the currencies matches the FA currency + - destination supports multiple currencies and one of the currencies matches the presentment currency + Note - when both FA currency and presentment currency are supported, we pick the FA currency to minimize FX. + """ + payout_method: str + """ + The payout method which the OutboundTransfer uses to send payout. + """ + + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + limit: NotRequired[int] + """ + The maximum number of results to return. + """ + status: NotRequired[ + List[ + Literal[ + "canceled", "failed", "posted", "processing", "returned" + ] + ] + ] + """ + Closed Enum. Only return OutboundTransfers with this status. + """ + + class RetrieveParams(TypedDict): + pass + + def cancel( + self, + id: str, + params: "OutboundTransferService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. + """ + return cast( + OutboundTransfer, + self._request( + "post", + "/v2/money_management/outbound_transfers/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: "OutboundTransferService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v2/money_management/outbound_transfers/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "OutboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Creates an OutboundTransfer. + """ + return cast( + OutboundTransfer, + self._request( + "post", + "/v2/money_management/outbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "OutboundTransferService.CreateParams", + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Creates an OutboundTransfer. + """ + return cast( + OutboundTransfer, + await self._request_async( + "post", + "/v2/money_management/outbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "OutboundTransferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundTransfer]: + """ + Returns a list of OutboundTransfers that match the provided filters. + """ + return cast( + ListObject[OutboundTransfer], + self._request( + "get", + "/v2/money_management/outbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "OutboundTransferService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OutboundTransfer]: + """ + Returns a list of OutboundTransfers that match the provided filters. + """ + return cast( + ListObject[OutboundTransfer], + await self._request_async( + "get", + "/v2/money_management/outbound_transfers", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OutboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. + """ + return cast( + OutboundTransfer, + self._request( + "get", + "/v2/money_management/outbound_transfers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OutboundTransferService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OutboundTransfer: + """ + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. + """ + return cast( + OutboundTransfer, + await self._request_async( + "get", + "/v2/money_management/outbound_transfers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py new file mode 100644 index 000000000..33bbb5935 --- /dev/null +++ b/stripe/v2/money_management/_payout_method.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class PayoutMethod(StripeObject): + """ + Use the PayoutMethods API to list and interact with PayoutMethod objects. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.payout_method"]] = ( + "v2.money_management.payout_method" + ) + + class UsageStatus(StripeObject): + payments: Literal["eligible", "invalid", "requires_action"] + """ + Payments status - used when sending OutboundPayments (sending funds to recipients). + """ + transfers: Literal["eligible", "invalid", "requires_action"] + """ + Transfers status - used when making an OutboundTransfer (sending funds to yourself). + """ + + class BankAccount(StripeObject): + archived: bool + """ + Whether this PayoutMethodBankAccount object was archived. PayoutMethodBankAccount objects can be archived through + the /archive API, and they will not be automatically archived by Stripe. Archived PayoutMethodBankAccount objects + cannot be used as payout methods and will not appear in the payout method list. + """ + bank_name: str + """ + The name of the bank this bank account is in. This field is populated automatically by Stripe. + """ + country: str + """ + The country code of the bank account. + """ + enabled_delivery_options: List[str] + """ + List of enabled flows for this bank account (wire or local). + """ + last4: str + """ + The last 4 digits of the account number. + """ + routing_number: Optional[str] + """ + The routing number of the bank account, if present. + """ + supported_currencies: List[str] + """ + The list of currencies supported by this bank account. + """ + + class Card(StripeObject): + archived: bool + """ + Whether the PayoutMethodCard object was archived. PayoutMethodCard objects can be archived through + the /archive API, and they will not be automatically archived by Stripe. Archived PayoutMethodCard objects + cannot be used as payout methods and will not appear in the payout method list. + """ + exp_month: str + """ + The month the card expires. + """ + exp_year: str + """ + The year the card expires. + """ + last4: str + """ + The last 4 digits of the card number. + """ + + available_payout_speeds: List[Literal["instant", "standard"]] + """ + A set of available payout speeds for this payout method. + """ + created: str + """ + Created timestamp. + """ + id: str + """ + ID of the PayoutMethod object. + """ + latest_outbound_setup_intent: Optional[str] + """ + ID of the underlying active OutboundSetupIntent object, if any. + """ + object: Literal["v2.money_management.payout_method"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + type: Literal["bank_account", "card"] + """ + Closed Enum. The type of payout method. + """ + usage_status: UsageStatus + """ + Indicates whether the payout method has met the necessary requirements for outbound money movement. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + bank_account: Optional[BankAccount] + """ + The PayoutMethodBankAccount object details. + """ + card: Optional[Card] + """ + The PayoutMethodCard object details. + """ + _inner_class_types = { + "usage_status": UsageStatus, + "bank_account": BankAccount, + "card": Card, + } diff --git a/stripe/v2/money_management/_payout_method_service.py b/stripe/v2/money_management/_payout_method_service.py new file mode 100644 index 000000000..a67e5e36c --- /dev/null +++ b/stripe/v2/money_management/_payout_method_service.py @@ -0,0 +1,216 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._payout_method import PayoutMethod +from typing import List, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class PayoutMethodService(StripeService): + class ArchiveParams(TypedDict): + pass + + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page size. + """ + usage_status: NotRequired["PayoutMethodService.ListParamsUsageStatus"] + """ + Usage status filter. + """ + + class ListParamsUsageStatus(TypedDict): + payments: NotRequired[ + List[Literal["eligible", "invalid", "requires_action"]] + ] + """ + List of payments status to filter by. + """ + transfers: NotRequired[ + List[Literal["eligible", "invalid", "requires_action"]] + ] + """ + List of transfers status to filter by. + """ + + class RetrieveParams(TypedDict): + pass + + class UnarchiveParams(TypedDict): + pass + + def archive( + self, + id: str, + params: "PayoutMethodService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Archive a PayoutMethod object. Archived objects cannot be used as payout methods + and will not appear in the payout method list. + """ + return cast( + PayoutMethod, + self._request( + "post", + "/v2/money_management/payout_methods/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def archive_async( + self, + id: str, + params: "PayoutMethodService.ArchiveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Archive a PayoutMethod object. Archived objects cannot be used as payout methods + and will not appear in the payout method list. + """ + return cast( + PayoutMethod, + await self._request_async( + "post", + "/v2/money_management/payout_methods/{id}/archive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "PayoutMethodService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PayoutMethod]: + """ + List objects that adhere to the PayoutMethod interface. + """ + return cast( + ListObject[PayoutMethod], + self._request( + "get", + "/v2/money_management/payout_methods", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "PayoutMethodService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[PayoutMethod]: + """ + List objects that adhere to the PayoutMethod interface. + """ + return cast( + ListObject[PayoutMethod], + await self._request_async( + "get", + "/v2/money_management/payout_methods", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "PayoutMethodService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Retrieve a PayoutMethod object. + """ + return cast( + PayoutMethod, + self._request( + "get", + "/v2/money_management/payout_methods/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "PayoutMethodService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Retrieve a PayoutMethod object. + """ + return cast( + PayoutMethod, + await self._request_async( + "get", + "/v2/money_management/payout_methods/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def unarchive( + self, + id: str, + params: "PayoutMethodService.UnarchiveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Unarchive an PayoutMethod object. + """ + return cast( + PayoutMethod, + self._request( + "post", + "/v2/money_management/payout_methods/{id}/unarchive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def unarchive_async( + self, + id: str, + params: "PayoutMethodService.UnarchiveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethod: + """ + Unarchive an PayoutMethod object. + """ + return cast( + PayoutMethod, + await self._request_async( + "post", + "/v2/money_management/payout_methods/{id}/unarchive".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_payout_methods_bank_account_spec.py b/stripe/v2/money_management/_payout_methods_bank_account_spec.py new file mode 100644 index 000000000..2fd4e797f --- /dev/null +++ b/stripe/v2/money_management/_payout_methods_bank_account_spec.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, List +from typing_extensions import Literal + + +class PayoutMethodsBankAccountSpec(StripeObject): + """ + The PayoutMethodsBankAccountSpec object. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.money_management.payout_methods_bank_account_spec"] + ] = "v2.money_management.payout_methods_bank_account_spec" + + class Countries(StripeObject): + class Field(StripeObject): + class LocalNameHuman(StripeObject): + content: str + localization_key: str + + local_name: str + """ + The local name of the field. + """ + local_name_human: LocalNameHuman + """ + The human readable local name of the field. + """ + max_length: int + """ + The maximum length of the field. + """ + min_length: int + """ + THe minimum length of the field. + """ + placeholder: str + """ + The placeholder value of the field. + """ + stripe_name: str + """ + The stripe name of the field. + """ + validation_regex: str + """ + The validation regex of the field. + """ + _inner_class_types = {"local_name_human": LocalNameHuman} + + fields: List[Field] + """ + The list of fields for a country, along with associated information. + """ + _inner_class_types = {"fields": Field} + + countries: Dict[str, Countries] + """ + The list of specs by country. + """ + object: Literal["v2.money_management.payout_methods_bank_account_spec"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = {"countries": Countries} diff --git a/stripe/v2/money_management/_payout_methods_bank_account_spec_service.py b/stripe/v2/money_management/_payout_methods_bank_account_spec_service.py new file mode 100644 index 000000000..3895fcec5 --- /dev/null +++ b/stripe/v2/money_management/_payout_methods_bank_account_spec_service.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe.v2.money_management._payout_methods_bank_account_spec import ( + PayoutMethodsBankAccountSpec, +) +from typing import List, cast +from typing_extensions import NotRequired, TypedDict + + +class PayoutMethodsBankAccountSpecService(StripeService): + class RetrieveParams(TypedDict): + countries: NotRequired[List[str]] + """ + The countries to fetch the bank account spec for. + """ + + def retrieve( + self, + params: "PayoutMethodsBankAccountSpecService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethodsBankAccountSpec: + """ + Fetch the specifications for a set of countries to know which + credential fields are required, the validations for each fields, and how to translate these + country-specific fields to the generic fields in the PayoutMethodBankAccount type. + """ + return cast( + PayoutMethodsBankAccountSpec, + self._request( + "get", + "/v2/money_management/payout_methods_bank_account_spec", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: "PayoutMethodsBankAccountSpecService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> PayoutMethodsBankAccountSpec: + """ + Fetch the specifications for a set of countries to know which + credential fields are required, the validations for each fields, and how to translate these + country-specific fields to the generic fields in the PayoutMethodBankAccount type. + """ + return cast( + PayoutMethodsBankAccountSpec, + await self._request_async( + "get", + "/v2/money_management/payout_methods_bank_account_spec", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py new file mode 100644 index 000000000..56eebe515 --- /dev/null +++ b/stripe/v2/money_management/_received_credit.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class ReceivedCredit(StripeObject): + """ + Use ReceivedCredits API to retrieve information on when, where, and how funds are sent into your FinancialAccount. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.received_credit"]] = ( + "v2.money_management.received_credit" + ) + + class StatusDetails(StripeObject): + class Failed(StripeObject): + reason: Literal[ + "capability_inactive", + "currency_unsupported_on_financial_address", + "financial_address_inactive", + "stripe_rejected", + ] + """ + Open Enum. The `failed` status reason. + """ + + class Returned(StripeObject): + reason: Literal["originator_initiated_reversal"] + """ + Open Enum. The `returned` status reason. + """ + + failed: Optional[Failed] + """ + Hash that provides additional information regarding the reason behind a `failed` ReceivedCredit status. It is only present when the ReceivedCredit status is `failed`. + """ + returned: Optional[Returned] + """ + Hash that provides additional information regarding the reason behind a `returned` ReceivedCredit status. It is only present when the ReceivedCredit status is `returned`. + """ + _inner_class_types = {"failed": Failed, "returned": Returned} + + class StatusTransitions(StripeObject): + failed_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit was marked as `failed`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + returned_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit changed status to `returned`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + succeeded_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit was marked as `succeeded`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + + class BalanceTransfer(StripeObject): + payout_v1: str + """ + The ID of the Stripe Money Movement that originated the ReceivedCredit. + """ + type: Literal["payout_v1"] + """ + Open Enum. The type of Stripe Money Movement that originated the ReceivedCredit. + """ + + class BankTransfer(StripeObject): + class GbBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The bank name the transfer was received from. + """ + bank_name: Optional[str] + """ + The bank name the transfer was received from. + """ + last4: Optional[str] + """ + The last 4 digits of the account number that originated the transfer. + """ + network: Literal["fps"] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + sort_code: Optional[str] + """ + The sort code of the account that originated the transfer. + """ + + class UsBankAccount(StripeObject): + bank_name: Optional[str] + """ + The bank name the transfer was received from. + """ + last4: Optional[str] + """ + The last 4 digits of the account number that originated the transfer. + """ + network: Literal["ach", "rtp", "us_domestic_wire"] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + routing_number: Optional[str] + """ + The routing number of the account that originated the transfer. + """ + + financial_address: str + """ + Financial Address on which funds for ReceivedCredit were received. + """ + payment_method_type: Literal["gb_bank_account", "us_bank_account"] + """ + Open Enum. Indicates the type of source via from which external funds originated. + """ + statement_descriptor: Optional[str] + """ + Freeform string set by originator of the external ReceivedCredit. + """ + gb_bank_account: Optional[GbBankAccount] + """ + Hash containing the transaction bank details. Present if `payment_method_type` field value is `gb_bank_account`. + """ + us_bank_account: Optional[UsBankAccount] + """ + Hash containing the transaction bank details. Present if `payment_method_type` field value is `us_bank_account`. + """ + _inner_class_types = { + "gb_bank_account": GbBankAccount, + "us_bank_account": UsBankAccount, + } + + amount: Amount + """ + The amount and currency of the ReceivedCredit. + """ + created: str + """ + Time at which the ReceivedCredit was created. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + description: Optional[str] + """ + Freeform string set by originator of the ReceivedCredit. + """ + financial_account: str + """ + Financial Account ID on which funds for ReceivedCredit were received. + """ + id: str + """ + Unique identifier for the ReceivedCredit. + """ + object: Literal["v2.money_management.received_credit"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + receipt_url: Optional[str] + """ + A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + """ + status: Literal["failed", "pending", "returned", "succeeded"] + """ + Open Enum. The status of the ReceivedCredit. + """ + status_details: Optional[StatusDetails] + """ + This hash contains detailed information that elaborates on the specific status of the ReceivedCredit. e.g the reason behind a failure if the status is marked as `failed`. + """ + status_transitions: Optional[StatusTransitions] + """ + Hash containing timestamps of when the object transitioned to a particular status. + """ + type: Literal["balance_transfer", "bank_transfer", "external_credit"] + """ + Open Enum. The type of flow that caused the ReceivedCredit. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + balance_transfer: Optional[BalanceTransfer] + """ + This object stores details about the originating Stripe transaction that resulted in the ReceivedCredit. Present if `type` field value is `balance_transfer`. + """ + bank_transfer: Optional[BankTransfer] + """ + This object stores details about the originating banking transaction that resulted in the ReceivedCredit. Present if `type` field value is `external_credit`. + """ + _inner_class_types = { + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + "balance_transfer": BalanceTransfer, + "bank_transfer": BankTransfer, + } diff --git a/stripe/v2/money_management/_received_credit_service.py b/stripe/v2/money_management/_received_credit_service.py new file mode 100644 index 000000000..091a08e75 --- /dev/null +++ b/stripe/v2/money_management/_received_credit_service.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._received_credit import ReceivedCredit +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class ReceivedCreditService(StripeService): + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "ReceivedCreditService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReceivedCredit]: + """ + Retrieves a list of ReceivedCredits. + """ + return cast( + ListObject[ReceivedCredit], + self._request( + "get", + "/v2/money_management/received_credits", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "ReceivedCreditService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReceivedCredit]: + """ + Retrieves a list of ReceivedCredits. + """ + return cast( + ListObject[ReceivedCredit], + await self._request_async( + "get", + "/v2/money_management/received_credits", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "ReceivedCreditService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedCredit: + """ + Retrieve a ReceivedCredit by ID. + """ + return cast( + ReceivedCredit, + self._request( + "get", + "/v2/money_management/received_credits/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "ReceivedCreditService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedCredit: + """ + Retrieve a ReceivedCredit by ID. + """ + return cast( + ReceivedCredit, + await self._request_async( + "get", + "/v2/money_management/received_credits/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_received_debit.py b/stripe/v2/money_management/_received_debit.py new file mode 100644 index 000000000..99706f4f2 --- /dev/null +++ b/stripe/v2/money_management/_received_debit.py @@ -0,0 +1,143 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class ReceivedDebit(StripeObject): + """ + ReceivedDebit resource + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.received_debit"]] = ( + "v2.money_management.received_debit" + ) + + class StatusDetails(StripeObject): + class Failed(StripeObject): + reason: Literal[ + "financial_address_inactive", + "insufficient_funds", + "stripe_rejected", + ] + """ + Open Enum. The reason for the failure of the ReceivedDebit. + """ + + failed: Failed + """ + Information that elaborates on the `failed` status of a ReceivedDebit. + It is only present when the ReceivedDebit status is `failed`. + """ + _inner_class_types = {"failed": Failed} + + class StatusTransitions(StripeObject): + canceled_at: Optional[str] + """ + The time when the ReceivedDebit was marked as `canceled`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. + """ + failed_at: Optional[str] + """ + The time when the ReceivedDebit was marked as `failed`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. + """ + succeeded_at: Optional[str] + """ + The time when the ReceivedDebit was marked as `succeeded`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. + """ + + class BankTransfer(StripeObject): + class UsBankAccount(StripeObject): + bank_name: Optional[str] + """ + The name of the bank the debit originated from. + """ + network: Literal["ach"] + """ + Open Enum. The bank network the debit was originated on. + """ + routing_number: Optional[str] + """ + The routing number of the bank that originated the debit. + """ + + financial_address: str + """ + The Financial Address that was debited. + """ + payment_method_type: Literal["us_bank_account"] + """ + Open Enum. The type of the payment method used to originate the debit. + """ + statement_descriptor: Optional[str] + """ + The statement descriptor set by the originator of the debit. + """ + us_bank_account: UsBankAccount + """ + The payment method used to originate the debit. + """ + _inner_class_types = {"us_bank_account": UsBankAccount} + + amount: Amount + """ + Amount and currency of the ReceivedDebit. + """ + created: str + """ + The time at which the ReceivedDebit was created. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. + """ + description: Optional[str] + """ + Freeform string sent by the originator of the ReceivedDebit. + """ + financial_account: str + """ + Financial Account on which funds for ReceivedDebit were debited. + """ + id: str + """ + Unique identifier for the ReceivedDebit. + """ + object: Literal["v2.money_management.received_debit"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + receipt_url: Optional[str] + """ + A link to the Stripe-hosted receipt for this ReceivedDebit. + """ + status: Literal["canceled", "failed", "pending", "returned", "succeeded"] + """ + Open Enum. The status of the ReceivedDebit. + """ + status_details: Optional[StatusDetails] + """ + Detailed information about the status of the ReceivedDebit. + """ + status_transitions: Optional[StatusTransitions] + """ + The time at which the ReceivedDebit transitioned to a particular status. + """ + type: Literal["bank_transfer", "external_debit"] + """ + Open Enum. The type of the ReceivedDebit. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + bank_transfer: Optional[BankTransfer] + """ + This object stores details about the originating banking transaction that resulted in the ReceivedDebit. Present if `type` field value is `bank_transfer`. + """ + _inner_class_types = { + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + "bank_transfer": BankTransfer, + } diff --git a/stripe/v2/money_management/_received_debit_service.py b/stripe/v2/money_management/_received_debit_service.py new file mode 100644 index 000000000..a5cb947d4 --- /dev/null +++ b/stripe/v2/money_management/_received_debit_service.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._received_debit import ReceivedDebit +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class ReceivedDebitService(StripeService): + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "ReceivedDebitService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReceivedDebit]: + """ + Retrieves a list of ReceivedDebits, given the selected filters. + """ + return cast( + ListObject[ReceivedDebit], + self._request( + "get", + "/v2/money_management/received_debits", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "ReceivedDebitService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[ReceivedDebit]: + """ + Retrieves a list of ReceivedDebits, given the selected filters. + """ + return cast( + ListObject[ReceivedDebit], + await self._request_async( + "get", + "/v2/money_management/received_debits", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "ReceivedDebitService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedDebit: + """ + Retrieves a single ReceivedDebit by ID. + """ + return cast( + ReceivedDebit, + self._request( + "get", + "/v2/money_management/received_debits/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "ReceivedDebitService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> ReceivedDebit: + """ + Retrieves a single ReceivedDebit by ID. + """ + return cast( + ReceivedDebit, + await self._request_async( + "get", + "/v2/money_management/received_debits/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py new file mode 100644 index 000000000..c02de945e --- /dev/null +++ b/stripe/v2/money_management/_transaction.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class Transaction(StripeObject): + """ + Use Transactions to view changes to your FinancialAccount balance over time. Every flow that moves money, such as OutboundPayments or ReceivedCredits, will have one or more Transactions that describes how the flow impacted your balance. Note that while the FinancialAccount balance will always be up to date, be aware that Transactions and TransactionEntries are created shortly after to reflect changes. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.transaction"]] = ( + "v2.money_management.transaction" + ) + + class BalanceImpact(StripeObject): + available: Amount + """ + Impact to the available balance. + """ + inbound_pending: Amount + """ + Impact to the inbound_pending balance. + """ + outbound_pending: Amount + """ + Impact to the outbound_pending balance. + """ + + class Flow(StripeObject): + type: Literal[ + "adjustment", + "fee_transaction", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. + """ + adjustment: Optional[str] + """ + If applicable, the ID of the Adjustment that created this Transaction. + """ + fee_transaction: Optional[str] + """ + If applicable, the ID of the FeeTransaction that created this Transaction. + """ + inbound_transfer: Optional[str] + """ + If applicable, the ID of the InboundTransfer that created this Transaction. + """ + outbound_payment: Optional[str] + """ + If applicable, the ID of the OutboundPayment that created this Transaction. + """ + outbound_transfer: Optional[str] + """ + If applicable, the ID of the OutboundTransfer that created this Transaction. + """ + received_credit: Optional[str] + """ + If applicable, the ID of the ReceivedCredit that created this Transaction. + """ + received_debit: Optional[str] + """ + If applicable, the ID of the ReceivedDebit that created this Transaction. + """ + + class StatusTransitions(StripeObject): + posted_at: Optional[str] + """ + The time at which the Transaction became posted. Only present if status == posted. + """ + void_at: Optional[str] + """ + The time at which the Transaction became void. Only present if status == void. + """ + + amount: Amount + """ + The amount of the Transaction. + """ + balance_impact: BalanceImpact + """ + The delta to the FinancialAccount's balance. The balance_impact for the Transaction is equal to sum of its + TransactionEntries that have `effective_at`s in the past. + """ + category: Literal[ + "adjustment", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + "return", + "stripe_fee", + ] + """ + Open Enum. A descriptive category used to classify the Transaction. + """ + created: str + """ + Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + financial_account: str + """ + Indicates the FinancialAccount affected by this Transaction. + """ + flow: Flow + """ + Details about the Flow object that created the Transaction. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["v2.money_management.transaction"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["pending", "posted", "void"] + """ + Closed Enum. Current status of the Transaction. + A Transaction is `pending` if either `balance_impact.inbound_pending` or `balance_impact.outbound_pending` is non-zero. + A Transaction is `posted` if only `balance_impact.available` is non-zero. + A Transaction is `void` if there is no balance impact. + `posted` and `void` are terminal states, and no additional entries will be added to the Transaction. + """ + status_transitions: StatusTransitions + """ + Timestamps for when the Transaction transitioned to a particular status. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "balance_impact": BalanceImpact, + "flow": Flow, + "status_transitions": StatusTransitions, + } diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py new file mode 100644 index 000000000..cb23123bc --- /dev/null +++ b/stripe/v2/money_management/_transaction_entry.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class TransactionEntry(StripeObject): + """ + TransactionEntries represent individual money movements across different states within a Transaction. + """ + + OBJECT_NAME: ClassVar[Literal["v2.money_management.transaction_entry"]] = ( + "v2.money_management.transaction_entry" + ) + + class BalanceImpact(StripeObject): + available: Amount + """ + Impact to the available balance. + """ + inbound_pending: Amount + """ + Impact to the inbound_pending balance. + """ + outbound_pending: Amount + """ + Impact to the outbound_pending balance. + """ + + class TransactionDetails(StripeObject): + class Flow(StripeObject): + type: Literal[ + "adjustment", + "fee_transaction", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. + """ + adjustment: Optional[str] + """ + If applicable, the ID of the Adjustment that created this Transaction. + """ + fee_transaction: Optional[str] + """ + If applicable, the ID of the FeeTransaction that created this Transaction. + """ + inbound_transfer: Optional[str] + """ + If applicable, the ID of the InboundTransfer that created this Transaction. + """ + outbound_payment: Optional[str] + """ + If applicable, the ID of the OutboundPayment that created this Transaction. + """ + outbound_transfer: Optional[str] + """ + If applicable, the ID of the OutboundTransfer that created this Transaction. + """ + received_credit: Optional[str] + """ + If applicable, the ID of the ReceivedCredit that created this Transaction. + """ + received_debit: Optional[str] + """ + If applicable, the ID of the ReceivedDebit that created this Transaction. + """ + + category: Literal[ + "adjustment", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + "return", + "stripe_fee", + ] + """ + Closed Enum for now, and will be turned into an Open Enum soon. A descriptive category used to classify the Transaction. + """ + financial_account: str + """ + Indicates the FinancialAccount affected by this Transaction. + """ + flow: Flow + """ + Details about the Flow object that created the Transaction. + """ + _inner_class_types = {"flow": Flow} + + balance_impact: BalanceImpact + """ + The delta to the FinancialAccount's balance. + """ + created: str + """ + Time at which the object was created. + """ + effective_at: str + """ + Time at which the entry impacted (or will impact if it's in the future) the FinancialAccount balance. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["v2.money_management.transaction_entry"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + transaction: str + """ + The Transaction that this TransactionEntry belongs to. + """ + transaction_details: TransactionDetails + """ + Details copied from the transaction that this TransactionEntry belongs to. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + _inner_class_types = { + "balance_impact": BalanceImpact, + "transaction_details": TransactionDetails, + } diff --git a/stripe/v2/money_management/_transaction_entry_service.py b/stripe/v2/money_management/_transaction_entry_service.py new file mode 100644 index 000000000..0ab4684fa --- /dev/null +++ b/stripe/v2/money_management/_transaction_entry_service.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._transaction_entry import TransactionEntry +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class TransactionEntryService(StripeService): + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for Transactions created at an exact time. + """ + created_gt: NotRequired[str] + """ + Filter for Transactions created after the specified timestamp. + """ + created_gte: NotRequired[str] + """ + Filter for Transactions created at or after the specified timestamp. + """ + created_lt: NotRequired[str] + """ + Filter for Transactions created before the specified timestamp. + """ + created_lte: NotRequired[str] + """ + Filter for Transactions created at or before the specified timestamp. + """ + limit: NotRequired[int] + """ + The page limit. + """ + transaction: NotRequired[str] + """ + Filter for TransactionEntries belonging to a Transaction. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "TransactionEntryService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TransactionEntry]: + """ + Returns a list of TransactionEntries that match the provided filters. + """ + return cast( + ListObject[TransactionEntry], + self._request( + "get", + "/v2/money_management/transaction_entries", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "TransactionEntryService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[TransactionEntry]: + """ + Returns a list of TransactionEntries that match the provided filters. + """ + return cast( + ListObject[TransactionEntry], + await self._request_async( + "get", + "/v2/money_management/transaction_entries", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "TransactionEntryService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TransactionEntry: + """ + Retrieves the details of a TransactionEntry by ID. + """ + return cast( + TransactionEntry, + self._request( + "get", + "/v2/money_management/transaction_entries/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "TransactionEntryService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> TransactionEntry: + """ + Retrieves the details of a TransactionEntry by ID. + """ + return cast( + TransactionEntry, + await self._request_async( + "get", + "/v2/money_management/transaction_entries/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_transaction_service.py b/stripe/v2/money_management/_transaction_service.py new file mode 100644 index 000000000..9f455366c --- /dev/null +++ b/stripe/v2/money_management/_transaction_service.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._list_object import ListObject +from stripe.v2.money_management._transaction import Transaction +from typing import cast +from typing_extensions import NotRequired, TypedDict + + +class TransactionService(StripeService): + class ListParams(TypedDict): + created: NotRequired[str] + """ + Filter for Transactions created at an exact time. + """ + created_gt: NotRequired[str] + """ + Filter for Transactions created after the specified timestamp. + """ + created_gte: NotRequired[str] + """ + Filter for Transactions created at or after the specified timestamp. + """ + created_lt: NotRequired[str] + """ + Filter for Transactions created before the specified timestamp. + """ + created_lte: NotRequired[str] + """ + Filter for Transactions created at or before the specified timestamp. + """ + financial_account: NotRequired[str] + """ + Filter for Transactions belonging to a FinancialAccount. + """ + flow: NotRequired[str] + """ + Filter for Transactions corresponding to a Flow. + """ + limit: NotRequired[int] + """ + The page limit. + """ + + class RetrieveParams(TypedDict): + pass + + def list( + self, + params: "TransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Transaction]: + """ + Returns a list of Transactions that match the provided filters. + """ + return cast( + ListObject[Transaction], + self._request( + "get", + "/v2/money_management/transactions", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "TransactionService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[Transaction]: + """ + Returns a list of Transactions that match the provided filters. + """ + return cast( + ListObject[Transaction], + await self._request_async( + "get", + "/v2/money_management/transactions", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves the details of a Transaction by ID. + """ + return cast( + Transaction, + self._request( + "get", + "/v2/money_management/transactions/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "TransactionService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> Transaction: + """ + Retrieves the details of a Transaction by ID. + """ + return cast( + Transaction, + await self._request_async( + "get", + "/v2/money_management/transactions/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/payments/__init__.py b/stripe/v2/payments/__init__.py new file mode 100644 index 000000000..a0d2761e0 --- /dev/null +++ b/stripe/v2/payments/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.payments._off_session_payment import ( + OffSessionPayment as OffSessionPayment, +) +from stripe.v2.payments._off_session_payment_service import ( + OffSessionPaymentService as OffSessionPaymentService, +) diff --git a/stripe/v2/payments/_off_session_payment.py b/stripe/v2/payments/_off_session_payment.py new file mode 100644 index 000000000..ff178f798 --- /dev/null +++ b/stripe/v2/payments/_off_session_payment.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount +from typing import ClassVar, Dict, Optional +from typing_extensions import Literal + + +class OffSessionPayment(StripeObject): + """ + Off-session payment resource. + """ + + OBJECT_NAME: ClassVar[Literal["v2.payments.off_session_payment"]] = ( + "v2.payments.off_session_payment" + ) + + class RetryDetails(StripeObject): + attempts: int + """ + Number of authorization attempts so far. + """ + retry_strategy: Literal["none", "smart"] + """ + How you want Stripe to retry the payment. + """ + + class TransferData(StripeObject): + amount: int + """ + Amount in minor units that you want to transfer. + """ + destination: str + """ + ID of the connected account where you want money to go. + """ + + amount_requested: Amount + """ + The amount you requested to be collected on the OSP upon creation. + """ + attempts: int + """ + Number of authorization attempts. + """ + cadence: Literal["recurring", "unscheduled"] + """ + The frequency of the underlying payment that this OSP represents. + """ + compartment_id: str + """ + ID of owning compartment. + """ + created: str + """ + Timestamp of creation. + """ + customer: str + """ + Customer owning the supplied payment method. + """ + failure_reason: Optional[ + Literal["rejected_by_partner", "retries_exhausted"] + ] + """ + Reason why the OSP failed. + """ + id: str + """ + ID of the OSP. + """ + last_authorization_attempt_error: Optional[str] + """ + Last error returned by the financial partner for a failed authorization. + """ + latest_payment_attempt_record: Optional[str] + """ + Payment attempt record for the latest attempt, if one exists. + """ + livemode: bool + """ + True if the txn is livemode, false otherwise. + """ + metadata: Dict[str, str] + """ + Metadata you provided. + """ + object: Literal["v2.payments.off_session_payment"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + on_behalf_of: Optional[str] + """ + OBO, same as on the PI. + """ + payment_method: str + """ + ID of payment method. + """ + payment_record: Optional[str] + """ + Payment record associated with the OSP. consistent across attempts. + """ + retry_details: RetryDetails + """ + Details about the OSP retries. + """ + statement_descriptor: Optional[str] + """ + Statement descriptor you provided. + """ + statement_descriptor_suffix: Optional[str] + """ + Statement descriptor suffix you provided, similar to that on the PI. + """ + status: Literal[ + "canceled", + "failed", + "pending", + "pending_retry", + "processing", + "requires_capture", + "succeeded", + ] + """ + Status of the OSP. + """ + test_clock: Optional[str] + """ + Test clock to be used to advance the retry attempts. + """ + transfer_data: Optional[TransferData] + """ + Instructions for the transfer to be made with this OSP after successful money movement. + """ + _inner_class_types = { + "retry_details": RetryDetails, + "transfer_data": TransferData, + } diff --git a/stripe/v2/payments/_off_session_payment_service.py b/stripe/v2/payments/_off_session_payment_service.py new file mode 100644 index 000000000..27edea9f7 --- /dev/null +++ b/stripe/v2/payments/_off_session_payment_service.py @@ -0,0 +1,254 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._list_object import ListObject +from stripe.v2.payments._off_session_payment import OffSessionPayment +from typing import Dict, cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class OffSessionPaymentService(StripeService): + class CancelParams(TypedDict): + pass + + class CreateParams(TypedDict): + amount: AmountParam + """ + Amount you want to collect. + """ + cadence: Literal["recurring", "unscheduled"] + """ + The frequency of the OSP. + """ + customer: str + """ + Customer that owns the provided payment method. + """ + metadata: Dict[str, str] + """ + Any of your internal data you want to track here. + """ + on_behalf_of: NotRequired[str] + """ + The OBO merchant you want to use. + """ + payment_method: str + """ + Payment method you want to debit. Must be attached to a customer and set up for off-session usage. + """ + retry_details: NotRequired[ + "OffSessionPaymentService.CreateParamsRetryDetails" + ] + """ + How you want stripe to retry the OSP. + """ + statement_descriptor: NotRequired[str] + """ + String you want to appear on your customer's statement. + """ + statement_descriptor_suffix: NotRequired[str] + """ + Suffix appended to your account level descriptor. + """ + test_clock: NotRequired[str] + """ + Test clock to be used for testing your retry handling. Only usable in a sandbox. + """ + transfer_data: NotRequired[ + "OffSessionPaymentService.CreateParamsTransferData" + ] + """ + How you want to transfer the funds to your connected accounts. + """ + + class CreateParamsRetryDetails(TypedDict): + retry_strategy: Literal["none", "smart"] + """ + How you want Stripe to retry the payment. + """ + + class CreateParamsTransferData(TypedDict): + amount: int + """ + Amount in minor units that you want to transfer. + """ + destination: str + """ + ID of the connected account where you want money to go. + """ + + class ListParams(TypedDict): + limit: NotRequired[int] + """ + The page size limit, if not provided the default is 20. + """ + + class RetrieveParams(TypedDict): + pass + + def cancel( + self, + id: str, + params: "OffSessionPaymentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Cancel OSP. + """ + return cast( + OffSessionPayment, + self._request( + "post", + "/v2/payments/off_session_payments/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: "OffSessionPaymentService.CancelParams" = {}, + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Cancel OSP. + """ + return cast( + OffSessionPayment, + await self._request_async( + "post", + "/v2/payments/off_session_payments/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "OffSessionPaymentService.CreateParams", + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Create OSP. + """ + return cast( + OffSessionPayment, + self._request( + "post", + "/v2/payments/off_session_payments", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "OffSessionPaymentService.CreateParams", + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Create OSP. + """ + return cast( + OffSessionPayment, + await self._request_async( + "post", + "/v2/payments/off_session_payments", + base_address="api", + params=params, + options=options, + ), + ) + + def list( + self, + params: "OffSessionPaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OffSessionPayment]: + """ + List OSPs matching filter. + """ + return cast( + ListObject[OffSessionPayment], + self._request( + "get", + "/v2/payments/off_session_payments", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "OffSessionPaymentService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[OffSessionPayment]: + """ + List OSPs matching filter. + """ + return cast( + ListObject[OffSessionPayment], + await self._request_async( + "get", + "/v2/payments/off_session_payments", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: "OffSessionPaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Retrieve OSP by ID. + """ + return cast( + OffSessionPayment, + self._request( + "get", + "/v2/payments/off_session_payments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: "OffSessionPaymentService.RetrieveParams" = {}, + options: RequestOptions = {}, + ) -> OffSessionPayment: + """ + Retrieve OSP by ID. + """ + return cast( + OffSessionPayment, + await self._request_async( + "get", + "/v2/payments/off_session_payments/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/test_helpers/__init__.py b/stripe/v2/test_helpers/__init__.py new file mode 100644 index 000000000..d93292127 --- /dev/null +++ b/stripe/v2/test_helpers/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.test_helpers._financial_address_service import ( + FinancialAddressService as FinancialAddressService, +) diff --git a/stripe/v2/test_helpers/_financial_address_service.py b/stripe/v2/test_helpers/_financial_address_service.py new file mode 100644 index 000000000..ac6561493 --- /dev/null +++ b/stripe/v2/test_helpers/_financial_address_service.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from stripe.v2._amount import AmountParam +from stripe.v2._financial_address_credit_simulation import ( + FinancialAddressCreditSimulation, +) +from stripe.v2._financial_address_generated_microdeposits import ( + FinancialAddressGeneratedMicrodeposits, +) +from typing import cast +from typing_extensions import Literal, NotRequired, TypedDict + + +class FinancialAddressService(StripeService): + class CreditParams(TypedDict): + amount: AmountParam + """ + Object containing the amount value and currency to credit. + """ + network: Literal["ach", "fps", "rtp", "wire"] + """ + Open Enum. The network to use in simulating the funds flow. This will be the reflected in the resulting ReceivedCredit. + """ + statement_descriptor: NotRequired[str] + """ + String explaining funds flow. Use this field to populate the statement descriptor of the ReceivedCredit created as an eventual result of this simulation. + """ + + class GenerateMicrodepositsParams(TypedDict): + pass + + def credit( + self, + id: str, + params: "FinancialAddressService.CreditParams", + options: RequestOptions = {}, + ) -> FinancialAddressCreditSimulation: + """ + Simulate crediting a FinancialAddress in a Sandbox environment. This can be used to add virtual funds and increase your balance for testing. + """ + return cast( + FinancialAddressCreditSimulation, + self._request( + "post", + "/v2/test_helpers/financial_addresses/{id}/credit".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def credit_async( + self, + id: str, + params: "FinancialAddressService.CreditParams", + options: RequestOptions = {}, + ) -> FinancialAddressCreditSimulation: + """ + Simulate crediting a FinancialAddress in a Sandbox environment. This can be used to add virtual funds and increase your balance for testing. + """ + return cast( + FinancialAddressCreditSimulation, + await self._request_async( + "post", + "/v2/test_helpers/financial_addresses/{id}/credit".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def generate_microdeposits( + self, + id: str, + params: "FinancialAddressService.GenerateMicrodepositsParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAddressGeneratedMicrodeposits: + """ + Generates microdeposits for a FinancialAddress in a Sandbox environment. + """ + return cast( + FinancialAddressGeneratedMicrodeposits, + self._request( + "post", + "/v2/test_helpers/financial_addresses/{id}/generate_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def generate_microdeposits_async( + self, + id: str, + params: "FinancialAddressService.GenerateMicrodepositsParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAddressGeneratedMicrodeposits: + """ + Generates microdeposits for a FinancialAddress in a Sandbox environment. + """ + return cast( + FinancialAddressGeneratedMicrodeposits, + await self._request_async( + "post", + "/v2/test_helpers/financial_addresses/{id}/generate_microdeposits".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 0c8b028d4..8917a7a95 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -622,6 +622,30 @@ def test_sets_default_http_client(self, mocker): # the newly created client is reused assert stripe.default_http_client == new_default_client + def test_add_beta_version(self): + stripe.api_version = "2024-02-26" + stripe.add_beta_version("feature_beta", "v3") + assert stripe.api_version == "2024-02-26; feature_beta=v3" + + # Same version should be ignored + stripe.add_beta_version("feature_beta", "v3") + assert stripe.api_version == "2024-02-26; feature_beta=v3" + + # Higher version should replace lower + stripe.add_beta_version("feature_beta", "v4") + assert stripe.api_version == "2024-02-26; feature_beta=v4" + + # Lower version should be ignored + stripe.add_beta_version("feature_beta", "v2") + assert stripe.api_version == "2024-02-26; feature_beta=v4" + + # Adding a new name should append + stripe.add_beta_version("another_feature_beta", "v2") + assert ( + stripe.api_version + == "2024-02-26; feature_beta=v4; another_feature_beta=v2" + ) + def test_uses_app_info(self, requestor, http_client_mock): try: old = stripe.app_info @@ -902,7 +926,6 @@ def test_extract_error_from_stream_request_for_response( ), rcode=400, ) - with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( "get", self.v1_path, {}, base_address="api" diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 90094e144..1acea3ee0 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -18425,6 +18425,80 @@ async def test_quotes_post_2_service_async( post_data="metadata[order_id]=6735", ) + def test_quotes_preview_invoices_lines_get( + self, http_client_mock: HTTPClientMock + ) -> None: + stripe.Quote.list_preview_invoice_lines( + "qt_xyz", + "in_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + query_string="", + ) + + def test_quotes_preview_invoices_lines_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.quotes.list_preview_invoice_lines( + "qt_xyz", + "in_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + query_string="", + api_base="https://api.stripe.com", + ) + + @pytest.mark.anyio + async def test_quotes_preview_invoices_lines_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.Quote.list_preview_invoice_lines_async( + "qt_xyz", + "in_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + query_string="", + ) + + @pytest.mark.anyio + async def test_quotes_preview_invoices_lines_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.quotes.list_preview_invoice_lines_async( + "qt_xyz", + "in_xyz", + ) + http_client_mock.assert_requested( + "get", + path="/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines", + query_string="", + api_base="https://api.stripe.com", + ) + def test_radar_early_fraud_warnings_get( self, http_client_mock: HTTPClientMock ) -> None: @@ -23044,6 +23118,66 @@ async def test_tax_codes_get_2_service_async( api_base="https://api.stripe.com", ) + def test_tax_forms_pdf_get(self, http_client_mock: HTTPClientMock) -> None: + stripe.tax.Form.pdf("form_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + query_string="", + ) + + def test_tax_forms_pdf_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.tax.forms.pdf("form_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + query_string="", + api_base="https://files.stripe.com", + ) + + @pytest.mark.anyio + async def test_tax_forms_pdf_get_async( + self, http_client_mock: HTTPClientMock + ) -> None: + await stripe.tax.Form.pdf_async("form_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + query_string="", + ) + + @pytest.mark.anyio + async def test_tax_forms_pdf_get_service_async( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + await client.tax.forms.pdf_async("form_xxxxxxxxxxxxx") + http_client_mock.assert_requested( + "get", + path="/v1/tax/forms/form_xxxxxxxxxxxxx/pdf", + query_string="", + api_base="https://files.stripe.com", + ) + def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.delete("taxid_123") http_client_mock.assert_requested( @@ -32990,319 +33124,467 @@ async def test_webhook_endpoints_post_2_service_async( post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) - def test_v2_billing_meter_event_session_post_service( + def test_v2_core_account_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_session", + "/v2/core/accounts/id_123/close", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_session.create() + client.v2.core.accounts.close("id_123") http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_session", + path="/v2/core/accounts/id_123/close", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_billing_meter_event_adjustment_post_service( + def test_v2_core_account_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_adjustments", + "/v2/core/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_adjustments.create( - { - "cancel": {"identifier": "identifier"}, - "event_name": "event_name", - "type": "cancel", - } - ) + client.v2.core.accounts.create() http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_adjustments", + path="/v2/core/accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', + post_data="{}", is_json=True, ) - def test_v2_billing_meter_event_stream_post_service( + def test_v2_core_account_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/billing/meter_event_stream", + "get", + "/v2/core/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_stream.create( - { - "events": [ - { - "event_name": "event_name", - "identifier": "identifier", - "payload": {"undefined": "payload"}, - "timestamp": "1970-01-01T15:18:46.294Z", - }, - ], - } - ) + client.v2.core.accounts.list() http_client_mock.assert_requested( - "post", - path="/v2/billing/meter_event_stream", + "get", + path="/v2/core/accounts", query_string="", - api_base="https://meter-events.stripe.com", - post_data='{"events":[{"event_name":"event_name","identifier":"identifier","payload":{"undefined":"payload"},"timestamp":"1970-01-01T15:18:46.294Z"}]}', - is_json=True, + api_base="https://api.stripe.com", ) - def test_v2_billing_meter_event_post_service( + def test_v2_core_account_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/billing/meter_events", + "get", + "/v2/core/accounts/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_events.create( - { - "event_name": "event_name", - "payload": {"undefined": "payload"}, - } - ) + client.v2.core.accounts.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/billing/meter_events", + "get", + path="/v2/core/accounts/id_123", query_string="", api_base="https://api.stripe.com", - post_data='{"event_name":"event_name","payload":{"undefined":"payload"}}', - is_json=True, ) - def test_v2_core_event_destination_post_service( + def test_v2_core_account_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations", + "/v2/core/accounts/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.create( - { - "enabled_events": ["enabled_events"], - "event_payload": "thin", - "name": "name", - "type": "amazon_eventbridge", - } - ) + client.v2.core.accounts.update("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations", + path="/v2/core/accounts/id_123", query_string="", api_base="https://api.stripe.com", - post_data='{"enabled_events":["enabled_events"],"event_payload":"thin","name":"name","type":"amazon_eventbridge"}', + post_data="{}", is_json=True, ) - def test_v2_core_event_destination_delete_service( + def test_v2_core_accounts_person_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v2/core/event_destinations/id_123", + "post", + "/v2/core/accounts/account_id_123/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.delete("id_123") + client.v2.core.accounts.persons.create("account_id_123") http_client_mock.assert_requested( - "delete", - path="/v2/core/event_destinations/id_123", + "post", + path="/v2/core/accounts/account_id_123/persons", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, ) - def test_v2_core_event_destination_post_2_service( + def test_v2_core_accounts_person_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/event_destinations/id_123/disable", + "delete", + "/v2/core/accounts/account_id_123/persons/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.disable("id_123") + client.v2.core.accounts.persons.delete( + "account_id_123", + "id_123", + ) http_client_mock.assert_requested( - "post", - path="/v2/core/event_destinations/id_123/disable", + "delete", + path="/v2/core/accounts/account_id_123/persons/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_core_event_destination_post_3_service( + def test_v2_core_accounts_person_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/event_destinations/id_123/enable", + "get", + "/v2/core/accounts/account_id_123/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.enable("id_123") + client.v2.core.accounts.persons.list("account_id_123") http_client_mock.assert_requested( - "post", - path="/v2/core/event_destinations/id_123/enable", + "get", + path="/v2/core/accounts/account_id_123/persons", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_core_event_destination_get_service( + def test_v2_core_accounts_person_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/core/event_destinations", + "/v2/core/accounts/account_id_123/persons/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.list() + client.v2.core.accounts.persons.retrieve( + "account_id_123", + "id_123", + ) http_client_mock.assert_requested( "get", - path="/v2/core/event_destinations", + path="/v2/core/accounts/account_id_123/persons/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_event_destination_post_4_service( + def test_v2_core_accounts_person_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123/ping", + "/v2/core/accounts/account_id_123/persons/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.ping("id_123") + client.v2.core.accounts.persons.update( + "account_id_123", + "id_123", + ) http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123/ping", + path="/v2/core/accounts/account_id_123/persons/id_123", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_event_destination_get_2_service( + def test_v2_core_account_link_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/core/event_destinations/id_123", + "post", + "/v2/core/account_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.retrieve("id_123") + client.v2.core.account_links.create( + { + "account": "account", + "use_case": { + "type": "account_onboarding", + "account_onboarding": { + "configurations": ["recipient"], + "refresh_url": "refresh_url", + "return_url": "return_url", + }, + "account_update": { + "configurations": ["recipient"], + "refresh_url": "refresh_url", + "return_url": "return_url", + }, + }, + } + ) http_client_mock.assert_requested( - "get", - path="/v2/core/event_destinations/id_123", + "post", + path="/v2/core/account_links", query_string="", api_base="https://api.stripe.com", + post_data='{"account":"account","use_case":{"type":"account_onboarding","account_onboarding":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"}}}', + is_json=True, ) - def test_v2_core_event_destination_post_5_service( + def test_v2_core_event_destination_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123", + "/v2/core/event_destinations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.update("id_123") + client.v2.core.event_destinations.create( + { + "enabled_events": ["enabled_events"], + "event_payload": "thin", + "name": "name", + "type": "amazon_eventbridge", + } + ) http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123", + path="/v2/core/event_destinations", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"enabled_events":["enabled_events"],"event_payload":"thin","name":"name","type":"amazon_eventbridge"}', is_json=True, ) - def test_v2_core_event_get_service( + def test_v2_core_event_destination_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/core/events", - "object_id=object_id", + "delete", + "/v2/core/event_destinations/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.events.list({"object_id": "object_id"}) + client.v2.core.event_destinations.delete("id_123") http_client_mock.assert_requested( - "get", - path="/v2/core/events", - query_string="object_id=object_id", + "delete", + path="/v2/core/event_destinations/id_123", + query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_event_get_2_service( + def test_v2_core_event_destination_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", + "post", + "/v2/core/event_destinations/id_123/disable", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.disable("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/disable", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123/enable", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.enable("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/enable", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_destination_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123/ping", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.ping("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123/ping", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_destination_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_destination_post_5_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/event_destinations/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/event_destinations/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_event_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/events", + "object_id=object_id", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.events.list({"object_id": "object_id"}) + http_client_mock.assert_requested( + "get", + path="/v2/core/events", + query_string="object_id=object_id", + api_base="https://api.stripe.com", + ) + + def test_v2_core_event_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", "/v2/core/events/id_123", ) client = StripeClient( @@ -33310,10 +33592,1307 @@ def test_v2_core_event_get_2_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.events.retrieve("id_123") + client.v2.core.events.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/events/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_vault_gb_bank_account_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.acknowledge_confirmation_of_payee( + "id_123", + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_vault_gb_bank_account_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/gb_bank_accounts/id_123/archive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.archive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/gb_bank_accounts/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_vault_gb_bank_account_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/gb_bank_accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.create( + { + "account_number": "account_number", + "sort_code": "sort_code", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/gb_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account_number":"account_number","sort_code":"sort_code"}', + is_json=True, + ) + + def test_v2_core_vault_gb_bank_account_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.initiate_confirmation_of_payee( + "id_123", + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_vault_gb_bank_account_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/vault/gb_bank_accounts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.gb_bank_accounts.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/vault/gb_bank_accounts/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_vault_us_bank_account_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/archive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.archive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_vault_us_bank_account_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.create( + { + "account_number": "account_number", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account_number":"account_number"}', + is_json=True, + ) + + def test_v2_core_vault_us_bank_account_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/vault/us_bank_accounts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/vault/us_bank_accounts/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_vault_us_bank_account_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_adjustment_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/adjustments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.adjustments.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/adjustments", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_adjustment_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/adjustments/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.adjustments.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/adjustments/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_financial_account_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_accounts.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_accounts", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_financial_account_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_accounts/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_accounts.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_accounts/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_financial_address_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_addresses", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_addresses.create( + { + "currency": "stn", + "financial_account": "financial_account", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_addresses", + query_string="", + api_base="https://api.stripe.com", + post_data='{"currency":"stn","financial_account":"financial_account"}', + is_json=True, + ) + + def test_v2_money_management_financial_address_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_addresses", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_addresses.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_addresses", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_financial_address_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_addresses/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_addresses.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_addresses/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_inbound_transfer_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/inbound_transfers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.inbound_transfers.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "payment_method": "payment_method", + }, + "to": { + "currency": "currency", + "financial_account": "financial_account", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/inbound_transfers", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","payment_method":"payment_method"},"to":{"currency":"currency","financial_account":"financial_account"}}', + is_json=True, + ) + + def test_v2_money_management_inbound_transfer_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/inbound_transfers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.inbound_transfers.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/inbound_transfers", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_inbound_transfer_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/inbound_transfers/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.inbound_transfers.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/inbound_transfers/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_payment_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payments.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_outbound_payment_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payments.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": { + "currency": "currency", + "payout_method": "payout_method", + "recipient": "recipient", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method","recipient":"recipient"}}', + is_json=True, + ) + + def test_v2_money_management_outbound_payment_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payments.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_payments", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_payment_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_payments/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payments.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_payments/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_payment_quote_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payment_quotes", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payment_quotes.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": { + "currency": "currency", + "payout_method": "payout_method", + "recipient": "recipient", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payment_quotes", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method","recipient":"recipient"}}', + is_json=True, + ) + + def test_v2_money_management_outbound_payment_quote_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_payment_quotes/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_payment_quotes.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_payment_quotes/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_transfer_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_transfers/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_transfers.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_transfers/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_outbound_transfer_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_transfers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_transfers.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": { + "currency": "currency", + "payout_method": "payout_method", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_transfers", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method"}}', + is_json=True, + ) + + def test_v2_money_management_outbound_transfer_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_transfers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_transfers.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_transfers", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_transfer_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_transfers/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_transfers.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_transfers/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_setup_intent_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_setup_intents/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_setup_intents.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_setup_intents/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_outbound_setup_intent_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_setup_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_setup_intents.create() + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_setup_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_outbound_setup_intent_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_setup_intents", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_setup_intents.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_setup_intents", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_setup_intent_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/outbound_setup_intents/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_setup_intents.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/outbound_setup_intents/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_outbound_setup_intent_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_setup_intents/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.outbound_setup_intents.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_setup_intents/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_payout_method_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/payout_methods/id_123/archive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods.archive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/payout_methods/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_payout_method_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/payout_methods", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/payout_methods", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_payout_method_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/payout_methods/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/payout_methods/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_payout_method_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/payout_methods/id_123/unarchive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods.unarchive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/payout_methods/id_123/unarchive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_money_management_payout_methods_bank_account_spec_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/payout_methods_bank_account_spec", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods_bank_account_spec.retrieve() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/payout_methods_bank_account_spec", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_received_credit_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/received_credits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.received_credits.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/received_credits", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_received_credit_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/received_credits/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.received_credits.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/received_credits/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_received_debit_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/received_debits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.received_debits.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/received_debits", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_received_debit_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/received_debits/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.received_debits.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/received_debits/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_transaction_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/transactions", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.transactions.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/transactions", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_transaction_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/transactions/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.transactions.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/transactions/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_transaction_entry_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/transaction_entries", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.transaction_entries.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/transaction_entries", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_transaction_entry_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/transaction_entries/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.transaction_entries.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/money_management/transaction_entries/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_billing_meter_event_session_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_session", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_session.create() + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_session", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_billing_meter_event_adjustment_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_adjustments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_adjustments.create( + { + "cancel": {"identifier": "identifier"}, + "event_name": "event_name", + "type": "cancel", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_adjustments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', + is_json=True, + ) + + def test_v2_billing_meter_event_stream_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_stream", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_stream.create( + { + "events": [ + { + "event_name": "event_name", + "identifier": "identifier", + "payload": {"undefined": "payload"}, + "timestamp": "1970-01-01T15:18:46.294Z", + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_stream", + query_string="", + api_base="https://meter-events.stripe.com", + post_data='{"events":[{"event_name":"event_name","identifier":"identifier","payload":{"undefined":"payload"},"timestamp":"1970-01-01T15:18:46.294Z"}]}', + is_json=True, + ) + + def test_v2_billing_meter_event_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_events", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_events.create( + { + "event_name": "event_name", + "payload": {"undefined": "payload"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_events", + query_string="", + api_base="https://api.stripe.com", + post_data='{"event_name":"event_name","payload":{"undefined":"payload"}}', + is_json=True, + ) + + def test_v2_test_helpers_financial_address_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/test_helpers/financial_addresses/id_123/credit", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.test_helpers.financial_addresses.credit( + "id_123", + {"amount": {"currency": "USD", "value": 96}, "network": "rtp"}, + ) + http_client_mock.assert_requested( + "post", + path="/v2/test_helpers/financial_addresses/id_123/credit", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"network":"rtp"}', + is_json=True, + ) + + def test_v2_test_helpers_financial_address_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.test_helpers.financial_addresses.generate_microdeposits( + "id_123", + ) + http_client_mock.assert_requested( + "post", + path="/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_payments_off_session_payment_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/payments/off_session_payments/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.payments.off_session_payments.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/payments/off_session_payments/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_payments_off_session_payment_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/payments/off_session_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.payments.off_session_payments.create( + { + "amount": {"currency": "USD", "value": 96}, + "cadence": "unscheduled", + "customer": "customer", + "metadata": {"undefined": "metadata"}, + "payment_method": "payment_method", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/payments/off_session_payments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"cadence":"unscheduled","customer":"customer","metadata":{"undefined":"metadata"},"payment_method":"payment_method"}', + is_json=True, + ) + + def test_v2_payments_off_session_payment_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/payments/off_session_payments", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.payments.off_session_payments.list() + http_client_mock.assert_requested( + "get", + path="/v2/payments/off_session_payments", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_payments_off_session_payment_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/payments/off_session_payments/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.payments.off_session_payments.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/core/events/id_123", + path="/v2/payments/off_session_payments/id_123", query_string="", api_base="https://api.stripe.com", ) @@ -33353,3 +34932,344 @@ def test_temporary_session_expired_error_service( post_data='{"events":[{"event_name":"event_name","payload":{"undefined":"payload"}}]}', is_json=True, ) + + def test_financial_account_not_open_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_addresses", + rbody='{"error":{"type":"financial_account_not_open","code":"financial_account_not_in_open_status"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.financial_addresses.create( + { + "currency": "stn", + "financial_account": "financial_account", + } + ) + except _error.FinancialAccountNotOpenError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_addresses", + query_string="", + api_base="https://api.stripe.com", + post_data='{"currency":"stn","financial_account":"financial_account"}', + is_json=True, + ) + + def test_blocked_by_stripe_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts", + rbody='{"error":{"type":"blocked_by_stripe","code":"inbound_transfer_not_allowed"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.create( + { + "account_number": "account_number", + } + ) + except _error.BlockedByStripeError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account_number":"account_number"}', + is_json=True, + ) + + def test_already_canceled_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments/id_123/cancel", + rbody='{"error":{"type":"already_canceled","code":"outbound_payment_already_canceled"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_payments.cancel("id_123") + except _error.AlreadyCanceledError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_not_cancelable_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments/id_123/cancel", + rbody='{"error":{"type":"not_cancelable","code":"outbound_payment_not_cancelable"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_payments.cancel("id_123") + except _error.NotCancelableError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_insufficient_funds_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments", + rbody='{"error":{"type":"insufficient_funds","code":"outbound_payment_insufficient_funds"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_payments.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": {"recipient": "recipient"}, + } + ) + except _error.InsufficientFundsError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + is_json=True, + ) + + def test_quota_exceeded_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts", + rbody='{"error":{"type":"quota_exceeded","code":"outbound_payment_recipient_amount_limit_exceeded"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.create( + { + "account_number": "account_number", + } + ) + except _error.QuotaExceededError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account_number":"account_number"}', + is_json=True, + ) + + def test_recipient_not_notifiable_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments", + rbody='{"error":{"type":"recipient_not_notifiable","code":"outbound_payment_recipient_email_does_not_exist"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_payments.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": {"recipient": "recipient"}, + } + ) + except _error.RecipientNotNotifiableError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + is_json=True, + ) + + def test_feature_not_enabled_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_payments", + rbody='{"error":{"type":"feature_not_enabled","code":"outbound_payment_recipient_feature_not_active"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_payments.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "currency", + "financial_account": "financial_account", + }, + "to": {"recipient": "recipient"}, + } + ) + except _error.FeatureNotEnabledError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_payments", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + is_json=True, + ) + + def test_invalid_payout_method_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/outbound_setup_intents", + rbody='{"error":{"type":"invalid_payout_method","code":"invalid_payout_method"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.outbound_setup_intents.create() + except _error.InvalidPayoutMethodError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/outbound_setup_intents", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_controlled_by_dashboard_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/archive", + rbody='{"error":{"type":"controlled_by_dashboard","code":"bank_account_cannot_be_archived"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.archive("id_123") + except _error.ControlledByDashboardError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_invalid_payment_method_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts", + rbody='{"error":{"type":"invalid_payment_method","code":"invalid_us_bank_account"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.create( + { + "account_number": "account_number", + } + ) + except _error.InvalidPaymentMethodError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account_number":"account_number"}', + is_json=True, + )