airbyte-agent-stripe 0.5.28__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. airbyte_agent_stripe/__init__.py +237 -0
  2. airbyte_agent_stripe/_vendored/__init__.py +1 -0
  3. airbyte_agent_stripe/_vendored/connector_sdk/__init__.py +82 -0
  4. airbyte_agent_stripe/_vendored/connector_sdk/auth_strategies.py +1123 -0
  5. airbyte_agent_stripe/_vendored/connector_sdk/auth_template.py +135 -0
  6. airbyte_agent_stripe/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
  7. airbyte_agent_stripe/_vendored/connector_sdk/cloud_utils/client.py +213 -0
  8. airbyte_agent_stripe/_vendored/connector_sdk/connector_model_loader.py +957 -0
  9. airbyte_agent_stripe/_vendored/connector_sdk/constants.py +78 -0
  10. airbyte_agent_stripe/_vendored/connector_sdk/exceptions.py +23 -0
  11. airbyte_agent_stripe/_vendored/connector_sdk/executor/__init__.py +31 -0
  12. airbyte_agent_stripe/_vendored/connector_sdk/executor/hosted_executor.py +197 -0
  13. airbyte_agent_stripe/_vendored/connector_sdk/executor/local_executor.py +1524 -0
  14. airbyte_agent_stripe/_vendored/connector_sdk/executor/models.py +190 -0
  15. airbyte_agent_stripe/_vendored/connector_sdk/extensions.py +655 -0
  16. airbyte_agent_stripe/_vendored/connector_sdk/http/__init__.py +37 -0
  17. airbyte_agent_stripe/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
  18. airbyte_agent_stripe/_vendored/connector_sdk/http/adapters/httpx_adapter.py +251 -0
  19. airbyte_agent_stripe/_vendored/connector_sdk/http/config.py +98 -0
  20. airbyte_agent_stripe/_vendored/connector_sdk/http/exceptions.py +119 -0
  21. airbyte_agent_stripe/_vendored/connector_sdk/http/protocols.py +114 -0
  22. airbyte_agent_stripe/_vendored/connector_sdk/http/response.py +102 -0
  23. airbyte_agent_stripe/_vendored/connector_sdk/http_client.py +686 -0
  24. airbyte_agent_stripe/_vendored/connector_sdk/logging/__init__.py +11 -0
  25. airbyte_agent_stripe/_vendored/connector_sdk/logging/logger.py +264 -0
  26. airbyte_agent_stripe/_vendored/connector_sdk/logging/types.py +92 -0
  27. airbyte_agent_stripe/_vendored/connector_sdk/observability/__init__.py +11 -0
  28. airbyte_agent_stripe/_vendored/connector_sdk/observability/models.py +19 -0
  29. airbyte_agent_stripe/_vendored/connector_sdk/observability/redactor.py +81 -0
  30. airbyte_agent_stripe/_vendored/connector_sdk/observability/session.py +94 -0
  31. airbyte_agent_stripe/_vendored/connector_sdk/performance/__init__.py +6 -0
  32. airbyte_agent_stripe/_vendored/connector_sdk/performance/instrumentation.py +57 -0
  33. airbyte_agent_stripe/_vendored/connector_sdk/performance/metrics.py +93 -0
  34. airbyte_agent_stripe/_vendored/connector_sdk/schema/__init__.py +75 -0
  35. airbyte_agent_stripe/_vendored/connector_sdk/schema/base.py +161 -0
  36. airbyte_agent_stripe/_vendored/connector_sdk/schema/components.py +238 -0
  37. airbyte_agent_stripe/_vendored/connector_sdk/schema/connector.py +131 -0
  38. airbyte_agent_stripe/_vendored/connector_sdk/schema/extensions.py +109 -0
  39. airbyte_agent_stripe/_vendored/connector_sdk/schema/operations.py +146 -0
  40. airbyte_agent_stripe/_vendored/connector_sdk/schema/security.py +213 -0
  41. airbyte_agent_stripe/_vendored/connector_sdk/secrets.py +182 -0
  42. airbyte_agent_stripe/_vendored/connector_sdk/telemetry/__init__.py +10 -0
  43. airbyte_agent_stripe/_vendored/connector_sdk/telemetry/config.py +32 -0
  44. airbyte_agent_stripe/_vendored/connector_sdk/telemetry/events.py +58 -0
  45. airbyte_agent_stripe/_vendored/connector_sdk/telemetry/tracker.py +151 -0
  46. airbyte_agent_stripe/_vendored/connector_sdk/types.py +241 -0
  47. airbyte_agent_stripe/_vendored/connector_sdk/utils.py +60 -0
  48. airbyte_agent_stripe/_vendored/connector_sdk/validation.py +822 -0
  49. airbyte_agent_stripe/connector.py +1579 -0
  50. airbyte_agent_stripe/connector_model.py +14869 -0
  51. airbyte_agent_stripe/models.py +2353 -0
  52. airbyte_agent_stripe/types.py +295 -0
  53. airbyte_agent_stripe-0.5.28.dist-info/METADATA +114 -0
  54. airbyte_agent_stripe-0.5.28.dist-info/RECORD +55 -0
  55. airbyte_agent_stripe-0.5.28.dist-info/WHEEL +4 -0
@@ -0,0 +1,2353 @@
1
+ """
2
+ Pydantic models for stripe connector.
3
+
4
+ This module contains Pydantic models used for authentication configuration
5
+ and response envelope types.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from pydantic import BaseModel, ConfigDict, Field
11
+ from typing import TypeVar, Generic, Union, Any
12
+
13
+ # Authentication configuration
14
+
15
+ class StripeAuthConfig(BaseModel):
16
+ """API Key Authentication"""
17
+
18
+ model_config = ConfigDict(extra="forbid")
19
+
20
+ api_key: str
21
+ """Your Stripe API Key (starts with sk_test_ or sk_live_)"""
22
+
23
+ # ===== RESPONSE TYPE DEFINITIONS (PYDANTIC) =====
24
+
25
+ class CustomerShippingAddress(BaseModel):
26
+ """Customer shipping address"""
27
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
28
+
29
+ city: Union[str | None, Any] = Field(default=None, description="City, district, suburb, town, or village")
30
+ """City, district, suburb, town, or village"""
31
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
32
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
33
+ line1: Union[str | None, Any] = Field(default=None, description="Address line 1, such as the street, PO Box, or company name")
34
+ """Address line 1, such as the street, PO Box, or company name"""
35
+ line2: Union[str | None, Any] = Field(default=None, description="Address line 2, such as the apartment, suite, unit, or building")
36
+ """Address line 2, such as the apartment, suite, unit, or building"""
37
+ postal_code: Union[str | None, Any] = Field(default=None, description="ZIP or postal code")
38
+ """ZIP or postal code"""
39
+ state: Union[str | None, Any] = Field(default=None, description="State, county, province, or region")
40
+ """State, county, province, or region"""
41
+
42
+ class CustomerShipping(BaseModel):
43
+ """Mailing and shipping address for the customer"""
44
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
45
+
46
+ address: Union[CustomerShippingAddress, Any] = Field(default=None, description="Customer shipping address")
47
+ """Customer shipping address"""
48
+ name: Union[str, Any] = Field(default=None, description="Customer name")
49
+ """Customer name"""
50
+ phone: Union[str | None, Any] = Field(default=None, description="Customer phone (including extension)")
51
+ """Customer phone (including extension)"""
52
+
53
+ class CustomerSourcesDataItem(BaseModel):
54
+ """Nested schema for CustomerSources.data_item"""
55
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
56
+
57
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
58
+ """Unique identifier for the object"""
59
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
60
+ """String representing the object's type"""
61
+ account: Union[str | None, Any] = Field(default=None, description="The account this bank account belongs to")
62
+ """The account this bank account belongs to"""
63
+ account_holder_name: Union[str | None, Any] = Field(default=None, description="The name of the person or business that owns the bank account")
64
+ """The name of the person or business that owns the bank account"""
65
+ account_holder_type: Union[str | None, Any] = Field(default=None, description="The type of entity that holds the account")
66
+ """The type of entity that holds the account"""
67
+ account_type: Union[str | None, Any] = Field(default=None, description="The bank account type")
68
+ """The bank account type"""
69
+ available_payout_methods: Union[list[str] | None, Any] = Field(default=None, description="A set of available payout methods for this bank account")
70
+ """A set of available payout methods for this bank account"""
71
+ bank_name: Union[str | None, Any] = Field(default=None, description="Name of the bank associated with the routing number")
72
+ """Name of the bank associated with the routing number"""
73
+ country: Union[str, Any] = Field(default=None, description="Two-letter ISO code representing the country the bank account is located in")
74
+ """Two-letter ISO code representing the country the bank account is located in"""
75
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO code for the currency paid out to the bank account")
76
+ """Three-letter ISO code for the currency paid out to the bank account"""
77
+ customer: Union[str | None, Any] = Field(default=None, description="The ID of the customer that the bank account is associated with")
78
+ """The ID of the customer that the bank account is associated with"""
79
+ fingerprint: Union[str | None, Any] = Field(default=None, description="Uniquely identifies this particular bank account")
80
+ """Uniquely identifies this particular bank account"""
81
+ last4: Union[str, Any] = Field(default=None, description="The last four digits of the bank account number")
82
+ """The last four digits of the bank account number"""
83
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None, description="Set of key-value pairs that you can attach to an object")
84
+ """Set of key-value pairs that you can attach to an object"""
85
+ routing_number: Union[str | None, Any] = Field(default=None, description="The routing transit number for the bank account")
86
+ """The routing transit number for the bank account"""
87
+ status: Union[str, Any] = Field(default=None, description="The status of the bank account")
88
+ """The status of the bank account"""
89
+
90
+ class CustomerSources(BaseModel):
91
+ """The customer's payment sources, if any"""
92
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
93
+
94
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
95
+ """String representing the object's type"""
96
+ data: Union[list[CustomerSourcesDataItem], Any] = Field(default=None, description="Details about each object")
97
+ """Details about each object"""
98
+ has_more: Union[bool, Any] = Field(default=None, description="True if this list has another page of items after this one")
99
+ """True if this list has another page of items after this one"""
100
+ url: Union[str, Any] = Field(default=None, description="The URL where this list can be accessed")
101
+ """The URL where this list can be accessed"""
102
+
103
+ class CustomerInvoiceSettingsCustomFieldsItem(BaseModel):
104
+ """Nested schema for CustomerInvoiceSettings.custom_fields_item"""
105
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
106
+
107
+ name: Union[str, Any] = Field(default=None, description="The name of the custom field")
108
+ """The name of the custom field"""
109
+ value: Union[str, Any] = Field(default=None, description="The value of the custom field")
110
+ """The value of the custom field"""
111
+
112
+ class CustomerInvoiceSettingsRenderingOptions(BaseModel):
113
+ """Default options for invoice PDF rendering for this customer"""
114
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
115
+
116
+ amount_tax_display: Union[str | None, Any] = Field(default=None, description="How line-item prices and amounts will be displayed with respect to tax on invoice PDFs")
117
+ """How line-item prices and amounts will be displayed with respect to tax on invoice PDFs"""
118
+ template: Union[str | None, Any] = Field(default=None, description="ID of the invoice rendering template to be used for this customer's invoices")
119
+ """ID of the invoice rendering template to be used for this customer's invoices"""
120
+
121
+ class CustomerInvoiceSettings(BaseModel):
122
+ """The customer's default invoice settings"""
123
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
124
+
125
+ custom_fields: Union[list[CustomerInvoiceSettingsCustomFieldsItem] | None, Any] = Field(default=None, description="Default custom fields to be displayed on invoices for this customer")
126
+ """Default custom fields to be displayed on invoices for this customer"""
127
+ default_payment_method: Union[str | None, Any] = Field(default=None, description="ID of a payment method that's attached to the customer")
128
+ """ID of a payment method that's attached to the customer"""
129
+ footer: Union[str | None, Any] = Field(default=None, description="Default footer to be displayed on invoices for this customer")
130
+ """Default footer to be displayed on invoices for this customer"""
131
+ rendering_options: Union[CustomerInvoiceSettingsRenderingOptions | None, Any] = Field(default=None, description="Default options for invoice PDF rendering for this customer")
132
+ """Default options for invoice PDF rendering for this customer"""
133
+
134
+ class CustomerAddress(BaseModel):
135
+ """The customer's address"""
136
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
137
+
138
+ city: Union[str | None, Any] = Field(default=None, description="City, district, suburb, town, or village")
139
+ """City, district, suburb, town, or village"""
140
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
141
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
142
+ line1: Union[str | None, Any] = Field(default=None, description="Address line 1, such as the street, PO Box, or company name")
143
+ """Address line 1, such as the street, PO Box, or company name"""
144
+ line2: Union[str | None, Any] = Field(default=None, description="Address line 2, such as the apartment, suite, unit, or building")
145
+ """Address line 2, such as the apartment, suite, unit, or building"""
146
+ postal_code: Union[str | None, Any] = Field(default=None, description="ZIP or postal code")
147
+ """ZIP or postal code"""
148
+ state: Union[str | None, Any] = Field(default=None, description="State, county, province, or region")
149
+ """State, county, province, or region"""
150
+
151
+ class CustomerCashBalanceSettings(BaseModel):
152
+ """A hash of settings for this cash balance"""
153
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
154
+
155
+ reconciliation_mode: Union[str, Any] = Field(default=None, description="The configuration for how funds that land in the customer cash balance are reconciled")
156
+ """The configuration for how funds that land in the customer cash balance are reconciled"""
157
+ using_merchant_default: Union[bool, Any] = Field(default=None, description="A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance")
158
+ """A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance"""
159
+
160
+ class CustomerCashBalance(BaseModel):
161
+ """The current funds being held by Stripe on behalf of the customer"""
162
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
163
+
164
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
165
+ """String representing the object's type"""
166
+ available: Union[dict[str, Any] | None, Any] = Field(default=None, description="A hash of all cash balances available to this customer")
167
+ """A hash of all cash balances available to this customer"""
168
+ customer: Union[str, Any] = Field(default=None, description="The ID of the customer whose cash balance this object represents")
169
+ """The ID of the customer whose cash balance this object represents"""
170
+ customer_account: Union[str | None, Any] = Field(default=None, description="The ID of the account whose cash balance this object represents")
171
+ """The ID of the account whose cash balance this object represents"""
172
+ livemode: Union[bool, Any] = Field(default=None, description="Has the value true if the object exists in live mode or false if in test mode")
173
+ """Has the value true if the object exists in live mode or false if in test mode"""
174
+ settings: Union[CustomerCashBalanceSettings, Any] = Field(default=None, description="A hash of settings for this cash balance")
175
+ """A hash of settings for this cash balance"""
176
+
177
+ class CustomerDiscountSource(BaseModel):
178
+ """The source of the discount"""
179
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
180
+
181
+ coupon: Union[str | None, Any] = Field(default=None, description="The coupon that was redeemed to create this discount")
182
+ """The coupon that was redeemed to create this discount"""
183
+ type: Union[str, Any] = Field(default=None, description="The source type of the discount")
184
+ """The source type of the discount"""
185
+
186
+ class CustomerDiscount(BaseModel):
187
+ """Describes the current discount active on the customer, if there is one"""
188
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
189
+
190
+ id: Union[str, Any] = Field(default=None, description="The ID of the discount object")
191
+ """The ID of the discount object"""
192
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
193
+ """String representing the object's type"""
194
+ checkout_session: Union[str | None, Any] = Field(default=None, description="The Checkout session that this coupon is applied to, if applicable")
195
+ """The Checkout session that this coupon is applied to, if applicable"""
196
+ customer: Union[str | None, Any] = Field(default=None, description="The ID of the customer associated with this discount")
197
+ """The ID of the customer associated with this discount"""
198
+ customer_account: Union[str | None, Any] = Field(default=None, description="The ID of the account associated with this discount")
199
+ """The ID of the account associated with this discount"""
200
+ end: Union[int | None, Any] = Field(default=None, description="If the coupon has a duration of repeating, the date that this discount will end")
201
+ """If the coupon has a duration of repeating, the date that this discount will end"""
202
+ invoice: Union[str | None, Any] = Field(default=None, description="The invoice that the discount's coupon was applied to")
203
+ """The invoice that the discount's coupon was applied to"""
204
+ invoice_item: Union[str | None, Any] = Field(default=None, description="The invoice item that the discount's coupon was applied to")
205
+ """The invoice item that the discount's coupon was applied to"""
206
+ promotion_code: Union[str | None, Any] = Field(default=None, description="The promotion code applied to create this discount")
207
+ """The promotion code applied to create this discount"""
208
+ source: Union[CustomerDiscountSource, Any] = Field(default=None, description="The source of the discount")
209
+ """The source of the discount"""
210
+ start: Union[int, Any] = Field(default=None, description="Date that the coupon was applied")
211
+ """Date that the coupon was applied"""
212
+ subscription: Union[str | None, Any] = Field(default=None, description="The subscription that this coupon is applied to")
213
+ """The subscription that this coupon is applied to"""
214
+ subscription_item: Union[str | None, Any] = Field(default=None, description="The subscription item that this coupon is applied to")
215
+ """The subscription item that this coupon is applied to"""
216
+
217
+ class SubscriptionBillingCycleAnchorConfig(BaseModel):
218
+ """The fixed values used to calculate the billing_cycle_anchor"""
219
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
220
+
221
+ day_of_month: Union[int, Any] = Field(default=None, description="The day of the month of the billing_cycle_anchor")
222
+ """The day of the month of the billing_cycle_anchor"""
223
+ hour: Union[int | None, Any] = Field(default=None, description="The hour of the day of the billing_cycle_anchor")
224
+ """The hour of the day of the billing_cycle_anchor"""
225
+ minute: Union[int | None, Any] = Field(default=None, description="The minute of the hour of the billing_cycle_anchor")
226
+ """The minute of the hour of the billing_cycle_anchor"""
227
+ month: Union[int | None, Any] = Field(default=None, description="The month to start full cycle billing periods")
228
+ """The month to start full cycle billing periods"""
229
+ second: Union[int | None, Any] = Field(default=None, description="The second of the minute of the billing_cycle_anchor")
230
+ """The second of the minute of the billing_cycle_anchor"""
231
+
232
+ class SubscriptionPauseCollection(BaseModel):
233
+ """If specified, payment collection for this subscription will be paused"""
234
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
235
+
236
+ behavior: Union[str, Any] = Field(default=None, description="The payment collection behavior for this subscription while paused")
237
+ """The payment collection behavior for this subscription while paused"""
238
+ resumes_at: Union[int | None, Any] = Field(default=None, description="The time after which the subscription will resume collecting payments")
239
+ """The time after which the subscription will resume collecting payments"""
240
+
241
+ class SubscriptionBillingModeFlexible(BaseModel):
242
+ """Configure behavior for flexible billing mode"""
243
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
244
+
245
+ proration_discounts: Union[str, Any] = Field(default=None, description="Controls how invoices and invoice items display proration amounts and discount amounts")
246
+ """Controls how invoices and invoice items display proration amounts and discount amounts"""
247
+
248
+ class SubscriptionBillingMode(BaseModel):
249
+ """Controls how prorations and invoices for subscriptions are calculated and orchestrated"""
250
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
251
+
252
+ flexible: Union[SubscriptionBillingModeFlexible | None, Any] = Field(default=None, description="Configure behavior for flexible billing mode")
253
+ """Configure behavior for flexible billing mode"""
254
+ type: Union[str, Any] = Field(default=None, description="Controls how prorations and invoices for subscriptions are calculated and orchestrated")
255
+ """Controls how prorations and invoices for subscriptions are calculated and orchestrated"""
256
+ updated_at: Union[int | None, Any] = Field(default=None, description="Details on when the current billing_mode was adopted")
257
+ """Details on when the current billing_mode was adopted"""
258
+
259
+ class SubscriptionPaymentSettings(BaseModel):
260
+ """Payment settings passed on to invoices created by the subscription"""
261
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
262
+
263
+ payment_method_options: Union[dict[str, Any] | None, Any] = Field(default=None, description="Payment-method-specific configuration to provide to invoices")
264
+ """Payment-method-specific configuration to provide to invoices"""
265
+ payment_method_types: Union[list[str] | None, Any] = Field(default=None, description="The list of payment method types to provide to every invoice")
266
+ """The list of payment method types to provide to every invoice"""
267
+
268
+ class SubscriptionDefaultTaxRatesItemFlatAmount(BaseModel):
269
+ """The amount of the tax rate when the rate_type is flat_amount"""
270
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
271
+
272
+ amount: Union[int, Any] = Field(default=None, description="Amount of the tax when the rate_type is flat_amount")
273
+ """Amount of the tax when the rate_type is flat_amount"""
274
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
275
+ """Three-letter ISO currency code, in lowercase"""
276
+
277
+ class SubscriptionDefaultTaxRatesItem(BaseModel):
278
+ """Nested schema for Subscription.default_tax_rates_item"""
279
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
280
+
281
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
282
+ """Unique identifier for the object"""
283
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
284
+ """String representing the object's type"""
285
+ active: Union[bool, Any] = Field(default=None, description="Defaults to true")
286
+ """Defaults to true"""
287
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
288
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
289
+ created: Union[int, Any] = Field(default=None, description="Time at which the object was created")
290
+ """Time at which the object was created"""
291
+ description: Union[str | None, Any] = Field(default=None, description="An arbitrary string attached to the tax rate for your internal use only")
292
+ """An arbitrary string attached to the tax rate for your internal use only"""
293
+ display_name: Union[str, Any] = Field(default=None, description="The display name of the tax rates")
294
+ """The display name of the tax rates"""
295
+ effective_percentage: Union[float | None, Any] = Field(default=None, description="Actual/effective tax rate percentage out of 100")
296
+ """Actual/effective tax rate percentage out of 100"""
297
+ flat_amount: Union[SubscriptionDefaultTaxRatesItemFlatAmount | None, Any] = Field(default=None, description="The amount of the tax rate when the rate_type is flat_amount")
298
+ """The amount of the tax rate when the rate_type is flat_amount"""
299
+ inclusive: Union[bool, Any] = Field(default=None, description="This specifies if the tax rate is inclusive or exclusive")
300
+ """This specifies if the tax rate is inclusive or exclusive"""
301
+ jurisdiction: Union[str | None, Any] = Field(default=None, description="The jurisdiction for the tax rate")
302
+ """The jurisdiction for the tax rate"""
303
+ jurisdiction_level: Union[str | None, Any] = Field(default=None, description="The level of the jurisdiction that imposes this tax rate")
304
+ """The level of the jurisdiction that imposes this tax rate"""
305
+ livemode: Union[bool, Any] = Field(default=None, description="Has the value true if the object exists in live mode or false if in test mode")
306
+ """Has the value true if the object exists in live mode or false if in test mode"""
307
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None, description="Set of key-value pairs")
308
+ """Set of key-value pairs"""
309
+ percentage: Union[float, Any] = Field(default=None, description="Tax rate percentage out of 100")
310
+ """Tax rate percentage out of 100"""
311
+ rate_type: Union[str | None, Any] = Field(default=None, description="Indicates the type of tax rate applied to the taxable amount")
312
+ """Indicates the type of tax rate applied to the taxable amount"""
313
+ state: Union[str | None, Any] = Field(default=None, description="ISO 3166-2 subdivision code, without country prefix")
314
+ """ISO 3166-2 subdivision code, without country prefix"""
315
+ tax_type: Union[str | None, Any] = Field(default=None, description="The high-level tax type")
316
+ """The high-level tax type"""
317
+
318
+ class SubscriptionCancellationDetails(BaseModel):
319
+ """Details about why this subscription was cancelled"""
320
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
321
+
322
+ comment: Union[str | None, Any] = Field(default=None, description="Additional comments about why the user canceled the subscription")
323
+ """Additional comments about why the user canceled the subscription"""
324
+ feedback: Union[str | None, Any] = Field(default=None, description="The customer submitted reason for why they canceled")
325
+ """The customer submitted reason for why they canceled"""
326
+ reason: Union[str | None, Any] = Field(default=None, description="Why this subscription was canceled")
327
+ """Why this subscription was canceled"""
328
+
329
+ class SubscriptionTrialSettingsEndBehavior(BaseModel):
330
+ """Nested schema for SubscriptionTrialSettings.end_behavior"""
331
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
332
+
333
+ missing_payment_method: Union[str, Any] = Field(default=None, description="Behavior when the trial ends and payment method is missing")
334
+ """Behavior when the trial ends and payment method is missing"""
335
+
336
+ class SubscriptionTrialSettings(BaseModel):
337
+ """Settings related to subscription trials"""
338
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
339
+
340
+ end_behavior: Union[SubscriptionTrialSettingsEndBehavior, Any] = Field(default=None)
341
+
342
+ class SubscriptionBillingThresholds(BaseModel):
343
+ """Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period"""
344
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
345
+
346
+ amount_gte: Union[int | None, Any] = Field(default=None, description="Monetary threshold that triggers the subscription to create an invoice")
347
+ """Monetary threshold that triggers the subscription to create an invoice"""
348
+ reset_billing_cycle_anchor: Union[bool | None, Any] = Field(default=None, description="Indicates if the billing_cycle_anchor should be reset when a threshold is reached")
349
+ """Indicates if the billing_cycle_anchor should be reset when a threshold is reached"""
350
+
351
+ class SubscriptionInvoiceSettingsIssuer(BaseModel):
352
+ """The connected account that issues the invoice"""
353
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
354
+
355
+ account: Union[str | None, Any] = Field(default=None, description="The connected account being referenced when type is account")
356
+ """The connected account being referenced when type is account"""
357
+ type: Union[str, Any] = Field(default=None, description="Type of the account referenced")
358
+ """Type of the account referenced"""
359
+
360
+ class SubscriptionInvoiceSettings(BaseModel):
361
+ """All invoices will be billed using the specified settings"""
362
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
363
+
364
+ account_tax_ids: Union[list[str] | None, Any] = Field(default=None, description="The account tax IDs associated with the subscription")
365
+ """The account tax IDs associated with the subscription"""
366
+ issuer: Union[SubscriptionInvoiceSettingsIssuer, Any] = Field(default=None, description="The connected account that issues the invoice")
367
+ """The connected account that issues the invoice"""
368
+
369
+ class SubscriptionAutomaticTaxLiability(BaseModel):
370
+ """The account that's liable for tax"""
371
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
372
+
373
+ account: Union[str | None, Any] = Field(default=None, description="The connected account being referenced when type is account")
374
+ """The connected account being referenced when type is account"""
375
+ type: Union[str, Any] = Field(default=None, description="Type of the account referenced")
376
+ """Type of the account referenced"""
377
+
378
+ class SubscriptionAutomaticTax(BaseModel):
379
+ """Automatic tax settings for this subscription"""
380
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
381
+
382
+ disabled_reason: Union[str | None, Any] = Field(default=None, description="If Stripe disabled automatic tax, this enum describes why")
383
+ """If Stripe disabled automatic tax, this enum describes why"""
384
+ enabled: Union[bool, Any] = Field(default=None, description="Whether Stripe automatically computes tax on this subscription")
385
+ """Whether Stripe automatically computes tax on this subscription"""
386
+ liability: Union[SubscriptionAutomaticTaxLiability | None, Any] = Field(default=None, description="The account that's liable for tax")
387
+ """The account that's liable for tax"""
388
+
389
+ class SubscriptionItemsDataItemBillingThresholds(BaseModel):
390
+ """Define thresholds at which an invoice will be sent"""
391
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
392
+
393
+ usage_gte: Union[int | None, Any] = Field(default=None, description="Usage threshold that triggers the subscription to create an invoice")
394
+ """Usage threshold that triggers the subscription to create an invoice"""
395
+
396
+ class SubscriptionItemsDataItem(BaseModel):
397
+ """Nested schema for SubscriptionItems.data_item"""
398
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
399
+
400
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
401
+ """Unique identifier for the object"""
402
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
403
+ """String representing the object's type"""
404
+ billing_thresholds: Union[SubscriptionItemsDataItemBillingThresholds | None, Any] = Field(default=None, description="Define thresholds at which an invoice will be sent")
405
+ """Define thresholds at which an invoice will be sent"""
406
+ created: Union[int, Any] = Field(default=None, description="Time at which the object was created")
407
+ """Time at which the object was created"""
408
+ current_period_end: Union[int, Any] = Field(default=None, description="The end time of this subscription item's current billing period")
409
+ """The end time of this subscription item's current billing period"""
410
+ current_period_start: Union[int, Any] = Field(default=None, description="The start time of this subscription item's current billing period")
411
+ """The start time of this subscription item's current billing period"""
412
+ discounts: Union[list[str], Any] = Field(default=None, description="The discounts applied to the subscription item")
413
+ """The discounts applied to the subscription item"""
414
+ metadata: Union[dict[str, str], Any] = Field(default=None, description="Set of key-value pairs")
415
+ """Set of key-value pairs"""
416
+ plan: Union[dict[str, Any] | None, Any] = Field(default=None, description="The plan the customer is subscribed to (deprecated, use price instead)")
417
+ """The plan the customer is subscribed to (deprecated, use price instead)"""
418
+ price: Union[dict[str, Any], Any] = Field(default=None, description="The price the customer is subscribed to")
419
+ """The price the customer is subscribed to"""
420
+ quantity: Union[int | None, Any] = Field(default=None, description="The quantity of the plan to which the customer should be subscribed")
421
+ """The quantity of the plan to which the customer should be subscribed"""
422
+ subscription: Union[str, Any] = Field(default=None, description="The subscription this subscription_item belongs to")
423
+ """The subscription this subscription_item belongs to"""
424
+ tax_rates: Union[list[dict[str, Any]] | None, Any] = Field(default=None, description="The tax rates which apply to this subscription_item")
425
+ """The tax rates which apply to this subscription_item"""
426
+
427
+ class SubscriptionItems(BaseModel):
428
+ """List of subscription items, each with an attached price"""
429
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
430
+
431
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
432
+ """String representing the object's type"""
433
+ data: Union[list[SubscriptionItemsDataItem], Any] = Field(default=None, description="Details about each object")
434
+ """Details about each object"""
435
+ has_more: Union[bool, Any] = Field(default=None, description="True if this list has another page of items after this one")
436
+ """True if this list has another page of items after this one"""
437
+ url: Union[str, Any] = Field(default=None, description="The URL where this list can be accessed")
438
+ """The URL where this list can be accessed"""
439
+ total_count: Union[int, Any] = Field(default=None, description="The total count of items in the list")
440
+ """The total count of items in the list"""
441
+
442
+ class Subscription(BaseModel):
443
+ """Subscription type definition"""
444
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
445
+
446
+ id: Union[str, Any] = Field(default=None)
447
+ object: Union[str, Any] = Field(default=None)
448
+ application: Union[str | None, Any] = Field(default=None)
449
+ application_fee_percent: Union[float | None, Any] = Field(default=None)
450
+ automatic_tax: Union[SubscriptionAutomaticTax, Any] = Field(default=None)
451
+ billing_cycle_anchor: Union[int, Any] = Field(default=None)
452
+ billing_cycle_anchor_config: Union[SubscriptionBillingCycleAnchorConfig | None, Any] = Field(default=None)
453
+ billing_mode: Union[SubscriptionBillingMode, Any] = Field(default=None)
454
+ billing_thresholds: Union[SubscriptionBillingThresholds | None, Any] = Field(default=None)
455
+ cancel_at: Union[int | None, Any] = Field(default=None)
456
+ cancel_at_period_end: Union[bool, Any] = Field(default=None)
457
+ canceled_at: Union[int | None, Any] = Field(default=None)
458
+ cancellation_details: Union[SubscriptionCancellationDetails | None, Any] = Field(default=None)
459
+ collection_method: Union[str, Any] = Field(default=None)
460
+ created: Union[int, Any] = Field(default=None)
461
+ currency: Union[str, Any] = Field(default=None)
462
+ customer: Union[str, Any] = Field(default=None)
463
+ customer_account: Union[str | None, Any] = Field(default=None)
464
+ days_until_due: Union[int | None, Any] = Field(default=None)
465
+ default_payment_method: Union[str | None, Any] = Field(default=None)
466
+ default_source: Union[str | None, Any] = Field(default=None)
467
+ default_tax_rates: Union[list[SubscriptionDefaultTaxRatesItem] | None, Any] = Field(default=None)
468
+ description: Union[str | None, Any] = Field(default=None)
469
+ discounts: Union[list[str], Any] = Field(default=None)
470
+ ended_at: Union[int | None, Any] = Field(default=None)
471
+ invoice_settings: Union[SubscriptionInvoiceSettings, Any] = Field(default=None)
472
+ items: Union[SubscriptionItems, Any] = Field(default=None)
473
+ latest_invoice: Union[str | None, Any] = Field(default=None)
474
+ livemode: Union[bool, Any] = Field(default=None)
475
+ metadata: Union[dict[str, str], Any] = Field(default=None)
476
+ next_pending_invoice_item_invoice: Union[int | None, Any] = Field(default=None)
477
+ on_behalf_of: Union[str | None, Any] = Field(default=None)
478
+ pause_collection: Union[SubscriptionPauseCollection | None, Any] = Field(default=None)
479
+ payment_settings: Union[SubscriptionPaymentSettings | None, Any] = Field(default=None)
480
+ status: Union[str, Any] = Field(default=None)
481
+ current_period_start: Union[int, Any] = Field(default=None)
482
+ current_period_end: Union[int, Any] = Field(default=None)
483
+ start_date: Union[int, Any] = Field(default=None)
484
+ trial_start: Union[int | None, Any] = Field(default=None)
485
+ trial_end: Union[int | None, Any] = Field(default=None)
486
+ discount: Union[dict[str, Any] | None, Any] = Field(default=None)
487
+ plan: Union[dict[str, Any] | None, Any] = Field(default=None)
488
+ quantity: Union[int | None, Any] = Field(default=None)
489
+ schedule: Union[str | None, Any] = Field(default=None)
490
+ test_clock: Union[str | None, Any] = Field(default=None)
491
+ transfer_data: Union[dict[str, Any] | None, Any] = Field(default=None)
492
+ trial_settings: Union[SubscriptionTrialSettings | None, Any] = Field(default=None)
493
+ pending_invoice_item_interval: Union[dict[str, Any] | None, Any] = Field(default=None)
494
+ pending_setup_intent: Union[str | None, Any] = Field(default=None)
495
+ pending_update: Union[dict[str, Any] | None, Any] = Field(default=None)
496
+
497
+ class CustomerSubscriptions(BaseModel):
498
+ """The customer's current subscriptions, if any"""
499
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
500
+
501
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
502
+ """String representing the object's type"""
503
+ data: Union[list[Subscription], Any] = Field(default=None, description="Details about each subscription")
504
+ """Details about each subscription"""
505
+ has_more: Union[bool, Any] = Field(default=None, description="True if this list has another page of items after this one")
506
+ """True if this list has another page of items after this one"""
507
+ url: Union[str, Any] = Field(default=None, description="The URL where this list can be accessed")
508
+ """The URL where this list can be accessed"""
509
+
510
+ class Customer(BaseModel):
511
+ """Customer type definition"""
512
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
513
+
514
+ id: Union[str, Any] = Field(default=None)
515
+ object: Union[str, Any] = Field(default=None)
516
+ address: Union[CustomerAddress | None, Any] = Field(default=None)
517
+ balance: Union[int, Any] = Field(default=None)
518
+ business_name: Union[str | None, Any] = Field(default=None)
519
+ cash_balance: Union[CustomerCashBalance | None, Any] = Field(default=None)
520
+ created: Union[int, Any] = Field(default=None)
521
+ currency: Union[str | None, Any] = Field(default=None)
522
+ customer_account: Union[str | None, Any] = Field(default=None)
523
+ default_currency: Union[str | None, Any] = Field(default=None)
524
+ default_source: Union[str | None, Any] = Field(default=None)
525
+ delinquent: Union[bool | None, Any] = Field(default=None)
526
+ description: Union[str | None, Any] = Field(default=None)
527
+ discount: Union[CustomerDiscount | None, Any] = Field(default=None)
528
+ email: Union[str | None, Any] = Field(default=None)
529
+ individual_name: Union[str | None, Any] = Field(default=None)
530
+ invoice_credit_balance: Union[dict[str, Any], Any] = Field(default=None)
531
+ invoice_prefix: Union[str | None, Any] = Field(default=None)
532
+ invoice_settings: Union[CustomerInvoiceSettings, Any] = Field(default=None)
533
+ livemode: Union[bool, Any] = Field(default=None)
534
+ metadata: Union[dict[str, str], Any] = Field(default=None)
535
+ name: Union[str | None, Any] = Field(default=None)
536
+ next_invoice_sequence: Union[int | None, Any] = Field(default=None)
537
+ phone: Union[str | None, Any] = Field(default=None)
538
+ preferred_locales: Union[list[str] | None, Any] = Field(default=None)
539
+ shipping: Union[CustomerShipping | None, Any] = Field(default=None)
540
+ sources: Union[CustomerSources | None, Any] = Field(default=None)
541
+ subscriptions: Union[CustomerSubscriptions | None, Any] = Field(default=None)
542
+ tax_exempt: Union[str | None, Any] = Field(default=None)
543
+ test_clock: Union[str | None, Any] = Field(default=None)
544
+
545
+ class CustomerList(BaseModel):
546
+ """CustomerList type definition"""
547
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
548
+
549
+ object: Union[str, Any] = Field(default=None)
550
+ data: Union[list[Customer], Any] = Field(default=None)
551
+ has_more: Union[bool, Any] = Field(default=None)
552
+ url: Union[str, Any] = Field(default=None)
553
+
554
+ class InvoiceConfirmationSecret(BaseModel):
555
+ """The confirmation secret associated with this invoice"""
556
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
557
+
558
+ client_secret: Union[str, Any] = Field(default=None, description="The client_secret of the payment that Stripe creates for the invoice after finalization")
559
+ """The client_secret of the payment that Stripe creates for the invoice after finalization"""
560
+ type: Union[str, Any] = Field(default=None, description="The type of client_secret")
561
+ """The type of client_secret"""
562
+
563
+ class InvoiceSubscriptionDetails(BaseModel):
564
+ """Details about the subscription that this invoice was prepared for, if any"""
565
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
566
+
567
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None, description="Set of key-value pairs defined as subscription metadata when the invoice is created")
568
+ """Set of key-value pairs defined as subscription metadata when the invoice is created"""
569
+
570
+ class InvoiceIssuer(BaseModel):
571
+ """The connected account that issues the invoice"""
572
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
573
+
574
+ account: Union[str | None, Any] = Field(default=None, description="The connected account being referenced when type is account")
575
+ """The connected account being referenced when type is account"""
576
+ type: Union[str, Any] = Field(default=None, description="Type of the account referenced")
577
+ """Type of the account referenced"""
578
+
579
+ class InvoiceTotalTaxAmountsItem(BaseModel):
580
+ """Nested schema for Invoice.total_tax_amounts_item"""
581
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
582
+
583
+ amount: Union[int, Any] = Field(default=None, description="The amount of the tax")
584
+ """The amount of the tax"""
585
+ inclusive: Union[bool, Any] = Field(default=None, description="Whether the tax amount is included in the line item amount")
586
+ """Whether the tax amount is included in the line item amount"""
587
+ tax_rate: Union[str, Any] = Field(default=None, description="The tax rate applied")
588
+ """The tax rate applied"""
589
+ taxability_reason: Union[str | None, Any] = Field(default=None, description="The reasoning behind the tax")
590
+ """The reasoning behind the tax"""
591
+ taxable_amount: Union[int, Any] = Field(default=None, description="The amount on which tax is calculated")
592
+ """The amount on which tax is calculated"""
593
+
594
+ class InvoiceTotalDiscountAmountsItem(BaseModel):
595
+ """Nested schema for Invoice.total_discount_amounts_item"""
596
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
597
+
598
+ amount: Union[int, Any] = Field(default=None, description="The amount of the discount")
599
+ """The amount of the discount"""
600
+ discount: Union[str, Any] = Field(default=None, description="The discount that was applied")
601
+ """The discount that was applied"""
602
+
603
+ class InvoiceAutomaticTaxLiability(BaseModel):
604
+ """The account that's liable for tax"""
605
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
606
+
607
+ account: Union[str | None, Any] = Field(default=None, description="The connected account being referenced when type is account")
608
+ """The connected account being referenced when type is account"""
609
+ type: Union[str, Any] = Field(default=None, description="Type of the account referenced")
610
+ """Type of the account referenced"""
611
+
612
+ class InvoiceAutomaticTax(BaseModel):
613
+ """Settings and latest results for automatic tax lookup for this invoice"""
614
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
615
+
616
+ disabled_reason: Union[str | None, Any] = Field(default=None, description="If Stripe disabled automatic tax, this enum describes why")
617
+ """If Stripe disabled automatic tax, this enum describes why"""
618
+ enabled: Union[bool, Any] = Field(default=None, description="Whether Stripe automatically computes tax on this invoice")
619
+ """Whether Stripe automatically computes tax on this invoice"""
620
+ liability: Union[InvoiceAutomaticTaxLiability | None, Any] = Field(default=None, description="The account that's liable for tax")
621
+ """The account that's liable for tax"""
622
+ provider: Union[str | None, Any] = Field(default=None, description="The tax provider powering automatic tax")
623
+ """The tax provider powering automatic tax"""
624
+ status: Union[str | None, Any] = Field(default=None, description="The status of the most recent automated tax calculation for this invoice")
625
+ """The status of the most recent automated tax calculation for this invoice"""
626
+
627
+ class InvoiceStatusTransitions(BaseModel):
628
+ """Status transition timestamps"""
629
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
630
+
631
+ finalized_at: Union[int | None, Any] = Field(default=None, description="The time that the invoice draft was finalized")
632
+ """The time that the invoice draft was finalized"""
633
+ marked_uncollectible_at: Union[int | None, Any] = Field(default=None, description="The time that the invoice was marked uncollectible")
634
+ """The time that the invoice was marked uncollectible"""
635
+ paid_at: Union[int | None, Any] = Field(default=None, description="The time that the invoice was paid")
636
+ """The time that the invoice was paid"""
637
+ voided_at: Union[int | None, Any] = Field(default=None, description="The time that the invoice was voided")
638
+ """The time that the invoice was voided"""
639
+
640
+ class InvoiceLinesDataItemDiscountAmountsItem(BaseModel):
641
+ """Nested schema for InvoiceLinesDataItem.discount_amounts_item"""
642
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
643
+
644
+ amount: Union[int, Any] = Field(default=None, description="The amount of the discount")
645
+ """The amount of the discount"""
646
+ discount: Union[str, Any] = Field(default=None, description="The discount that was applied")
647
+ """The discount that was applied"""
648
+
649
+ class InvoiceLinesDataItemPeriod(BaseModel):
650
+ """The period this line_item covers"""
651
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
652
+
653
+ end: Union[int, Any] = Field(default=None, description="The end of the period")
654
+ """The end of the period"""
655
+ start: Union[int, Any] = Field(default=None, description="The start of the period")
656
+ """The start of the period"""
657
+
658
+ class InvoiceLinesDataItem(BaseModel):
659
+ """Nested schema for InvoiceLines.data_item"""
660
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
661
+
662
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
663
+ """Unique identifier for the object"""
664
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
665
+ """String representing the object's type"""
666
+ amount: Union[int, Any] = Field(default=None, description="The amount in cents")
667
+ """The amount in cents"""
668
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
669
+ """Three-letter ISO currency code"""
670
+ description: Union[str | None, Any] = Field(default=None, description="An arbitrary string attached to the object")
671
+ """An arbitrary string attached to the object"""
672
+ discount_amounts: Union[list[InvoiceLinesDataItemDiscountAmountsItem] | None, Any] = Field(default=None, description="The amount of discount calculated per discount for this line item")
673
+ """The amount of discount calculated per discount for this line item"""
674
+ discountable: Union[bool, Any] = Field(default=None, description="If true, discounts will apply to this line item")
675
+ """If true, discounts will apply to this line item"""
676
+ discounts: Union[list[str], Any] = Field(default=None, description="The discounts applied to the invoice line item")
677
+ """The discounts applied to the invoice line item"""
678
+ invoice: Union[str | None, Any] = Field(default=None, description="The ID of the invoice that contains this line item")
679
+ """The ID of the invoice that contains this line item"""
680
+ livemode: Union[bool, Any] = Field(default=None, description="Has the value true if the object exists in live mode")
681
+ """Has the value true if the object exists in live mode"""
682
+ metadata: Union[dict[str, str], Any] = Field(default=None, description="Set of key-value pairs")
683
+ """Set of key-value pairs"""
684
+ period: Union[InvoiceLinesDataItemPeriod, Any] = Field(default=None, description="The period this line_item covers")
685
+ """The period this line_item covers"""
686
+ proration: Union[bool, Any] = Field(default=None, description="Whether this is a proration")
687
+ """Whether this is a proration"""
688
+ quantity: Union[int | None, Any] = Field(default=None, description="The quantity of the subscription")
689
+ """The quantity of the subscription"""
690
+
691
+ class InvoiceLines(BaseModel):
692
+ """The individual line items that make up the invoice"""
693
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
694
+
695
+ object: Union[str, Any] = Field(default=None)
696
+ data: Union[list[InvoiceLinesDataItem], Any] = Field(default=None)
697
+ has_more: Union[bool, Any] = Field(default=None)
698
+ total_count: Union[int | None, Any] = Field(default=None)
699
+ url: Union[str | None, Any] = Field(default=None)
700
+
701
+ class InvoiceShippingDetailsAddress(BaseModel):
702
+ """Shipping address"""
703
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
704
+
705
+ city: Union[str | None, Any] = Field(default=None, description="City, district, suburb, town, or village")
706
+ """City, district, suburb, town, or village"""
707
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
708
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
709
+ line1: Union[str | None, Any] = Field(default=None, description="Address line 1")
710
+ """Address line 1"""
711
+ line2: Union[str | None, Any] = Field(default=None, description="Address line 2")
712
+ """Address line 2"""
713
+ postal_code: Union[str | None, Any] = Field(default=None, description="ZIP or postal code")
714
+ """ZIP or postal code"""
715
+ state: Union[str | None, Any] = Field(default=None, description="State, county, province, or region")
716
+ """State, county, province, or region"""
717
+
718
+ class InvoiceShippingDetails(BaseModel):
719
+ """Shipping details for the invoice"""
720
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
721
+
722
+ address: Union[InvoiceShippingDetailsAddress, Any] = Field(default=None, description="Shipping address")
723
+ """Shipping address"""
724
+ name: Union[str, Any] = Field(default=None, description="Recipient name")
725
+ """Recipient name"""
726
+ phone: Union[str | None, Any] = Field(default=None, description="Recipient phone")
727
+ """Recipient phone"""
728
+
729
+ class InvoiceFromInvoice(BaseModel):
730
+ """Details of the invoice that was cloned"""
731
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
732
+
733
+ action: Union[str, Any] = Field(default=None)
734
+ invoice: Union[str, Any] = Field(default=None)
735
+
736
+ class InvoiceCustomerAddress(BaseModel):
737
+ """The customer's address"""
738
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
739
+
740
+ city: Union[str | None, Any] = Field(default=None, description="City, district, suburb, town, or village")
741
+ """City, district, suburb, town, or village"""
742
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
743
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
744
+ line1: Union[str | None, Any] = Field(default=None, description="Address line 1")
745
+ """Address line 1"""
746
+ line2: Union[str | None, Any] = Field(default=None, description="Address line 2")
747
+ """Address line 2"""
748
+ postal_code: Union[str | None, Any] = Field(default=None, description="ZIP or postal code")
749
+ """ZIP or postal code"""
750
+ state: Union[str | None, Any] = Field(default=None, description="State, county, province, or region")
751
+ """State, county, province, or region"""
752
+
753
+ class InvoiceThresholdReasonItemReasonsItem(BaseModel):
754
+ """Nested schema for InvoiceThresholdReason.item_reasons_item"""
755
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
756
+
757
+ line_item_ids: Union[list[str], Any] = Field(default=None, description="The IDs of the line items that triggered the threshold invoice")
758
+ """The IDs of the line items that triggered the threshold invoice"""
759
+ usage_gte: Union[int, Any] = Field(default=None, description="The quantity threshold boundary that applied to the given line item")
760
+ """The quantity threshold boundary that applied to the given line item"""
761
+
762
+ class InvoiceThresholdReason(BaseModel):
763
+ """If billing_reason is set to subscription_threshold this returns more information"""
764
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
765
+
766
+ amount_gte: Union[int | None, Any] = Field(default=None, description="The total invoice amount threshold boundary if it triggered the threshold invoice")
767
+ """The total invoice amount threshold boundary if it triggered the threshold invoice"""
768
+ item_reasons: Union[list[InvoiceThresholdReasonItemReasonsItem], Any] = Field(default=None, description="Indicates which line items triggered a threshold invoice")
769
+ """Indicates which line items triggered a threshold invoice"""
770
+
771
+ class InvoiceTotalPretaxCreditAmountsItem(BaseModel):
772
+ """Nested schema for Invoice.total_pretax_credit_amounts_item"""
773
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
774
+
775
+ amount: Union[int, Any] = Field(default=None, description="The amount of the pretax credit amount")
776
+ """The amount of the pretax credit amount"""
777
+ credit_balance_transaction: Union[str | None, Any] = Field(default=None, description="The credit balance transaction that was applied")
778
+ """The credit balance transaction that was applied"""
779
+ discount: Union[str | None, Any] = Field(default=None, description="The discount that was applied")
780
+ """The discount that was applied"""
781
+ type: Union[str, Any] = Field(default=None, description="Type of the pretax credit amount referenced")
782
+ """Type of the pretax credit amount referenced"""
783
+
784
+ class InvoicePaymentSettings(BaseModel):
785
+ """Configuration settings for the PaymentIntent that is generated when the invoice is finalized"""
786
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
787
+
788
+ default_mandate: Union[str | None, Any] = Field(default=None, description="ID of the mandate to be used for this invoice")
789
+ """ID of the mandate to be used for this invoice"""
790
+ payment_method_options: Union[dict[str, Any] | None, Any] = Field(default=None, description="Payment-method-specific configuration to provide to the invoice's PaymentIntent")
791
+ """Payment-method-specific configuration to provide to the invoice's PaymentIntent"""
792
+ payment_method_types: Union[list[str] | None, Any] = Field(default=None, description="The list of payment method types to provide to the invoice's PaymentIntent")
793
+ """The list of payment method types to provide to the invoice's PaymentIntent"""
794
+
795
+ class InvoiceCustomerTaxIdsItem(BaseModel):
796
+ """Nested schema for Invoice.customer_tax_ids_item"""
797
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
798
+
799
+ type: Union[str, Any] = Field(default=None, description="The type of the tax ID")
800
+ """The type of the tax ID"""
801
+ value: Union[str | None, Any] = Field(default=None, description="The value of the tax ID")
802
+ """The value of the tax ID"""
803
+
804
+ class InvoiceRenderingPdf(BaseModel):
805
+ """Invoice pdf rendering options"""
806
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
807
+
808
+ page_size: Union[str | None, Any] = Field(default=None, description="Page size of invoice pdf")
809
+ """Page size of invoice pdf"""
810
+
811
+ class InvoiceRendering(BaseModel):
812
+ """The rendering-related settings that control how the invoice is displayed"""
813
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
814
+
815
+ amount_tax_display: Union[str | None, Any] = Field(default=None, description="How line-item prices and amounts will be displayed with respect to tax")
816
+ """How line-item prices and amounts will be displayed with respect to tax"""
817
+ pdf: Union[InvoiceRenderingPdf | None, Any] = Field(default=None, description="Invoice pdf rendering options")
818
+ """Invoice pdf rendering options"""
819
+ template: Union[str | None, Any] = Field(default=None, description="ID of the rendering template that the invoice is formatted by")
820
+ """ID of the rendering template that the invoice is formatted by"""
821
+ template_version: Union[int | None, Any] = Field(default=None, description="Version of the rendering template that the invoice is using")
822
+ """Version of the rendering template that the invoice is using"""
823
+
824
+ class InvoiceLastFinalizationError(BaseModel):
825
+ """The error encountered during the last finalization attempt"""
826
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
827
+
828
+ advice_code: Union[str | None, Any] = Field(default=None, description="For card errors resulting from a card issuer decline")
829
+ """For card errors resulting from a card issuer decline"""
830
+ code: Union[str | None, Any] = Field(default=None, description="For some errors that could be handled programmatically, a short string indicating the error code")
831
+ """For some errors that could be handled programmatically, a short string indicating the error code"""
832
+ doc_url: Union[str | None, Any] = Field(default=None, description="A URL to more information about the error code reported")
833
+ """A URL to more information about the error code reported"""
834
+ message: Union[str | None, Any] = Field(default=None, description="A human-readable message providing more details about the error")
835
+ """A human-readable message providing more details about the error"""
836
+ network_advice_code: Union[str | None, Any] = Field(default=None, description="For card errors resulting from a card issuer decline")
837
+ """For card errors resulting from a card issuer decline"""
838
+ network_decline_code: Union[str | None, Any] = Field(default=None, description="For payments declined by the network")
839
+ """For payments declined by the network"""
840
+ param: Union[str | None, Any] = Field(default=None, description="If the error is parameter-specific, the parameter related to the error")
841
+ """If the error is parameter-specific, the parameter related to the error"""
842
+ payment_method_type: Union[str | None, Any] = Field(default=None, description="If the error is specific to the type of payment method")
843
+ """If the error is specific to the type of payment method"""
844
+ type: Union[str, Any] = Field(default=None, description="The type of error returned")
845
+ """The type of error returned"""
846
+
847
+ class InvoiceDiscountCoupon(BaseModel):
848
+ """Nested schema for InvoiceDiscount.coupon"""
849
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
850
+
851
+ id: Union[str, Any] = Field(default=None)
852
+ object: Union[str, Any] = Field(default=None)
853
+ amount_off: Union[int | None, Any] = Field(default=None)
854
+ created: Union[int, Any] = Field(default=None)
855
+ currency: Union[str | None, Any] = Field(default=None)
856
+ duration: Union[str, Any] = Field(default=None)
857
+ duration_in_months: Union[int | None, Any] = Field(default=None)
858
+ livemode: Union[bool, Any] = Field(default=None)
859
+ max_redemptions: Union[int | None, Any] = Field(default=None)
860
+ metadata: Union[dict[str, str], Any] = Field(default=None)
861
+ name: Union[str, Any] = Field(default=None)
862
+ percent_off: Union[float | None, Any] = Field(default=None)
863
+ redeem_by: Union[int | None, Any] = Field(default=None)
864
+ times_redeemed: Union[int, Any] = Field(default=None)
865
+ valid: Union[bool, Any] = Field(default=None)
866
+
867
+ class InvoiceDiscount(BaseModel):
868
+ """The discount applied to the invoice"""
869
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
870
+
871
+ id: Union[str, Any] = Field(default=None)
872
+ object: Union[str, Any] = Field(default=None)
873
+ checkout_session: Union[str | None, Any] = Field(default=None)
874
+ coupon: Union[InvoiceDiscountCoupon | None, Any] = Field(default=None)
875
+ customer: Union[str, Any] = Field(default=None)
876
+ customer_account: Union[str | None, Any] = Field(default=None)
877
+ end: Union[int | None, Any] = Field(default=None)
878
+ invoice: Union[str | None, Any] = Field(default=None)
879
+ invoice_item: Union[str | None, Any] = Field(default=None)
880
+ promotion_code: Union[str | None, Any] = Field(default=None)
881
+ start: Union[int, Any] = Field(default=None)
882
+ subscription: Union[str | None, Any] = Field(default=None)
883
+ subscription_item: Union[str | None, Any] = Field(default=None)
884
+
885
+ class InvoicePaymentsDataItem(BaseModel):
886
+ """Nested schema for InvoicePayments.data_item"""
887
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
888
+
889
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
890
+ """Unique identifier for the object"""
891
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
892
+ """String representing the object's type"""
893
+ amount_paid: Union[int | None, Any] = Field(default=None, description="Amount that was actually paid for this invoice")
894
+ """Amount that was actually paid for this invoice"""
895
+ amount_requested: Union[int, Any] = Field(default=None, description="Amount intended to be paid toward this invoice")
896
+ """Amount intended to be paid toward this invoice"""
897
+ created: Union[int, Any] = Field(default=None, description="Time at which the object was created")
898
+ """Time at which the object was created"""
899
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
900
+ """Three-letter ISO currency code"""
901
+ invoice: Union[str, Any] = Field(default=None, description="The invoice that was paid")
902
+ """The invoice that was paid"""
903
+ is_default: Union[bool, Any] = Field(default=None, description="Whether this is the default payment created when the invoice was finalized")
904
+ """Whether this is the default payment created when the invoice was finalized"""
905
+ livemode: Union[bool, Any] = Field(default=None, description="Has the value true if the object exists in live mode")
906
+ """Has the value true if the object exists in live mode"""
907
+ status: Union[str, Any] = Field(default=None, description="The status of the payment")
908
+ """The status of the payment"""
909
+
910
+ class InvoicePayments(BaseModel):
911
+ """Payments for this invoice"""
912
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
913
+
914
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
915
+ """String representing the object's type"""
916
+ data: Union[list[InvoicePaymentsDataItem], Any] = Field(default=None, description="Details about each payment")
917
+ """Details about each payment"""
918
+ has_more: Union[bool, Any] = Field(default=None, description="True if this list has another page of items")
919
+ """True if this list has another page of items"""
920
+ url: Union[str, Any] = Field(default=None, description="The URL where this list can be accessed")
921
+ """The URL where this list can be accessed"""
922
+
923
+ class InvoiceCustomerShippingAddress(BaseModel):
924
+ """Customer shipping address"""
925
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
926
+
927
+ city: Union[str | None, Any] = Field(default=None, description="City, district, suburb, town, or village")
928
+ """City, district, suburb, town, or village"""
929
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
930
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
931
+ line1: Union[str | None, Any] = Field(default=None, description="Address line 1")
932
+ """Address line 1"""
933
+ line2: Union[str | None, Any] = Field(default=None, description="Address line 2")
934
+ """Address line 2"""
935
+ postal_code: Union[str | None, Any] = Field(default=None, description="ZIP or postal code")
936
+ """ZIP or postal code"""
937
+ state: Union[str | None, Any] = Field(default=None, description="State, county, province, or region")
938
+ """State, county, province, or region"""
939
+
940
+ class InvoiceCustomerShipping(BaseModel):
941
+ """The customer's shipping information"""
942
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
943
+
944
+ address: Union[InvoiceCustomerShippingAddress, Any] = Field(default=None, description="Customer shipping address")
945
+ """Customer shipping address"""
946
+ name: Union[str, Any] = Field(default=None, description="Customer name")
947
+ """Customer name"""
948
+ phone: Union[str | None, Any] = Field(default=None, description="Customer phone (including extension)")
949
+ """Customer phone (including extension)"""
950
+
951
+ class InvoiceDefaultTaxRatesItemFlatAmount(BaseModel):
952
+ """The amount of the tax rate when the rate_type is flat_amount"""
953
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
954
+
955
+ amount: Union[int, Any] = Field(default=None, description="Amount of the tax when the rate_type is flat_amount")
956
+ """Amount of the tax when the rate_type is flat_amount"""
957
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
958
+ """Three-letter ISO currency code"""
959
+
960
+ class InvoiceDefaultTaxRatesItem(BaseModel):
961
+ """Nested schema for Invoice.default_tax_rates_item"""
962
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
963
+
964
+ id: Union[str, Any] = Field(default=None, description="Unique identifier for the object")
965
+ """Unique identifier for the object"""
966
+ object: Union[str, Any] = Field(default=None, description="String representing the object's type")
967
+ """String representing the object's type"""
968
+ active: Union[bool, Any] = Field(default=None, description="Defaults to true")
969
+ """Defaults to true"""
970
+ country: Union[str | None, Any] = Field(default=None, description="Two-letter country code (ISO 3166-1 alpha-2)")
971
+ """Two-letter country code (ISO 3166-1 alpha-2)"""
972
+ created: Union[int, Any] = Field(default=None, description="Time at which the object was created")
973
+ """Time at which the object was created"""
974
+ description: Union[str | None, Any] = Field(default=None, description="An arbitrary string attached to the tax rate for your internal use only")
975
+ """An arbitrary string attached to the tax rate for your internal use only"""
976
+ display_name: Union[str, Any] = Field(default=None, description="The display name of the tax rate")
977
+ """The display name of the tax rate"""
978
+ effective_percentage: Union[float | None, Any] = Field(default=None, description="Actual/effective tax rate percentage out of 100")
979
+ """Actual/effective tax rate percentage out of 100"""
980
+ inclusive: Union[bool, Any] = Field(default=None, description="This specifies if the tax rate is inclusive or exclusive")
981
+ """This specifies if the tax rate is inclusive or exclusive"""
982
+ jurisdiction: Union[str | None, Any] = Field(default=None, description="The jurisdiction for the tax rate")
983
+ """The jurisdiction for the tax rate"""
984
+ livemode: Union[bool, Any] = Field(default=None, description="Has the value true if the object exists in live mode")
985
+ """Has the value true if the object exists in live mode"""
986
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None, description="Set of key-value pairs")
987
+ """Set of key-value pairs"""
988
+ percentage: Union[float, Any] = Field(default=None, description="Tax rate percentage out of 100")
989
+ """Tax rate percentage out of 100"""
990
+ flat_amount: Union[InvoiceDefaultTaxRatesItemFlatAmount | None, Any] = Field(default=None, description="The amount of the tax rate when the rate_type is flat_amount")
991
+ """The amount of the tax rate when the rate_type is flat_amount"""
992
+ jurisdiction_level: Union[str | None, Any] = Field(default=None, description="The level of the jurisdiction that imposes this tax rate")
993
+ """The level of the jurisdiction that imposes this tax rate"""
994
+ rate_type: Union[str | None, Any] = Field(default=None, description="Indicates the type of tax rate applied to the taxable amount")
995
+ """Indicates the type of tax rate applied to the taxable amount"""
996
+ state: Union[str | None, Any] = Field(default=None, description="ISO 3166-2 subdivision code")
997
+ """ISO 3166-2 subdivision code"""
998
+ tax_type: Union[str | None, Any] = Field(default=None, description="The high-level tax type")
999
+ """The high-level tax type"""
1000
+
1001
+ class InvoiceCustomFieldsItem(BaseModel):
1002
+ """Nested schema for Invoice.custom_fields_item"""
1003
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1004
+
1005
+ name: Union[str, Any] = Field(default=None, description="The name of the custom field")
1006
+ """The name of the custom field"""
1007
+ value: Union[str, Any] = Field(default=None, description="The value of the custom field")
1008
+ """The value of the custom field"""
1009
+
1010
+ class InvoiceShippingCostTaxesItem(BaseModel):
1011
+ """Nested schema for InvoiceShippingCost.taxes_item"""
1012
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1013
+
1014
+ amount: Union[int, Any] = Field(default=None, description="Amount of tax applied for this rate")
1015
+ """Amount of tax applied for this rate"""
1016
+ taxability_reason: Union[str | None, Any] = Field(default=None, description="The reasoning behind this tax")
1017
+ """The reasoning behind this tax"""
1018
+ taxable_amount: Union[int | None, Any] = Field(default=None, description="The amount on which tax is calculated")
1019
+ """The amount on which tax is calculated"""
1020
+
1021
+ class InvoiceShippingCost(BaseModel):
1022
+ """The details of the cost of shipping"""
1023
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1024
+
1025
+ amount_subtotal: Union[int, Any] = Field(default=None, description="Total shipping cost before any taxes are applied")
1026
+ """Total shipping cost before any taxes are applied"""
1027
+ amount_tax: Union[int, Any] = Field(default=None, description="Total tax amount applied due to shipping costs")
1028
+ """Total tax amount applied due to shipping costs"""
1029
+ amount_total: Union[int, Any] = Field(default=None, description="Total shipping cost after taxes are applied")
1030
+ """Total shipping cost after taxes are applied"""
1031
+ shipping_rate: Union[str | None, Any] = Field(default=None, description="The ID of the ShippingRate for this invoice")
1032
+ """The ID of the ShippingRate for this invoice"""
1033
+ taxes: Union[list[InvoiceShippingCostTaxesItem] | None, Any] = Field(default=None, description="The taxes applied to the shipping rate")
1034
+ """The taxes applied to the shipping rate"""
1035
+
1036
+ class InvoiceTotalTaxesItem(BaseModel):
1037
+ """Nested schema for Invoice.total_taxes_item"""
1038
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1039
+
1040
+ amount: Union[int, Any] = Field(default=None, description="The amount of the tax")
1041
+ """The amount of the tax"""
1042
+ tax_behavior: Union[str, Any] = Field(default=None, description="Whether this tax is inclusive or exclusive")
1043
+ """Whether this tax is inclusive or exclusive"""
1044
+ tax_rate_details: Union[dict[str, Any] | None, Any] = Field(default=None, description="Additional details about the tax rate")
1045
+ """Additional details about the tax rate"""
1046
+ taxability_reason: Union[str, Any] = Field(default=None, description="The reasoning behind this tax")
1047
+ """The reasoning behind this tax"""
1048
+ taxable_amount: Union[int | None, Any] = Field(default=None, description="The amount on which tax is calculated")
1049
+ """The amount on which tax is calculated"""
1050
+ type: Union[str, Any] = Field(default=None, description="The type of tax information")
1051
+ """The type of tax information"""
1052
+
1053
+ class InvoiceParentSubscriptionDetails(BaseModel):
1054
+ """Details about the subscription that generated this invoice"""
1055
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1056
+
1057
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None, description="Set of key-value pairs defined as subscription metadata")
1058
+ """Set of key-value pairs defined as subscription metadata"""
1059
+ subscription: Union[str, Any] = Field(default=None, description="The subscription that generated this invoice")
1060
+ """The subscription that generated this invoice"""
1061
+ subscription_proration_date: Union[int | None, Any] = Field(default=None, description="Only set for upcoming invoices that preview prorations")
1062
+ """Only set for upcoming invoices that preview prorations"""
1063
+
1064
+ class InvoiceParentQuoteDetails(BaseModel):
1065
+ """Details about the quote that generated this invoice"""
1066
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1067
+
1068
+ quote: Union[str, Any] = Field(default=None, description="The quote that generated this invoice")
1069
+ """The quote that generated this invoice"""
1070
+
1071
+ class InvoiceParent(BaseModel):
1072
+ """The parent that generated this invoice"""
1073
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1074
+
1075
+ quote_details: Union[InvoiceParentQuoteDetails | None, Any] = Field(default=None, description="Details about the quote that generated this invoice")
1076
+ """Details about the quote that generated this invoice"""
1077
+ subscription_details: Union[InvoiceParentSubscriptionDetails | None, Any] = Field(default=None, description="Details about the subscription that generated this invoice")
1078
+ """Details about the subscription that generated this invoice"""
1079
+ type: Union[str, Any] = Field(default=None, description="The type of parent that generated this invoice")
1080
+ """The type of parent that generated this invoice"""
1081
+
1082
+ class Invoice(BaseModel):
1083
+ """Invoice type definition"""
1084
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1085
+
1086
+ id: Union[str, Any] = Field(default=None)
1087
+ object: Union[str, Any] = Field(default=None)
1088
+ account_country: Union[str | None, Any] = Field(default=None)
1089
+ account_name: Union[str | None, Any] = Field(default=None)
1090
+ account_tax_ids: Union[list[str] | None, Any] = Field(default=None)
1091
+ amount_due: Union[int, Any] = Field(default=None)
1092
+ amount_overpaid: Union[int, Any] = Field(default=None)
1093
+ amount_paid: Union[int, Any] = Field(default=None)
1094
+ amount_remaining: Union[int, Any] = Field(default=None)
1095
+ amount_shipping: Union[int, Any] = Field(default=None)
1096
+ application: Union[str | None, Any] = Field(default=None)
1097
+ application_fee_amount: Union[int | None, Any] = Field(default=None)
1098
+ attempt_count: Union[int, Any] = Field(default=None)
1099
+ attempted: Union[bool, Any] = Field(default=None)
1100
+ auto_advance: Union[bool, Any] = Field(default=None)
1101
+ automatic_tax: Union[InvoiceAutomaticTax, Any] = Field(default=None)
1102
+ automatically_finalizes_at: Union[int | None, Any] = Field(default=None)
1103
+ billing_reason: Union[str | None, Any] = Field(default=None)
1104
+ charge: Union[str | None, Any] = Field(default=None)
1105
+ collection_method: Union[str, Any] = Field(default=None)
1106
+ confirmation_secret: Union[InvoiceConfirmationSecret | None, Any] = Field(default=None)
1107
+ created: Union[int, Any] = Field(default=None)
1108
+ currency: Union[str, Any] = Field(default=None)
1109
+ custom_fields: Union[list[InvoiceCustomFieldsItem] | None, Any] = Field(default=None)
1110
+ customer: Union[str, Any] = Field(default=None)
1111
+ customer_account: Union[str | None, Any] = Field(default=None)
1112
+ customer_address: Union[InvoiceCustomerAddress | None, Any] = Field(default=None)
1113
+ customer_email: Union[str | None, Any] = Field(default=None)
1114
+ customer_name: Union[str | None, Any] = Field(default=None)
1115
+ customer_phone: Union[str | None, Any] = Field(default=None)
1116
+ customer_shipping: Union[InvoiceCustomerShipping | None, Any] = Field(default=None)
1117
+ customer_tax_exempt: Union[str | None, Any] = Field(default=None)
1118
+ customer_tax_ids: Union[list[InvoiceCustomerTaxIdsItem] | None, Any] = Field(default=None)
1119
+ default_payment_method: Union[str | None, Any] = Field(default=None)
1120
+ default_source: Union[str | None, Any] = Field(default=None)
1121
+ default_tax_rates: Union[list[InvoiceDefaultTaxRatesItem], Any] = Field(default=None)
1122
+ description: Union[str | None, Any] = Field(default=None)
1123
+ discount: Union[InvoiceDiscount | None, Any] = Field(default=None)
1124
+ discounts: Union[list[str], Any] = Field(default=None)
1125
+ due_date: Union[int | None, Any] = Field(default=None)
1126
+ effective_at: Union[int | None, Any] = Field(default=None)
1127
+ ending_balance: Union[int | None, Any] = Field(default=None)
1128
+ footer: Union[str | None, Any] = Field(default=None)
1129
+ from_invoice: Union[InvoiceFromInvoice | None, Any] = Field(default=None)
1130
+ hosted_invoice_url: Union[str | None, Any] = Field(default=None)
1131
+ invoice_pdf: Union[str | None, Any] = Field(default=None)
1132
+ issuer: Union[InvoiceIssuer, Any] = Field(default=None)
1133
+ last_finalization_error: Union[InvoiceLastFinalizationError | None, Any] = Field(default=None)
1134
+ latest_revision: Union[str | None, Any] = Field(default=None)
1135
+ lines: Union[InvoiceLines, Any] = Field(default=None)
1136
+ livemode: Union[bool, Any] = Field(default=None)
1137
+ metadata: Union[dict[str, str], Any] = Field(default=None)
1138
+ next_payment_attempt: Union[int | None, Any] = Field(default=None)
1139
+ number: Union[str | None, Any] = Field(default=None)
1140
+ on_behalf_of: Union[str | None, Any] = Field(default=None)
1141
+ paid: Union[bool | None, Any] = Field(default=None)
1142
+ paid_out_of_band: Union[bool | None, Any] = Field(default=None)
1143
+ parent: Union[InvoiceParent | None, Any] = Field(default=None)
1144
+ payment_intent: Union[str | None, Any] = Field(default=None)
1145
+ payment_settings: Union[InvoicePaymentSettings, Any] = Field(default=None)
1146
+ payments: Union[InvoicePayments, Any] = Field(default=None)
1147
+ period_end: Union[int, Any] = Field(default=None)
1148
+ period_start: Union[int, Any] = Field(default=None)
1149
+ post_payment_credit_notes_amount: Union[int, Any] = Field(default=None)
1150
+ pre_payment_credit_notes_amount: Union[int, Any] = Field(default=None)
1151
+ quote: Union[str | None, Any] = Field(default=None)
1152
+ receipt_number: Union[str | None, Any] = Field(default=None)
1153
+ rendering: Union[InvoiceRendering | None, Any] = Field(default=None)
1154
+ rendering_options: Union[dict[str, Any] | None, Any] = Field(default=None)
1155
+ shipping_cost: Union[InvoiceShippingCost | None, Any] = Field(default=None)
1156
+ shipping_details: Union[InvoiceShippingDetails | None, Any] = Field(default=None)
1157
+ starting_balance: Union[int, Any] = Field(default=None)
1158
+ statement_descriptor: Union[str | None, Any] = Field(default=None)
1159
+ status: Union[str | None, Any] = Field(default=None)
1160
+ status_transitions: Union[InvoiceStatusTransitions, Any] = Field(default=None)
1161
+ subscription: Union[str | None, Any] = Field(default=None)
1162
+ subscription_details: Union[InvoiceSubscriptionDetails | None, Any] = Field(default=None)
1163
+ subtotal: Union[int, Any] = Field(default=None)
1164
+ subtotal_excluding_tax: Union[int | None, Any] = Field(default=None)
1165
+ tax: Union[int | None, Any] = Field(default=None)
1166
+ test_clock: Union[str | None, Any] = Field(default=None)
1167
+ threshold_reason: Union[InvoiceThresholdReason | None, Any] = Field(default=None)
1168
+ total: Union[int, Any] = Field(default=None)
1169
+ total_discount_amounts: Union[list[InvoiceTotalDiscountAmountsItem] | None, Any] = Field(default=None)
1170
+ total_excluding_tax: Union[int | None, Any] = Field(default=None)
1171
+ total_pretax_credit_amounts: Union[list[InvoiceTotalPretaxCreditAmountsItem] | None, Any] = Field(default=None)
1172
+ total_tax_amounts: Union[list[InvoiceTotalTaxAmountsItem] | None, Any] = Field(default=None)
1173
+ total_taxes: Union[list[InvoiceTotalTaxesItem] | None, Any] = Field(default=None)
1174
+ transfer_data: Union[dict[str, Any] | None, Any] = Field(default=None)
1175
+ webhooks_delivered_at: Union[int | None, Any] = Field(default=None)
1176
+
1177
+ class InvoiceList(BaseModel):
1178
+ """InvoiceList type definition"""
1179
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1180
+
1181
+ object: Union[str, Any] = Field(default=None)
1182
+ data: Union[list[Invoice], Any] = Field(default=None)
1183
+ has_more: Union[bool, Any] = Field(default=None)
1184
+ url: Union[str, Any] = Field(default=None)
1185
+
1186
+ class ChargeRefunds(BaseModel):
1187
+ """A list of refunds that have been applied to the charge"""
1188
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1189
+
1190
+ object: Union[str, Any] = Field(default=None)
1191
+ data: Union[list[dict[str, Any]], Any] = Field(default=None)
1192
+ has_more: Union[bool, Any] = Field(default=None)
1193
+ total_count: Union[int, Any] = Field(default=None, description="Total number of refunds")
1194
+ """Total number of refunds"""
1195
+ url: Union[str, Any] = Field(default=None, description="URL to access the refunds list")
1196
+ """URL to access the refunds list"""
1197
+
1198
+ class ChargeOutcome(BaseModel):
1199
+ """Details about whether the payment was accepted, and why"""
1200
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1201
+
1202
+ advice_code: Union[str | None, Any] = Field(default=None)
1203
+ network_advice_code: Union[str | None, Any] = Field(default=None)
1204
+ network_decline_code: Union[str | None, Any] = Field(default=None)
1205
+ network_status: Union[str, Any] = Field(default=None)
1206
+ reason: Union[str | None, Any] = Field(default=None)
1207
+ risk_level: Union[str, Any] = Field(default=None)
1208
+ risk_score: Union[int, Any] = Field(default=None)
1209
+ seller_message: Union[str, Any] = Field(default=None)
1210
+ type: Union[str, Any] = Field(default=None)
1211
+
1212
+ class ChargePresentmentDetails(BaseModel):
1213
+ """Currency presentation information for multi-currency charges"""
1214
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1215
+
1216
+ amount_authorized: Union[int | None, Any] = Field(default=None, description="Amount authorized in the presentment currency")
1217
+ """Amount authorized in the presentment currency"""
1218
+ amount_charged: Union[int | None, Any] = Field(default=None, description="Amount charged in the presentment currency")
1219
+ """Amount charged in the presentment currency"""
1220
+ currency: Union[str | None, Any] = Field(default=None, description="Three-letter ISO currency code for presentment")
1221
+ """Three-letter ISO currency code for presentment"""
1222
+
1223
+ class ChargeFraudDetails(BaseModel):
1224
+ """Information on fraud assessments for the charge"""
1225
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1226
+
1227
+ stripe_report: Union[str | None, Any] = Field(default=None, description="Assessments from Stripe. If set, the value is `fraudulent`.")
1228
+ """Assessments from Stripe. If set, the value is `fraudulent`."""
1229
+ user_report: Union[str | None, Any] = Field(default=None, description="Assessments from you or your users. Possible values are `fraudulent` and `safe`")
1230
+ """Assessments from you or your users. Possible values are `fraudulent` and `safe`"""
1231
+
1232
+ class ChargeBillingDetailsAddress(BaseModel):
1233
+ """Nested schema for ChargeBillingDetails.address"""
1234
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1235
+
1236
+ city: Union[str | None, Any] = Field(default=None)
1237
+ country: Union[str | None, Any] = Field(default=None)
1238
+ line1: Union[str | None, Any] = Field(default=None)
1239
+ line2: Union[str | None, Any] = Field(default=None)
1240
+ postal_code: Union[str | None, Any] = Field(default=None)
1241
+ state: Union[str | None, Any] = Field(default=None)
1242
+
1243
+ class ChargeBillingDetails(BaseModel):
1244
+ """Billing information associated with the payment method"""
1245
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1246
+
1247
+ address: Union[ChargeBillingDetailsAddress | None, Any] = Field(default=None)
1248
+ email: Union[str | None, Any] = Field(default=None)
1249
+ name: Union[str | None, Any] = Field(default=None)
1250
+ phone: Union[str | None, Any] = Field(default=None)
1251
+ tax_id: Union[str | None, Any] = Field(default=None)
1252
+
1253
+ class ChargePaymentMethodDetailsCardNetworkToken(BaseModel):
1254
+ """Network token details"""
1255
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1256
+
1257
+ used: Union[bool, Any] = Field(default=None)
1258
+
1259
+ class ChargePaymentMethodDetailsCardIncrementalAuthorization(BaseModel):
1260
+ """Incremental authorization details"""
1261
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1262
+
1263
+ status: Union[str, Any] = Field(default=None)
1264
+
1265
+ class ChargePaymentMethodDetailsCardMulticapture(BaseModel):
1266
+ """Multicapture details"""
1267
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1268
+
1269
+ status: Union[str, Any] = Field(default=None)
1270
+
1271
+ class ChargePaymentMethodDetailsCardOvercapture(BaseModel):
1272
+ """Overcapture details"""
1273
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1274
+
1275
+ maximum_amount_capturable: Union[int, Any] = Field(default=None)
1276
+ status: Union[str, Any] = Field(default=None)
1277
+
1278
+ class ChargePaymentMethodDetailsCardChecks(BaseModel):
1279
+ """Check results by Card networks on Card address and CVC"""
1280
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1281
+
1282
+ address_line1_check: Union[str | None, Any] = Field(default=None)
1283
+ address_postal_code_check: Union[str | None, Any] = Field(default=None)
1284
+ cvc_check: Union[str | None, Any] = Field(default=None)
1285
+
1286
+ class ChargePaymentMethodDetailsCardExtendedAuthorization(BaseModel):
1287
+ """Extended authorization details"""
1288
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1289
+
1290
+ status: Union[str, Any] = Field(default=None)
1291
+
1292
+ class ChargePaymentMethodDetailsCard(BaseModel):
1293
+ """Nested schema for ChargePaymentMethodDetails.card"""
1294
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1295
+
1296
+ amount_authorized: Union[int | None, Any] = Field(default=None, description="Amount authorized on the card")
1297
+ """Amount authorized on the card"""
1298
+ authorization_code: Union[str | None, Any] = Field(default=None, description="Authorization code on the charge")
1299
+ """Authorization code on the charge"""
1300
+ brand: Union[str, Any] = Field(default=None, description="Card brand")
1301
+ """Card brand"""
1302
+ checks: Union[ChargePaymentMethodDetailsCardChecks | None, Any] = Field(default=None, description="Check results by Card networks on Card address and CVC")
1303
+ """Check results by Card networks on Card address and CVC"""
1304
+ country: Union[str, Any] = Field(default=None, description="Two-letter ISO code representing the country of the card")
1305
+ """Two-letter ISO code representing the country of the card"""
1306
+ exp_month: Union[int, Any] = Field(default=None, description="Two-digit number representing the card's expiration month")
1307
+ """Two-digit number representing the card's expiration month"""
1308
+ exp_year: Union[int, Any] = Field(default=None, description="Four-digit number representing the card's expiration year")
1309
+ """Four-digit number representing the card's expiration year"""
1310
+ extended_authorization: Union[ChargePaymentMethodDetailsCardExtendedAuthorization | None, Any] = Field(default=None, description="Extended authorization details")
1311
+ """Extended authorization details"""
1312
+ fingerprint: Union[str, Any] = Field(default=None, description="Uniquely identifies this particular card number")
1313
+ """Uniquely identifies this particular card number"""
1314
+ funding: Union[str, Any] = Field(default=None, description="Card funding type")
1315
+ """Card funding type"""
1316
+ incremental_authorization: Union[ChargePaymentMethodDetailsCardIncrementalAuthorization | None, Any] = Field(default=None, description="Incremental authorization details")
1317
+ """Incremental authorization details"""
1318
+ installments: Union[dict[str, Any] | None, Any] = Field(default=None, description="Installment details")
1319
+ """Installment details"""
1320
+ last4: Union[str, Any] = Field(default=None, description="The last four digits of the card")
1321
+ """The last four digits of the card"""
1322
+ mandate: Union[str | None, Any] = Field(default=None, description="ID of the mandate used to make this payment")
1323
+ """ID of the mandate used to make this payment"""
1324
+ multicapture: Union[ChargePaymentMethodDetailsCardMulticapture | None, Any] = Field(default=None, description="Multicapture details")
1325
+ """Multicapture details"""
1326
+ network: Union[str, Any] = Field(default=None, description="Card network")
1327
+ """Card network"""
1328
+ network_token: Union[ChargePaymentMethodDetailsCardNetworkToken | None, Any] = Field(default=None, description="Network token details")
1329
+ """Network token details"""
1330
+ network_transaction_id: Union[str | None, Any] = Field(default=None, description="Network transaction identifier")
1331
+ """Network transaction identifier"""
1332
+ overcapture: Union[ChargePaymentMethodDetailsCardOvercapture | None, Any] = Field(default=None, description="Overcapture details")
1333
+ """Overcapture details"""
1334
+ regulated_status: Union[str | None, Any] = Field(default=None, description="Regulated status of the card")
1335
+ """Regulated status of the card"""
1336
+ three_d_secure: Union[dict[str, Any] | None, Any] = Field(default=None, description="3D Secure details")
1337
+ """3D Secure details"""
1338
+ wallet: Union[dict[str, Any] | None, Any] = Field(default=None, description="Digital wallet details if used")
1339
+ """Digital wallet details if used"""
1340
+
1341
+ class ChargePaymentMethodDetails(BaseModel):
1342
+ """Details about the payment method at the time of the transaction"""
1343
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1344
+
1345
+ type: Union[str, Any] = Field(default=None)
1346
+ card: Union[ChargePaymentMethodDetailsCard | None, Any] = Field(default=None)
1347
+
1348
+ class Charge(BaseModel):
1349
+ """Charge type definition"""
1350
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1351
+
1352
+ id: Union[str, Any] = Field(default=None)
1353
+ object: Union[str, Any] = Field(default=None)
1354
+ created: Union[int, Any] = Field(default=None)
1355
+ livemode: Union[bool, Any] = Field(default=None)
1356
+ amount: Union[int, Any] = Field(default=None)
1357
+ amount_captured: Union[int, Any] = Field(default=None)
1358
+ amount_refunded: Union[int, Any] = Field(default=None)
1359
+ amount_updates: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
1360
+ application: Union[str | None, Any] = Field(default=None)
1361
+ application_fee: Union[str | None, Any] = Field(default=None)
1362
+ application_fee_amount: Union[int | None, Any] = Field(default=None)
1363
+ calculated_statement_descriptor: Union[str | None, Any] = Field(default=None)
1364
+ currency: Union[str, Any] = Field(default=None)
1365
+ customer: Union[str | None, Any] = Field(default=None)
1366
+ description: Union[str | None, Any] = Field(default=None)
1367
+ destination: Union[str | None, Any] = Field(default=None)
1368
+ dispute: Union[str | None, Any] = Field(default=None)
1369
+ disputed: Union[bool, Any] = Field(default=None)
1370
+ failure_balance_transaction: Union[str | None, Any] = Field(default=None)
1371
+ failure_code: Union[str | None, Any] = Field(default=None)
1372
+ failure_message: Union[str | None, Any] = Field(default=None)
1373
+ fraud_details: Union[ChargeFraudDetails | None, Any] = Field(default=None)
1374
+ invoice: Union[str | None, Any] = Field(default=None)
1375
+ on_behalf_of: Union[str | None, Any] = Field(default=None)
1376
+ order: Union[str | None, Any] = Field(default=None)
1377
+ outcome: Union[ChargeOutcome | None, Any] = Field(default=None)
1378
+ paid: Union[bool, Any] = Field(default=None)
1379
+ payment_intent: Union[str | None, Any] = Field(default=None)
1380
+ payment_method: Union[str | None, Any] = Field(default=None)
1381
+ payment_method_details: Union[ChargePaymentMethodDetails | None, Any] = Field(default=None)
1382
+ presentment_details: Union[ChargePresentmentDetails | None, Any] = Field(default=None)
1383
+ receipt_email: Union[str | None, Any] = Field(default=None)
1384
+ receipt_number: Union[str | None, Any] = Field(default=None)
1385
+ receipt_url: Union[str | None, Any] = Field(default=None)
1386
+ refunded: Union[bool, Any] = Field(default=None)
1387
+ refunds: Union[ChargeRefunds | None, Any] = Field(default=None)
1388
+ review: Union[str | None, Any] = Field(default=None)
1389
+ shipping: Union[dict[str, Any] | None, Any] = Field(default=None)
1390
+ source: Union[dict[str, Any] | None, Any] = Field(default=None)
1391
+ source_transfer: Union[str | None, Any] = Field(default=None)
1392
+ statement_descriptor: Union[str | None, Any] = Field(default=None)
1393
+ statement_descriptor_suffix: Union[str | None, Any] = Field(default=None)
1394
+ status: Union[str, Any] = Field(default=None)
1395
+ transfer_data: Union[dict[str, Any] | None, Any] = Field(default=None)
1396
+ transfer_group: Union[str | None, Any] = Field(default=None)
1397
+ captured: Union[bool, Any] = Field(default=None)
1398
+ balance_transaction: Union[str | None, Any] = Field(default=None)
1399
+ billing_details: Union[ChargeBillingDetails, Any] = Field(default=None)
1400
+ metadata: Union[dict[str, str], Any] = Field(default=None)
1401
+ radar_options: Union[dict[str, Any] | None, Any] = Field(default=None)
1402
+
1403
+ class ChargeList(BaseModel):
1404
+ """ChargeList type definition"""
1405
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1406
+
1407
+ object: Union[str, Any] = Field(default=None)
1408
+ data: Union[list[Charge], Any] = Field(default=None)
1409
+ has_more: Union[bool, Any] = Field(default=None)
1410
+ url: Union[str, Any] = Field(default=None)
1411
+
1412
+ class SubscriptionList(BaseModel):
1413
+ """SubscriptionList type definition"""
1414
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1415
+
1416
+ object: Union[str, Any] = Field(default=None)
1417
+ data: Union[list[Subscription], Any] = Field(default=None)
1418
+ has_more: Union[bool, Any] = Field(default=None)
1419
+ url: Union[str, Any] = Field(default=None)
1420
+
1421
+ class RefundDestinationDetailsBrBankTransfer(BaseModel):
1422
+ """If this is a br_bank_transfer refund, this hash contains the transaction specific details"""
1423
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1424
+
1425
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1426
+ """The reference assigned to the refund"""
1427
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1428
+ """Status of the reference on the refund"""
1429
+
1430
+ class RefundDestinationDetailsGbBankTransfer(BaseModel):
1431
+ """If this is a gb_bank_transfer refund, this hash contains the transaction specific details"""
1432
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1433
+
1434
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1435
+ """The reference assigned to the refund"""
1436
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1437
+ """Status of the reference on the refund"""
1438
+
1439
+ class RefundDestinationDetailsP24(BaseModel):
1440
+ """If this is a p24 refund, this hash contains the transaction specific details"""
1441
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1442
+
1443
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1444
+ """The reference assigned to the refund"""
1445
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1446
+ """Status of the reference on the refund"""
1447
+
1448
+ class RefundDestinationDetailsThBankTransfer(BaseModel):
1449
+ """If this is a th_bank_transfer refund, this hash contains the transaction specific details"""
1450
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1451
+
1452
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1453
+ """The reference assigned to the refund"""
1454
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1455
+ """Status of the reference on the refund"""
1456
+
1457
+ class RefundDestinationDetailsPaypal(BaseModel):
1458
+ """If this is a paypal refund, this hash contains the transaction specific details"""
1459
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1460
+
1461
+ network_decline_code: Union[str | None, Any] = Field(default=None, description="For refunds declined by the network, a decline code provided by the network")
1462
+ """For refunds declined by the network, a decline code provided by the network"""
1463
+
1464
+ class RefundDestinationDetailsSwish(BaseModel):
1465
+ """If this is a swish refund, this hash contains the transaction specific details"""
1466
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1467
+
1468
+ network_decline_code: Union[str | None, Any] = Field(default=None, description="For refunds declined by the network, a decline code provided by the network")
1469
+ """For refunds declined by the network, a decline code provided by the network"""
1470
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1471
+ """The reference assigned to the refund"""
1472
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1473
+ """Status of the reference on the refund"""
1474
+
1475
+ class RefundDestinationDetailsBlik(BaseModel):
1476
+ """If this is a blik refund, this hash contains the transaction specific details"""
1477
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1478
+
1479
+ network_decline_code: Union[str | None, Any] = Field(default=None, description="For refunds declined by the network, a decline code provided by the network")
1480
+ """For refunds declined by the network, a decline code provided by the network"""
1481
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1482
+ """The reference assigned to the refund"""
1483
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1484
+ """Status of the reference on the refund"""
1485
+
1486
+ class RefundDestinationDetailsMbWay(BaseModel):
1487
+ """If this is a mb_way refund, this hash contains the transaction specific details"""
1488
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1489
+
1490
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1491
+ """The reference assigned to the refund"""
1492
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1493
+ """Status of the reference on the refund"""
1494
+
1495
+ class RefundDestinationDetailsEuBankTransfer(BaseModel):
1496
+ """If this is a eu_bank_transfer refund, this hash contains the transaction specific details"""
1497
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1498
+
1499
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1500
+ """The reference assigned to the refund"""
1501
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1502
+ """Status of the reference on the refund"""
1503
+
1504
+ class RefundDestinationDetailsCard(BaseModel):
1505
+ """If this is a card refund, this hash contains the transaction specific details"""
1506
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1507
+
1508
+ reference: Union[str | None, Any] = Field(default=None, description="Value of the reference number assigned to the refund")
1509
+ """Value of the reference number assigned to the refund"""
1510
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference number on the refund")
1511
+ """Status of the reference number on the refund"""
1512
+ reference_type: Union[str | None, Any] = Field(default=None, description="Type of the reference number assigned to the refund")
1513
+ """Type of the reference number assigned to the refund"""
1514
+ type: Union[str, Any] = Field(default=None, description="The type of refund")
1515
+ """The type of refund"""
1516
+
1517
+ class RefundDestinationDetailsCrypto(BaseModel):
1518
+ """If this is a crypto refund, this hash contains the transaction specific details"""
1519
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1520
+
1521
+ reference: Union[str | None, Any] = Field(default=None, description="The transaction hash of the refund")
1522
+ """The transaction hash of the refund"""
1523
+
1524
+ class RefundDestinationDetailsMxBankTransfer(BaseModel):
1525
+ """If this is a mx_bank_transfer refund, this hash contains the transaction specific details"""
1526
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1527
+
1528
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1529
+ """The reference assigned to the refund"""
1530
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1531
+ """Status of the reference on the refund"""
1532
+
1533
+ class RefundDestinationDetailsUsBankTransfer(BaseModel):
1534
+ """If this is a us_bank_transfer refund, this hash contains the transaction specific details"""
1535
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1536
+
1537
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1538
+ """The reference assigned to the refund"""
1539
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1540
+ """Status of the reference on the refund"""
1541
+
1542
+ class RefundDestinationDetailsMultibanco(BaseModel):
1543
+ """If this is a multibanco refund, this hash contains the transaction specific details"""
1544
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1545
+
1546
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1547
+ """The reference assigned to the refund"""
1548
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1549
+ """Status of the reference on the refund"""
1550
+
1551
+ class RefundDestinationDetailsJpBankTransfer(BaseModel):
1552
+ """If this is a jp_bank_transfer refund, this hash contains the transaction specific details"""
1553
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1554
+
1555
+ reference: Union[str | None, Any] = Field(default=None, description="The reference assigned to the refund")
1556
+ """The reference assigned to the refund"""
1557
+ reference_status: Union[str | None, Any] = Field(default=None, description="Status of the reference on the refund")
1558
+ """Status of the reference on the refund"""
1559
+
1560
+ class RefundDestinationDetails(BaseModel):
1561
+ """Transaction-specific details for the refund"""
1562
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1563
+
1564
+ affirm: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a affirm refund, this hash contains the transaction specific details")
1565
+ """If this is a affirm refund, this hash contains the transaction specific details"""
1566
+ afterpay_clearpay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a afterpay_clearpay refund, this hash contains the transaction specific details")
1567
+ """If this is a afterpay_clearpay refund, this hash contains the transaction specific details"""
1568
+ alipay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a alipay refund, this hash contains the transaction specific details")
1569
+ """If this is a alipay refund, this hash contains the transaction specific details"""
1570
+ alma: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a alma refund, this hash contains the transaction specific details")
1571
+ """If this is a alma refund, this hash contains the transaction specific details"""
1572
+ amazon_pay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a amazon_pay refund, this hash contains the transaction specific details")
1573
+ """If this is a amazon_pay refund, this hash contains the transaction specific details"""
1574
+ au_bank_transfer: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a au_bank_transfer refund, this hash contains the transaction specific details")
1575
+ """If this is a au_bank_transfer refund, this hash contains the transaction specific details"""
1576
+ blik: Union[RefundDestinationDetailsBlik | None, Any] = Field(default=None, description="If this is a blik refund, this hash contains the transaction specific details")
1577
+ """If this is a blik refund, this hash contains the transaction specific details"""
1578
+ br_bank_transfer: Union[RefundDestinationDetailsBrBankTransfer | None, Any] = Field(default=None, description="If this is a br_bank_transfer refund, this hash contains the transaction specific details")
1579
+ """If this is a br_bank_transfer refund, this hash contains the transaction specific details"""
1580
+ card: Union[RefundDestinationDetailsCard | None, Any] = Field(default=None, description="If this is a card refund, this hash contains the transaction specific details")
1581
+ """If this is a card refund, this hash contains the transaction specific details"""
1582
+ cashapp: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a cashapp refund, this hash contains the transaction specific details")
1583
+ """If this is a cashapp refund, this hash contains the transaction specific details"""
1584
+ crypto: Union[RefundDestinationDetailsCrypto | None, Any] = Field(default=None, description="If this is a crypto refund, this hash contains the transaction specific details")
1585
+ """If this is a crypto refund, this hash contains the transaction specific details"""
1586
+ customer_cash_balance: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a customer_cash_balance refund, this hash contains the transaction specific details")
1587
+ """If this is a customer_cash_balance refund, this hash contains the transaction specific details"""
1588
+ eps: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a eps refund, this hash contains the transaction specific details")
1589
+ """If this is a eps refund, this hash contains the transaction specific details"""
1590
+ eu_bank_transfer: Union[RefundDestinationDetailsEuBankTransfer | None, Any] = Field(default=None, description="If this is a eu_bank_transfer refund, this hash contains the transaction specific details")
1591
+ """If this is a eu_bank_transfer refund, this hash contains the transaction specific details"""
1592
+ gb_bank_transfer: Union[RefundDestinationDetailsGbBankTransfer | None, Any] = Field(default=None, description="If this is a gb_bank_transfer refund, this hash contains the transaction specific details")
1593
+ """If this is a gb_bank_transfer refund, this hash contains the transaction specific details"""
1594
+ giropay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a giropay refund, this hash contains the transaction specific details")
1595
+ """If this is a giropay refund, this hash contains the transaction specific details"""
1596
+ grabpay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a grabpay refund, this hash contains the transaction specific details")
1597
+ """If this is a grabpay refund, this hash contains the transaction specific details"""
1598
+ jp_bank_transfer: Union[RefundDestinationDetailsJpBankTransfer | None, Any] = Field(default=None, description="If this is a jp_bank_transfer refund, this hash contains the transaction specific details")
1599
+ """If this is a jp_bank_transfer refund, this hash contains the transaction specific details"""
1600
+ klarna: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a klarna refund, this hash contains the transaction specific details")
1601
+ """If this is a klarna refund, this hash contains the transaction specific details"""
1602
+ mb_way: Union[RefundDestinationDetailsMbWay | None, Any] = Field(default=None, description="If this is a mb_way refund, this hash contains the transaction specific details")
1603
+ """If this is a mb_way refund, this hash contains the transaction specific details"""
1604
+ multibanco: Union[RefundDestinationDetailsMultibanco | None, Any] = Field(default=None, description="If this is a multibanco refund, this hash contains the transaction specific details")
1605
+ """If this is a multibanco refund, this hash contains the transaction specific details"""
1606
+ mx_bank_transfer: Union[RefundDestinationDetailsMxBankTransfer | None, Any] = Field(default=None, description="If this is a mx_bank_transfer refund, this hash contains the transaction specific details")
1607
+ """If this is a mx_bank_transfer refund, this hash contains the transaction specific details"""
1608
+ nz_bank_transfer: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a nz_bank_transfer refund, this hash contains the transaction specific details")
1609
+ """If this is a nz_bank_transfer refund, this hash contains the transaction specific details"""
1610
+ p24: Union[RefundDestinationDetailsP24 | None, Any] = Field(default=None, description="If this is a p24 refund, this hash contains the transaction specific details")
1611
+ """If this is a p24 refund, this hash contains the transaction specific details"""
1612
+ paynow: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a paynow refund, this hash contains the transaction specific details")
1613
+ """If this is a paynow refund, this hash contains the transaction specific details"""
1614
+ paypal: Union[RefundDestinationDetailsPaypal | None, Any] = Field(default=None, description="If this is a paypal refund, this hash contains the transaction specific details")
1615
+ """If this is a paypal refund, this hash contains the transaction specific details"""
1616
+ pix: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a pix refund, this hash contains the transaction specific details")
1617
+ """If this is a pix refund, this hash contains the transaction specific details"""
1618
+ revolut: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a revolut refund, this hash contains the transaction specific details")
1619
+ """If this is a revolut refund, this hash contains the transaction specific details"""
1620
+ sofort: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a sofort refund, this hash contains the transaction specific details")
1621
+ """If this is a sofort refund, this hash contains the transaction specific details"""
1622
+ swish: Union[RefundDestinationDetailsSwish | None, Any] = Field(default=None, description="If this is a swish refund, this hash contains the transaction specific details")
1623
+ """If this is a swish refund, this hash contains the transaction specific details"""
1624
+ th_bank_transfer: Union[RefundDestinationDetailsThBankTransfer | None, Any] = Field(default=None, description="If this is a th_bank_transfer refund, this hash contains the transaction specific details")
1625
+ """If this is a th_bank_transfer refund, this hash contains the transaction specific details"""
1626
+ twint: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a twint refund, this hash contains the transaction specific details")
1627
+ """If this is a twint refund, this hash contains the transaction specific details"""
1628
+ type: Union[str, Any] = Field(default=None, description="The type of transaction-specific details of the payment method used in the refund")
1629
+ """The type of transaction-specific details of the payment method used in the refund"""
1630
+ us_bank_transfer: Union[RefundDestinationDetailsUsBankTransfer | None, Any] = Field(default=None, description="If this is a us_bank_transfer refund, this hash contains the transaction specific details")
1631
+ """If this is a us_bank_transfer refund, this hash contains the transaction specific details"""
1632
+ wechat_pay: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a wechat_pay refund, this hash contains the transaction specific details")
1633
+ """If this is a wechat_pay refund, this hash contains the transaction specific details"""
1634
+ zip: Union[dict[str, Any] | None, Any] = Field(default=None, description="If this is a zip refund, this hash contains the transaction specific details")
1635
+ """If this is a zip refund, this hash contains the transaction specific details"""
1636
+
1637
+ class RefundNextActionDisplayDetailsEmailSent(BaseModel):
1638
+ """Contains information about the email sent to the customer"""
1639
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1640
+
1641
+ email_sent_at: Union[int, Any] = Field(default=None, description="The timestamp when the email was sent")
1642
+ """The timestamp when the email was sent"""
1643
+ email_sent_to: Union[str, Any] = Field(default=None, description="The recipient's email address")
1644
+ """The recipient's email address"""
1645
+
1646
+ class RefundNextActionDisplayDetails(BaseModel):
1647
+ """Contains the refund details"""
1648
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1649
+
1650
+ email_sent: Union[RefundNextActionDisplayDetailsEmailSent, Any] = Field(default=None, description="Contains information about the email sent to the customer")
1651
+ """Contains information about the email sent to the customer"""
1652
+ expires_at: Union[int, Any] = Field(default=None, description="The expiry timestamp")
1653
+ """The expiry timestamp"""
1654
+
1655
+ class RefundNextAction(BaseModel):
1656
+ """If the refund has a status of requires_action, this property describes what the refund needs to continue processing"""
1657
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1658
+
1659
+ display_details: Union[RefundNextActionDisplayDetails | None, Any] = Field(default=None, description="Contains the refund details")
1660
+ """Contains the refund details"""
1661
+ type: Union[str, Any] = Field(default=None, description="Type of the next action to perform")
1662
+ """Type of the next action to perform"""
1663
+
1664
+ class Refund(BaseModel):
1665
+ """Refund type definition"""
1666
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1667
+
1668
+ id: Union[str, Any] = Field(default=None)
1669
+ object: Union[str, Any] = Field(default=None)
1670
+ amount: Union[int, Any] = Field(default=None)
1671
+ balance_transaction: Union[str | None, Any] = Field(default=None)
1672
+ charge: Union[str | None, Any] = Field(default=None)
1673
+ created: Union[int, Any] = Field(default=None)
1674
+ currency: Union[str, Any] = Field(default=None)
1675
+ description: Union[str | None, Any] = Field(default=None)
1676
+ destination_details: Union[RefundDestinationDetails | None, Any] = Field(default=None)
1677
+ failure_balance_transaction: Union[str | None, Any] = Field(default=None)
1678
+ failure_reason: Union[str | None, Any] = Field(default=None)
1679
+ instructions_email: Union[str | None, Any] = Field(default=None)
1680
+ metadata: Union[dict[str, str] | None, Any] = Field(default=None)
1681
+ next_action: Union[RefundNextAction | None, Any] = Field(default=None)
1682
+ payment_intent: Union[str | None, Any] = Field(default=None)
1683
+ pending_reason: Union[str | None, Any] = Field(default=None)
1684
+ reason: Union[str | None, Any] = Field(default=None)
1685
+ receipt_number: Union[str | None, Any] = Field(default=None)
1686
+ source_transfer_reversal: Union[str | None, Any] = Field(default=None)
1687
+ status: Union[str | None, Any] = Field(default=None)
1688
+ transfer_reversal: Union[str | None, Any] = Field(default=None)
1689
+
1690
+ class RefundList(BaseModel):
1691
+ """RefundList type definition"""
1692
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1693
+
1694
+ object: Union[str, Any] = Field(default=None)
1695
+ count: Union[int, Any] = Field(default=None)
1696
+ data: Union[list[Refund], Any] = Field(default=None)
1697
+ has_more: Union[bool, Any] = Field(default=None)
1698
+ url: Union[str, Any] = Field(default=None)
1699
+
1700
+ class ProductPackageDimensions(BaseModel):
1701
+ """The dimensions of this product for shipping purposes"""
1702
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1703
+
1704
+ height: Union[float, Any] = Field(default=None, description="Height, in inches")
1705
+ """Height, in inches"""
1706
+ length: Union[float, Any] = Field(default=None, description="Length, in inches")
1707
+ """Length, in inches"""
1708
+ weight: Union[float, Any] = Field(default=None, description="Weight, in ounces")
1709
+ """Weight, in ounces"""
1710
+ width: Union[float, Any] = Field(default=None, description="Width, in inches")
1711
+ """Width, in inches"""
1712
+
1713
+ class ProductFeaturesItem(BaseModel):
1714
+ """Nested schema for Product.features_item"""
1715
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1716
+
1717
+ name: Union[str, Any] = Field(default=None, description="The feature name")
1718
+ """The feature name"""
1719
+
1720
+ class ProductMarketingFeaturesItem(BaseModel):
1721
+ """Nested schema for Product.marketing_features_item"""
1722
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1723
+
1724
+ name: Union[str | None, Any] = Field(default=None, description="The marketing feature name. Up to 80 characters long")
1725
+ """The marketing feature name. Up to 80 characters long"""
1726
+
1727
+ class Product(BaseModel):
1728
+ """Product type definition"""
1729
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1730
+
1731
+ id: Union[str, Any] = Field(default=None)
1732
+ object: Union[str, Any] = Field(default=None)
1733
+ active: Union[bool, Any] = Field(default=None)
1734
+ attributes: Union[list[str], Any] = Field(default=None)
1735
+ created: Union[int, Any] = Field(default=None)
1736
+ default_price: Union[str | None, Any] = Field(default=None)
1737
+ description: Union[str | None, Any] = Field(default=None)
1738
+ features: Union[list[ProductFeaturesItem], Any] = Field(default=None)
1739
+ images: Union[list[str], Any] = Field(default=None)
1740
+ livemode: Union[bool, Any] = Field(default=None)
1741
+ marketing_features: Union[list[ProductMarketingFeaturesItem], Any] = Field(default=None)
1742
+ metadata: Union[dict[str, str], Any] = Field(default=None)
1743
+ name: Union[str, Any] = Field(default=None)
1744
+ package_dimensions: Union[ProductPackageDimensions | None, Any] = Field(default=None)
1745
+ shippable: Union[bool | None, Any] = Field(default=None)
1746
+ statement_descriptor: Union[str | None, Any] = Field(default=None)
1747
+ tax_code: Union[str | None, Any] = Field(default=None)
1748
+ type: Union[str, Any] = Field(default=None)
1749
+ unit_label: Union[str | None, Any] = Field(default=None)
1750
+ updated: Union[int, Any] = Field(default=None)
1751
+ url: Union[str | None, Any] = Field(default=None)
1752
+
1753
+ class ProductList(BaseModel):
1754
+ """ProductList type definition"""
1755
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1756
+
1757
+ object: Union[str, Any] = Field(default=None)
1758
+ data: Union[list[Product], Any] = Field(default=None)
1759
+ has_more: Union[bool, Any] = Field(default=None)
1760
+ url: Union[str, Any] = Field(default=None)
1761
+
1762
+ class ProductSearchResult(BaseModel):
1763
+ """ProductSearchResult type definition"""
1764
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1765
+
1766
+ object: Union[str, Any] = Field(default=None)
1767
+ data: Union[list[Product], Any] = Field(default=None)
1768
+ has_more: Union[bool, Any] = Field(default=None)
1769
+ next_page: Union[str | None, Any] = Field(default=None)
1770
+ url: Union[str, Any] = Field(default=None)
1771
+
1772
+ class BalanceAvailableItemSourceTypes(BaseModel):
1773
+ """Breakdown of balance by source types"""
1774
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1775
+
1776
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1777
+ """Amount for bank_account"""
1778
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1779
+ """Amount for card"""
1780
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1781
+ """Amount for fpx"""
1782
+
1783
+ class BalanceAvailableItem(BaseModel):
1784
+ """Nested schema for Balance.available_item"""
1785
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1786
+
1787
+ amount: Union[int, Any] = Field(default=None, description="Balance amount in the smallest currency unit (e.g., cents)")
1788
+ """Balance amount in the smallest currency unit (e.g., cents)"""
1789
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
1790
+ """Three-letter ISO currency code, in lowercase"""
1791
+ source_types: Union[BalanceAvailableItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1792
+ """Breakdown of balance by source types"""
1793
+
1794
+ class BalanceInstantAvailableItemSourceTypes(BaseModel):
1795
+ """Breakdown of balance by source types"""
1796
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1797
+
1798
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1799
+ """Amount for bank_account"""
1800
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1801
+ """Amount for card"""
1802
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1803
+ """Amount for fpx"""
1804
+
1805
+ class BalanceInstantAvailableItemNetAvailableItemSourceTypes(BaseModel):
1806
+ """Breakdown of balance by source types"""
1807
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1808
+
1809
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1810
+ """Amount for bank_account"""
1811
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1812
+ """Amount for card"""
1813
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1814
+ """Amount for fpx"""
1815
+
1816
+ class BalanceInstantAvailableItemNetAvailableItem(BaseModel):
1817
+ """Nested schema for BalanceInstantAvailableItem.net_available_item"""
1818
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1819
+
1820
+ amount: Union[int, Any] = Field(default=None, description="Net balance amount")
1821
+ """Net balance amount"""
1822
+ destination: Union[str, Any] = Field(default=None, description="ID of the external account")
1823
+ """ID of the external account"""
1824
+ source_types: Union[BalanceInstantAvailableItemNetAvailableItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1825
+ """Breakdown of balance by source types"""
1826
+
1827
+ class BalanceInstantAvailableItem(BaseModel):
1828
+ """Nested schema for Balance.instant_available_item"""
1829
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1830
+
1831
+ amount: Union[int, Any] = Field(default=None, description="Balance amount in the smallest currency unit")
1832
+ """Balance amount in the smallest currency unit"""
1833
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
1834
+ """Three-letter ISO currency code, in lowercase"""
1835
+ source_types: Union[BalanceInstantAvailableItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1836
+ """Breakdown of balance by source types"""
1837
+ net_available: Union[list[BalanceInstantAvailableItemNetAvailableItem] | None, Any] = Field(default=None, description="Net balance amount available after deducting fees")
1838
+ """Net balance amount available after deducting fees"""
1839
+
1840
+ class BalanceIssuingAvailableItemSourceTypes(BaseModel):
1841
+ """Breakdown of balance by source types"""
1842
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1843
+
1844
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1845
+ """Amount for bank_account"""
1846
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1847
+ """Amount for card"""
1848
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1849
+ """Amount for fpx"""
1850
+
1851
+ class BalanceIssuingAvailableItem(BaseModel):
1852
+ """Nested schema for BalanceIssuing.available_item"""
1853
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1854
+
1855
+ amount: Union[int, Any] = Field(default=None, description="Balance amount")
1856
+ """Balance amount"""
1857
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
1858
+ """Three-letter ISO currency code"""
1859
+ source_types: Union[BalanceIssuingAvailableItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1860
+ """Breakdown of balance by source types"""
1861
+
1862
+ class BalanceIssuing(BaseModel):
1863
+ """Funds that are available for use with Issuing cards"""
1864
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1865
+
1866
+ available: Union[list[BalanceIssuingAvailableItem], Any] = Field(default=None, description="Funds available for issuing")
1867
+ """Funds available for issuing"""
1868
+
1869
+ class BalancePendingItemSourceTypes(BaseModel):
1870
+ """Breakdown of balance by source types"""
1871
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1872
+
1873
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1874
+ """Amount for bank_account"""
1875
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1876
+ """Amount for card"""
1877
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1878
+ """Amount for fpx"""
1879
+
1880
+ class BalancePendingItem(BaseModel):
1881
+ """Nested schema for Balance.pending_item"""
1882
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1883
+
1884
+ amount: Union[int, Any] = Field(default=None, description="Balance amount in the smallest currency unit")
1885
+ """Balance amount in the smallest currency unit"""
1886
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
1887
+ """Three-letter ISO currency code, in lowercase"""
1888
+ source_types: Union[BalancePendingItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1889
+ """Breakdown of balance by source types"""
1890
+
1891
+ class BalanceConnectReservedItemSourceTypes(BaseModel):
1892
+ """Breakdown of balance by source types"""
1893
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1894
+
1895
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1896
+ """Amount for bank_account"""
1897
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1898
+ """Amount for card"""
1899
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1900
+ """Amount for fpx"""
1901
+
1902
+ class BalanceConnectReservedItem(BaseModel):
1903
+ """Nested schema for Balance.connect_reserved_item"""
1904
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1905
+
1906
+ amount: Union[int, Any] = Field(default=None, description="Balance amount in the smallest currency unit")
1907
+ """Balance amount in the smallest currency unit"""
1908
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
1909
+ """Three-letter ISO currency code, in lowercase"""
1910
+ source_types: Union[BalanceConnectReservedItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1911
+ """Breakdown of balance by source types"""
1912
+
1913
+ class BalanceRefundAndDisputePrefundingAvailableItemSourceTypes(BaseModel):
1914
+ """Breakdown of balance by source types"""
1915
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1916
+
1917
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1918
+ """Amount for bank_account"""
1919
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1920
+ """Amount for card"""
1921
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1922
+ """Amount for fpx"""
1923
+
1924
+ class BalanceRefundAndDisputePrefundingAvailableItem(BaseModel):
1925
+ """Nested schema for BalanceRefundAndDisputePrefunding.available_item"""
1926
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1927
+
1928
+ amount: Union[int, Any] = Field(default=None, description="Balance amount")
1929
+ """Balance amount"""
1930
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
1931
+ """Three-letter ISO currency code"""
1932
+ source_types: Union[BalanceRefundAndDisputePrefundingAvailableItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1933
+ """Breakdown of balance by source types"""
1934
+
1935
+ class BalanceRefundAndDisputePrefundingPendingItemSourceTypes(BaseModel):
1936
+ """Breakdown of balance by source types"""
1937
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1938
+
1939
+ bank_account: Union[int | None, Any] = Field(default=None, description="Amount for bank_account")
1940
+ """Amount for bank_account"""
1941
+ card: Union[int | None, Any] = Field(default=None, description="Amount for card")
1942
+ """Amount for card"""
1943
+ fpx: Union[int | None, Any] = Field(default=None, description="Amount for fpx")
1944
+ """Amount for fpx"""
1945
+
1946
+ class BalanceRefundAndDisputePrefundingPendingItem(BaseModel):
1947
+ """Nested schema for BalanceRefundAndDisputePrefunding.pending_item"""
1948
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1949
+
1950
+ amount: Union[int, Any] = Field(default=None, description="Balance amount")
1951
+ """Balance amount"""
1952
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code")
1953
+ """Three-letter ISO currency code"""
1954
+ source_types: Union[BalanceRefundAndDisputePrefundingPendingItemSourceTypes | None, Any] = Field(default=None, description="Breakdown of balance by source types")
1955
+ """Breakdown of balance by source types"""
1956
+
1957
+ class BalanceRefundAndDisputePrefunding(BaseModel):
1958
+ """Funds reserved for covering future refunds or disputes"""
1959
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1960
+
1961
+ available: Union[list[BalanceRefundAndDisputePrefundingAvailableItem], Any] = Field(default=None, description="Available funds for refunds and disputes")
1962
+ """Available funds for refunds and disputes"""
1963
+ pending: Union[list[BalanceRefundAndDisputePrefundingPendingItem], Any] = Field(default=None, description="Pending funds for refunds and disputes")
1964
+ """Pending funds for refunds and disputes"""
1965
+
1966
+ class Balance(BaseModel):
1967
+ """Balance type definition"""
1968
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1969
+
1970
+ object: Union[str, Any] = Field(default=None)
1971
+ livemode: Union[bool, Any] = Field(default=None)
1972
+ available: Union[list[BalanceAvailableItem], Any] = Field(default=None)
1973
+ connect_reserved: Union[list[BalanceConnectReservedItem] | None, Any] = Field(default=None)
1974
+ instant_available: Union[list[BalanceInstantAvailableItem] | None, Any] = Field(default=None)
1975
+ issuing: Union[BalanceIssuing | None, Any] = Field(default=None)
1976
+ pending: Union[list[BalancePendingItem], Any] = Field(default=None)
1977
+ refund_and_dispute_prefunding: Union[BalanceRefundAndDisputePrefunding | None, Any] = Field(default=None)
1978
+
1979
+ class BalanceTransactionFeeDetailsItem(BaseModel):
1980
+ """Nested schema for BalanceTransaction.fee_details_item"""
1981
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1982
+
1983
+ amount: Union[int, Any] = Field(default=None, description="Amount of the fee, in cents")
1984
+ """Amount of the fee, in cents"""
1985
+ application: Union[str | None, Any] = Field(default=None, description="ID of the Connect application that earned the fee")
1986
+ """ID of the Connect application that earned the fee"""
1987
+ currency: Union[str, Any] = Field(default=None, description="Three-letter ISO currency code, in lowercase")
1988
+ """Three-letter ISO currency code, in lowercase"""
1989
+ description: Union[str | None, Any] = Field(default=None, description="An arbitrary string attached to the object")
1990
+ """An arbitrary string attached to the object"""
1991
+ type: Union[str, Any] = Field(default=None, description="Type of the fee")
1992
+ """Type of the fee"""
1993
+
1994
+ class BalanceTransaction(BaseModel):
1995
+ """BalanceTransaction type definition"""
1996
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
1997
+
1998
+ id: Union[str, Any] = Field(default=None)
1999
+ object: Union[str, Any] = Field(default=None)
2000
+ amount: Union[int, Any] = Field(default=None)
2001
+ available_on: Union[int, Any] = Field(default=None)
2002
+ balance_type: Union[str, Any] = Field(default=None)
2003
+ created: Union[int, Any] = Field(default=None)
2004
+ currency: Union[str, Any] = Field(default=None)
2005
+ description: Union[str | None, Any] = Field(default=None)
2006
+ exchange_rate: Union[float | None, Any] = Field(default=None)
2007
+ fee: Union[int, Any] = Field(default=None)
2008
+ fee_details: Union[list[BalanceTransactionFeeDetailsItem], Any] = Field(default=None)
2009
+ net: Union[int, Any] = Field(default=None)
2010
+ reporting_category: Union[str, Any] = Field(default=None)
2011
+ source: Union[str | None, Any] = Field(default=None)
2012
+ status: Union[str, Any] = Field(default=None)
2013
+ type: Union[str, Any] = Field(default=None)
2014
+
2015
+ class BalanceTransactionList(BaseModel):
2016
+ """BalanceTransactionList type definition"""
2017
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2018
+
2019
+ object: Union[str, Any] = Field(default=None)
2020
+ data: Union[list[BalanceTransaction], Any] = Field(default=None)
2021
+ has_more: Union[bool, Any] = Field(default=None)
2022
+ url: Union[str, Any] = Field(default=None)
2023
+
2024
+ class PaymentIntent(BaseModel):
2025
+ """PaymentIntent type definition"""
2026
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2027
+
2028
+ id: Union[str, Any] = Field(default=None)
2029
+ object: Union[str, Any] = Field(default=None)
2030
+ amount: Union[int, Any] = Field(default=None)
2031
+ amount_capturable: Union[int, Any] = Field(default=None)
2032
+ amount_received: Union[int, Any] = Field(default=None)
2033
+ application: Union[str | None, Any] = Field(default=None)
2034
+ application_fee_amount: Union[int | None, Any] = Field(default=None)
2035
+ capture_method: Union[str, Any] = Field(default=None)
2036
+ client_secret: Union[str | None, Any] = Field(default=None)
2037
+ confirmation_method: Union[str, Any] = Field(default=None)
2038
+ created: Union[int, Any] = Field(default=None)
2039
+ currency: Union[str, Any] = Field(default=None)
2040
+ customer: Union[str | None, Any] = Field(default=None)
2041
+ description: Union[str | None, Any] = Field(default=None)
2042
+ livemode: Union[bool, Any] = Field(default=None)
2043
+ metadata: Union[dict[str, str], Any] = Field(default=None)
2044
+ payment_method: Union[str | None, Any] = Field(default=None)
2045
+ payment_method_types: Union[list[str], Any] = Field(default=None)
2046
+ status: Union[str, Any] = Field(default=None)
2047
+
2048
+ class PaymentIntentList(BaseModel):
2049
+ """PaymentIntentList type definition"""
2050
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2051
+
2052
+ object: Union[str, Any] = Field(default=None)
2053
+ data: Union[list[PaymentIntent], Any] = Field(default=None)
2054
+ has_more: Union[bool, Any] = Field(default=None)
2055
+ url: Union[str, Any] = Field(default=None)
2056
+
2057
+ class PaymentIntentSearchResult(BaseModel):
2058
+ """PaymentIntentSearchResult type definition"""
2059
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2060
+
2061
+ object: Union[str, Any] = Field(default=None)
2062
+ data: Union[list[PaymentIntent], Any] = Field(default=None)
2063
+ has_more: Union[bool, Any] = Field(default=None)
2064
+ next_page: Union[str | None, Any] = Field(default=None)
2065
+ url: Union[str, Any] = Field(default=None)
2066
+
2067
+ class DisputeEvidenceDetails(BaseModel):
2068
+ """Information about the evidence submission"""
2069
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2070
+
2071
+ due_by: Union[int | None, Any] = Field(default=None, description="Date by which evidence must be submitted, measured in seconds since the Unix epoch")
2072
+ """Date by which evidence must be submitted, measured in seconds since the Unix epoch"""
2073
+ has_evidence: Union[bool, Any] = Field(default=None, description="Whether evidence has been staged for this dispute")
2074
+ """Whether evidence has been staged for this dispute"""
2075
+ past_due: Union[bool, Any] = Field(default=None, description="Whether the last evidence submission was submitted past the due date")
2076
+ """Whether the last evidence submission was submitted past the due date"""
2077
+ submission_count: Union[int, Any] = Field(default=None, description="The number of times evidence has been submitted")
2078
+ """The number of times evidence has been submitted"""
2079
+
2080
+ class Dispute(BaseModel):
2081
+ """Dispute type definition"""
2082
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2083
+
2084
+ id: Union[str, Any] = Field(default=None)
2085
+ object: Union[str, Any] = Field(default=None)
2086
+ amount: Union[int, Any] = Field(default=None)
2087
+ balance_transactions: Union[list[dict[str, Any]], Any] = Field(default=None)
2088
+ charge: Union[str, Any] = Field(default=None)
2089
+ created: Union[int, Any] = Field(default=None)
2090
+ currency: Union[str, Any] = Field(default=None)
2091
+ enhanced_eligibility_types: Union[list[str], Any] = Field(default=None)
2092
+ evidence: Union[dict[str, Any], Any] = Field(default=None)
2093
+ evidence_details: Union[DisputeEvidenceDetails, Any] = Field(default=None)
2094
+ is_charge_refundable: Union[bool, Any] = Field(default=None)
2095
+ livemode: Union[bool, Any] = Field(default=None)
2096
+ metadata: Union[dict[str, str], Any] = Field(default=None)
2097
+ payment_intent: Union[str | None, Any] = Field(default=None)
2098
+ payment_method_details: Union[dict[str, Any] | None, Any] = Field(default=None)
2099
+ reason: Union[str, Any] = Field(default=None)
2100
+ status: Union[str, Any] = Field(default=None)
2101
+
2102
+ class DisputeList(BaseModel):
2103
+ """DisputeList type definition"""
2104
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2105
+
2106
+ object: Union[str, Any] = Field(default=None)
2107
+ data: Union[list[Dispute], Any] = Field(default=None)
2108
+ has_more: Union[bool, Any] = Field(default=None)
2109
+ url: Union[str, Any] = Field(default=None)
2110
+
2111
+ class PayoutTraceId(BaseModel):
2112
+ """A string that identifies this payout as part of a group"""
2113
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2114
+
2115
+ status: Union[str, Any] = Field(default=None, description="The status of the trace ID")
2116
+ """The status of the trace ID"""
2117
+ value: Union[str | None, Any] = Field(default=None, description="The trace ID value")
2118
+ """The trace ID value"""
2119
+
2120
+ class Payout(BaseModel):
2121
+ """Payout type definition"""
2122
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2123
+
2124
+ id: Union[str, Any] = Field(default=None)
2125
+ object: Union[str, Any] = Field(default=None)
2126
+ amount: Union[int, Any] = Field(default=None)
2127
+ application_fee: Union[str | None, Any] = Field(default=None)
2128
+ application_fee_amount: Union[int | None, Any] = Field(default=None)
2129
+ arrival_date: Union[int, Any] = Field(default=None)
2130
+ automatic: Union[bool, Any] = Field(default=None)
2131
+ balance_transaction: Union[str | None, Any] = Field(default=None)
2132
+ created: Union[int, Any] = Field(default=None)
2133
+ currency: Union[str, Any] = Field(default=None)
2134
+ description: Union[str | None, Any] = Field(default=None)
2135
+ destination: Union[str | None, Any] = Field(default=None)
2136
+ failure_balance_transaction: Union[str | None, Any] = Field(default=None)
2137
+ failure_code: Union[str | None, Any] = Field(default=None)
2138
+ failure_message: Union[str | None, Any] = Field(default=None)
2139
+ livemode: Union[bool, Any] = Field(default=None)
2140
+ metadata: Union[dict[str, str], Any] = Field(default=None)
2141
+ method: Union[str, Any] = Field(default=None)
2142
+ original_payout: Union[str | None, Any] = Field(default=None)
2143
+ payout_method: Union[str | None, Any] = Field(default=None)
2144
+ reconciliation_status: Union[str, Any] = Field(default=None)
2145
+ reversed_by: Union[str | None, Any] = Field(default=None)
2146
+ source_balance: Union[str | None, Any] = Field(default=None)
2147
+ source_type: Union[str, Any] = Field(default=None)
2148
+ statement_descriptor: Union[str | None, Any] = Field(default=None)
2149
+ status: Union[str, Any] = Field(default=None)
2150
+ trace_id: Union[PayoutTraceId | None, Any] = Field(default=None)
2151
+ type: Union[str, Any] = Field(default=None)
2152
+
2153
+ class PayoutList(BaseModel):
2154
+ """PayoutList type definition"""
2155
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2156
+
2157
+ object: Union[str, Any] = Field(default=None)
2158
+ data: Union[list[Payout], Any] = Field(default=None)
2159
+ has_more: Union[bool, Any] = Field(default=None)
2160
+ url: Union[str, Any] = Field(default=None)
2161
+
2162
+ class CustomerSearchResult(BaseModel):
2163
+ """CustomerSearchResult type definition"""
2164
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2165
+
2166
+ object: Union[str, Any] = Field(default=None)
2167
+ data: Union[list[Customer], Any] = Field(default=None)
2168
+ has_more: Union[bool, Any] = Field(default=None)
2169
+ next_page: Union[str | None, Any] = Field(default=None)
2170
+ url: Union[str, Any] = Field(default=None)
2171
+
2172
+ class InvoiceSearchResult(BaseModel):
2173
+ """InvoiceSearchResult type definition"""
2174
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2175
+
2176
+ object: Union[str, Any] = Field(default=None)
2177
+ data: Union[list[Invoice], Any] = Field(default=None)
2178
+ has_more: Union[bool, Any] = Field(default=None)
2179
+ next_page: Union[str | None, Any] = Field(default=None)
2180
+ url: Union[str, Any] = Field(default=None)
2181
+
2182
+ class ChargeSearchResult(BaseModel):
2183
+ """ChargeSearchResult type definition"""
2184
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2185
+
2186
+ object: Union[str, Any] = Field(default=None)
2187
+ data: Union[list[Charge], Any] = Field(default=None)
2188
+ has_more: Union[bool, Any] = Field(default=None)
2189
+ next_page: Union[str | None, Any] = Field(default=None)
2190
+ url: Union[str, Any] = Field(default=None)
2191
+
2192
+ class SubscriptionSearchResult(BaseModel):
2193
+ """SubscriptionSearchResult type definition"""
2194
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2195
+
2196
+ object: Union[str, Any] = Field(default=None)
2197
+ data: Union[list[Subscription], Any] = Field(default=None)
2198
+ has_more: Union[bool, Any] = Field(default=None)
2199
+ next_page: Union[str | None, Any] = Field(default=None)
2200
+ url: Union[str, Any] = Field(default=None)
2201
+
2202
+ # ===== METADATA TYPE DEFINITIONS (PYDANTIC) =====
2203
+ # Meta types for operations that extract metadata (e.g., pagination info)
2204
+
2205
+ class CustomersListResultMeta(BaseModel):
2206
+ """Metadata for customers.list operation"""
2207
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2208
+
2209
+ has_more: Union[bool, Any] = Field(default=None)
2210
+
2211
+ class CustomersSearchResultMeta(BaseModel):
2212
+ """Metadata for customers.search operation"""
2213
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2214
+
2215
+ has_more: Union[bool, Any] = Field(default=None)
2216
+
2217
+ class InvoicesListResultMeta(BaseModel):
2218
+ """Metadata for invoices.list operation"""
2219
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2220
+
2221
+ has_more: Union[bool, Any] = Field(default=None)
2222
+
2223
+ class ChargesListResultMeta(BaseModel):
2224
+ """Metadata for charges.list operation"""
2225
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2226
+
2227
+ has_more: Union[bool, Any] = Field(default=None)
2228
+
2229
+ class SubscriptionsListResultMeta(BaseModel):
2230
+ """Metadata for subscriptions.list operation"""
2231
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2232
+
2233
+ has_more: Union[bool, Any] = Field(default=None)
2234
+
2235
+ class RefundsListResultMeta(BaseModel):
2236
+ """Metadata for refunds.list operation"""
2237
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2238
+
2239
+ has_more: Union[bool, Any] = Field(default=None)
2240
+
2241
+ class ProductsListResultMeta(BaseModel):
2242
+ """Metadata for products.list operation"""
2243
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2244
+
2245
+ has_more: Union[bool, Any] = Field(default=None)
2246
+
2247
+ class ProductsSearchResultMeta(BaseModel):
2248
+ """Metadata for products.search operation"""
2249
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2250
+
2251
+ has_more: Union[bool, Any] = Field(default=None)
2252
+
2253
+ class BalanceTransactionsListResultMeta(BaseModel):
2254
+ """Metadata for balance_transactions.list operation"""
2255
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2256
+
2257
+ has_more: Union[bool, Any] = Field(default=None)
2258
+
2259
+ class PaymentIntentsListResultMeta(BaseModel):
2260
+ """Metadata for payment_intents.list operation"""
2261
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2262
+
2263
+ has_more: Union[bool, Any] = Field(default=None)
2264
+
2265
+ class PaymentIntentsSearchResultMeta(BaseModel):
2266
+ """Metadata for payment_intents.search operation"""
2267
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2268
+
2269
+ has_more: Union[bool, Any] = Field(default=None)
2270
+
2271
+ class DisputesListResultMeta(BaseModel):
2272
+ """Metadata for disputes.list operation"""
2273
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2274
+
2275
+ has_more: Union[bool, Any] = Field(default=None)
2276
+
2277
+ class PayoutsListResultMeta(BaseModel):
2278
+ """Metadata for payouts.list operation"""
2279
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
2280
+
2281
+ has_more: Union[bool, Any] = Field(default=None)
2282
+
2283
+ # ===== RESPONSE ENVELOPE MODELS =====
2284
+
2285
+ # Type variables for generic envelope models
2286
+ T = TypeVar('T')
2287
+ S = TypeVar('S')
2288
+
2289
+
2290
+ class StripeExecuteResult(BaseModel, Generic[T]):
2291
+ """Response envelope with data only.
2292
+
2293
+ Used for actions that return data without metadata.
2294
+ """
2295
+ model_config = ConfigDict(extra="forbid")
2296
+
2297
+ data: T
2298
+ """Response data containing the result of the action."""
2299
+
2300
+
2301
+ class StripeExecuteResultWithMeta(StripeExecuteResult[T], Generic[T, S]):
2302
+ """Response envelope with data and metadata.
2303
+
2304
+ Used for actions that return both data and metadata (e.g., pagination info).
2305
+ """
2306
+ meta: S
2307
+ """Metadata about the response (e.g., pagination cursors, record counts)."""
2308
+
2309
+
2310
+ # ===== OPERATION RESULT TYPE ALIASES =====
2311
+
2312
+ # Concrete type aliases for each operation result.
2313
+ # These provide simpler, more readable type annotations than using the generic forms.
2314
+
2315
+ CustomersListResult = StripeExecuteResultWithMeta[list[Customer], CustomersListResultMeta]
2316
+ """Result type for customers.list operation with data and metadata."""
2317
+
2318
+ CustomersSearchResult = StripeExecuteResultWithMeta[list[Customer], CustomersSearchResultMeta]
2319
+ """Result type for customers.search operation with data and metadata."""
2320
+
2321
+ InvoicesListResult = StripeExecuteResultWithMeta[list[Invoice], InvoicesListResultMeta]
2322
+ """Result type for invoices.list operation with data and metadata."""
2323
+
2324
+ ChargesListResult = StripeExecuteResultWithMeta[list[Charge], ChargesListResultMeta]
2325
+ """Result type for charges.list operation with data and metadata."""
2326
+
2327
+ SubscriptionsListResult = StripeExecuteResultWithMeta[list[Subscription], SubscriptionsListResultMeta]
2328
+ """Result type for subscriptions.list operation with data and metadata."""
2329
+
2330
+ RefundsListResult = StripeExecuteResultWithMeta[list[Refund], RefundsListResultMeta]
2331
+ """Result type for refunds.list operation with data and metadata."""
2332
+
2333
+ ProductsListResult = StripeExecuteResultWithMeta[list[Product], ProductsListResultMeta]
2334
+ """Result type for products.list operation with data and metadata."""
2335
+
2336
+ ProductsSearchResult = StripeExecuteResultWithMeta[list[Product], ProductsSearchResultMeta]
2337
+ """Result type for products.search operation with data and metadata."""
2338
+
2339
+ BalanceTransactionsListResult = StripeExecuteResultWithMeta[list[BalanceTransaction], BalanceTransactionsListResultMeta]
2340
+ """Result type for balance_transactions.list operation with data and metadata."""
2341
+
2342
+ PaymentIntentsListResult = StripeExecuteResultWithMeta[list[PaymentIntent], PaymentIntentsListResultMeta]
2343
+ """Result type for payment_intents.list operation with data and metadata."""
2344
+
2345
+ PaymentIntentsSearchResult = StripeExecuteResultWithMeta[list[PaymentIntent], PaymentIntentsSearchResultMeta]
2346
+ """Result type for payment_intents.search operation with data and metadata."""
2347
+
2348
+ DisputesListResult = StripeExecuteResultWithMeta[list[Dispute], DisputesListResultMeta]
2349
+ """Result type for disputes.list operation with data and metadata."""
2350
+
2351
+ PayoutsListResult = StripeExecuteResultWithMeta[list[Payout], PayoutsListResultMeta]
2352
+ """Result type for payouts.list operation with data and metadata."""
2353
+