dodopayments 1.78.0__py3-none-any.whl → 1.81.0__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.
@@ -6,7 +6,11 @@ from typing import Dict, List, Iterable, Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..types import Currency, checkout_session_create_params, checkout_session_preview_params
9
+ from ..types import (
10
+ Currency,
11
+ checkout_session_create_params,
12
+ checkout_session_preview_params,
13
+ )
10
14
  from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
15
  from .._utils import maybe_transform, async_maybe_transform
12
16
  from .._compat import cached_property
@@ -19,11 +23,17 @@ from .._response import (
19
23
  )
20
24
  from .._base_client import make_request_options
21
25
  from ..types.currency import Currency
26
+ from ..types.custom_field_param import CustomFieldParam
22
27
  from ..types.payment_method_types import PaymentMethodTypes
23
28
  from ..types.customer_request_param import CustomerRequestParam
29
+ from ..types.product_item_req_param import ProductItemReqParam
24
30
  from ..types.checkout_session_status import CheckoutSessionStatus
31
+ from ..types.subscription_data_param import SubscriptionDataParam
25
32
  from ..types.checkout_session_response import CheckoutSessionResponse
33
+ from ..types.checkout_session_flags_param import CheckoutSessionFlagsParam
26
34
  from ..types.checkout_session_preview_response import CheckoutSessionPreviewResponse
35
+ from ..types.checkout_session_customization_param import CheckoutSessionCustomizationParam
36
+ from ..types.checkout_session_billing_address_param import CheckoutSessionBillingAddressParam
27
37
 
28
38
  __all__ = ["CheckoutSessionsResource", "AsyncCheckoutSessionsResource"]
29
39
 
@@ -51,16 +61,16 @@ class CheckoutSessionsResource(SyncAPIResource):
51
61
  def create(
52
62
  self,
53
63
  *,
54
- product_cart: Iterable[checkout_session_create_params.ProductCart],
64
+ product_cart: Iterable[ProductItemReqParam],
55
65
  allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
56
- billing_address: Optional[checkout_session_create_params.BillingAddress] | Omit = omit,
66
+ billing_address: Optional[CheckoutSessionBillingAddressParam] | Omit = omit,
57
67
  billing_currency: Optional[Currency] | Omit = omit,
58
68
  confirm: bool | Omit = omit,
59
- custom_fields: Optional[Iterable[checkout_session_create_params.CustomField]] | Omit = omit,
69
+ custom_fields: Optional[Iterable[CustomFieldParam]] | Omit = omit,
60
70
  customer: Optional[CustomerRequestParam] | Omit = omit,
61
- customization: checkout_session_create_params.Customization | Omit = omit,
71
+ customization: CheckoutSessionCustomizationParam | Omit = omit,
62
72
  discount_code: Optional[str] | Omit = omit,
63
- feature_flags: checkout_session_create_params.FeatureFlags | Omit = omit,
73
+ feature_flags: CheckoutSessionFlagsParam | Omit = omit,
64
74
  force_3ds: Optional[bool] | Omit = omit,
65
75
  metadata: Optional[Dict[str, str]] | Omit = omit,
66
76
  minimal_address: bool | Omit = omit,
@@ -69,7 +79,7 @@ class CheckoutSessionsResource(SyncAPIResource):
69
79
  return_url: Optional[str] | Omit = omit,
70
80
  short_link: bool | Omit = omit,
71
81
  show_saved_payment_methods: bool | Omit = omit,
72
- subscription_data: Optional[checkout_session_create_params.SubscriptionData] | Omit = omit,
82
+ subscription_data: Optional[SubscriptionDataParam] | Omit = omit,
73
83
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
74
84
  # The extra values given here take precedence over values defined on the client or passed to this method.
75
85
  extra_headers: Headers | None = None,
@@ -192,16 +202,16 @@ class CheckoutSessionsResource(SyncAPIResource):
192
202
  def preview(
193
203
  self,
194
204
  *,
195
- product_cart: Iterable[checkout_session_preview_params.ProductCart],
205
+ product_cart: Iterable[ProductItemReqParam],
196
206
  allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
197
- billing_address: Optional[checkout_session_preview_params.BillingAddress] | Omit = omit,
207
+ billing_address: Optional[CheckoutSessionBillingAddressParam] | Omit = omit,
198
208
  billing_currency: Optional[Currency] | Omit = omit,
199
209
  confirm: bool | Omit = omit,
200
- custom_fields: Optional[Iterable[checkout_session_preview_params.CustomField]] | Omit = omit,
210
+ custom_fields: Optional[Iterable[CustomFieldParam]] | Omit = omit,
201
211
  customer: Optional[CustomerRequestParam] | Omit = omit,
202
- customization: checkout_session_preview_params.Customization | Omit = omit,
212
+ customization: CheckoutSessionCustomizationParam | Omit = omit,
203
213
  discount_code: Optional[str] | Omit = omit,
204
- feature_flags: checkout_session_preview_params.FeatureFlags | Omit = omit,
214
+ feature_flags: CheckoutSessionFlagsParam | Omit = omit,
205
215
  force_3ds: Optional[bool] | Omit = omit,
206
216
  metadata: Optional[Dict[str, str]] | Omit = omit,
207
217
  minimal_address: bool | Omit = omit,
@@ -210,7 +220,7 @@ class CheckoutSessionsResource(SyncAPIResource):
210
220
  return_url: Optional[str] | Omit = omit,
211
221
  short_link: bool | Omit = omit,
212
222
  show_saved_payment_methods: bool | Omit = omit,
213
- subscription_data: Optional[checkout_session_preview_params.SubscriptionData] | Omit = omit,
223
+ subscription_data: Optional[SubscriptionDataParam] | Omit = omit,
214
224
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215
225
  # The extra values given here take precedence over values defined on the client or passed to this method.
216
226
  extra_headers: Headers | None = None,
@@ -323,16 +333,16 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
323
333
  async def create(
324
334
  self,
325
335
  *,
326
- product_cart: Iterable[checkout_session_create_params.ProductCart],
336
+ product_cart: Iterable[ProductItemReqParam],
327
337
  allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
328
- billing_address: Optional[checkout_session_create_params.BillingAddress] | Omit = omit,
338
+ billing_address: Optional[CheckoutSessionBillingAddressParam] | Omit = omit,
329
339
  billing_currency: Optional[Currency] | Omit = omit,
330
340
  confirm: bool | Omit = omit,
331
- custom_fields: Optional[Iterable[checkout_session_create_params.CustomField]] | Omit = omit,
341
+ custom_fields: Optional[Iterable[CustomFieldParam]] | Omit = omit,
332
342
  customer: Optional[CustomerRequestParam] | Omit = omit,
333
- customization: checkout_session_create_params.Customization | Omit = omit,
343
+ customization: CheckoutSessionCustomizationParam | Omit = omit,
334
344
  discount_code: Optional[str] | Omit = omit,
335
- feature_flags: checkout_session_create_params.FeatureFlags | Omit = omit,
345
+ feature_flags: CheckoutSessionFlagsParam | Omit = omit,
336
346
  force_3ds: Optional[bool] | Omit = omit,
337
347
  metadata: Optional[Dict[str, str]] | Omit = omit,
338
348
  minimal_address: bool | Omit = omit,
@@ -341,7 +351,7 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
341
351
  return_url: Optional[str] | Omit = omit,
342
352
  short_link: bool | Omit = omit,
343
353
  show_saved_payment_methods: bool | Omit = omit,
344
- subscription_data: Optional[checkout_session_create_params.SubscriptionData] | Omit = omit,
354
+ subscription_data: Optional[SubscriptionDataParam] | Omit = omit,
345
355
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
346
356
  # The extra values given here take precedence over values defined on the client or passed to this method.
347
357
  extra_headers: Headers | None = None,
@@ -464,16 +474,16 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
464
474
  async def preview(
465
475
  self,
466
476
  *,
467
- product_cart: Iterable[checkout_session_preview_params.ProductCart],
477
+ product_cart: Iterable[ProductItemReqParam],
468
478
  allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
469
- billing_address: Optional[checkout_session_preview_params.BillingAddress] | Omit = omit,
479
+ billing_address: Optional[CheckoutSessionBillingAddressParam] | Omit = omit,
470
480
  billing_currency: Optional[Currency] | Omit = omit,
471
481
  confirm: bool | Omit = omit,
472
- custom_fields: Optional[Iterable[checkout_session_preview_params.CustomField]] | Omit = omit,
482
+ custom_fields: Optional[Iterable[CustomFieldParam]] | Omit = omit,
473
483
  customer: Optional[CustomerRequestParam] | Omit = omit,
474
- customization: checkout_session_preview_params.Customization | Omit = omit,
484
+ customization: CheckoutSessionCustomizationParam | Omit = omit,
475
485
  discount_code: Optional[str] | Omit = omit,
476
- feature_flags: checkout_session_preview_params.FeatureFlags | Omit = omit,
486
+ feature_flags: CheckoutSessionFlagsParam | Omit = omit,
477
487
  force_3ds: Optional[bool] | Omit = omit,
478
488
  metadata: Optional[Dict[str, str]] | Omit = omit,
479
489
  minimal_address: bool | Omit = omit,
@@ -482,7 +492,7 @@ class AsyncCheckoutSessionsResource(AsyncAPIResource):
482
492
  return_url: Optional[str] | Omit = omit,
483
493
  short_link: bool | Omit = omit,
484
494
  show_saved_payment_methods: bool | Omit = omit,
485
- subscription_data: Optional[checkout_session_preview_params.SubscriptionData] | Omit = omit,
495
+ subscription_data: Optional[SubscriptionDataParam] | Omit = omit,
486
496
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
487
497
  # The extra values given here take precedence over values defined on the client or passed to this method.
488
498
  extra_headers: Headers | None = None,
@@ -355,6 +355,7 @@ class SubscriptionsResource(SyncAPIResource):
355
355
  quantity: int,
356
356
  addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
357
357
  metadata: Optional[Dict[str, str]] | Omit = omit,
358
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]] | Omit = omit,
358
359
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
359
360
  # The extra values given here take precedence over values defined on the client or passed to this method.
360
361
  extra_headers: Headers | None = None,
@@ -376,6 +377,14 @@ class SubscriptionsResource(SyncAPIResource):
376
377
  metadata: Metadata for the payment. If not passed, the metadata of the subscription will
377
378
  be taken
378
379
 
380
+ on_payment_failure: Controls behavior when the plan change payment fails.
381
+
382
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
383
+ - `apply_change` (default): Apply plan change immediately regardless of payment
384
+ outcome
385
+
386
+ If not specified, uses the business-level default setting.
387
+
379
388
  extra_headers: Send extra headers
380
389
 
381
390
  extra_query: Add additional query parameters to the request
@@ -396,6 +405,7 @@ class SubscriptionsResource(SyncAPIResource):
396
405
  "quantity": quantity,
397
406
  "addons": addons,
398
407
  "metadata": metadata,
408
+ "on_payment_failure": on_payment_failure,
399
409
  },
400
410
  subscription_change_plan_params.SubscriptionChangePlanParams,
401
411
  ),
@@ -481,6 +491,7 @@ class SubscriptionsResource(SyncAPIResource):
481
491
  quantity: int,
482
492
  addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
483
493
  metadata: Optional[Dict[str, str]] | Omit = omit,
494
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]] | Omit = omit,
484
495
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
485
496
  # The extra values given here take precedence over values defined on the client or passed to this method.
486
497
  extra_headers: Headers | None = None,
@@ -502,6 +513,14 @@ class SubscriptionsResource(SyncAPIResource):
502
513
  metadata: Metadata for the payment. If not passed, the metadata of the subscription will
503
514
  be taken
504
515
 
516
+ on_payment_failure: Controls behavior when the plan change payment fails.
517
+
518
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
519
+ - `apply_change` (default): Apply plan change immediately regardless of payment
520
+ outcome
521
+
522
+ If not specified, uses the business-level default setting.
523
+
505
524
  extra_headers: Send extra headers
506
525
 
507
526
  extra_query: Add additional query parameters to the request
@@ -521,6 +540,7 @@ class SubscriptionsResource(SyncAPIResource):
521
540
  "quantity": quantity,
522
541
  "addons": addons,
523
542
  "metadata": metadata,
543
+ "on_payment_failure": on_payment_failure,
524
544
  },
525
545
  subscription_preview_change_plan_params.SubscriptionPreviewChangePlanParams,
526
546
  ),
@@ -1022,6 +1042,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1022
1042
  quantity: int,
1023
1043
  addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
1024
1044
  metadata: Optional[Dict[str, str]] | Omit = omit,
1045
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]] | Omit = omit,
1025
1046
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1026
1047
  # The extra values given here take precedence over values defined on the client or passed to this method.
1027
1048
  extra_headers: Headers | None = None,
@@ -1043,6 +1064,14 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1043
1064
  metadata: Metadata for the payment. If not passed, the metadata of the subscription will
1044
1065
  be taken
1045
1066
 
1067
+ on_payment_failure: Controls behavior when the plan change payment fails.
1068
+
1069
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
1070
+ - `apply_change` (default): Apply plan change immediately regardless of payment
1071
+ outcome
1072
+
1073
+ If not specified, uses the business-level default setting.
1074
+
1046
1075
  extra_headers: Send extra headers
1047
1076
 
1048
1077
  extra_query: Add additional query parameters to the request
@@ -1063,6 +1092,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1063
1092
  "quantity": quantity,
1064
1093
  "addons": addons,
1065
1094
  "metadata": metadata,
1095
+ "on_payment_failure": on_payment_failure,
1066
1096
  },
1067
1097
  subscription_change_plan_params.SubscriptionChangePlanParams,
1068
1098
  ),
@@ -1148,6 +1178,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1148
1178
  quantity: int,
1149
1179
  addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
1150
1180
  metadata: Optional[Dict[str, str]] | Omit = omit,
1181
+ on_payment_failure: Optional[Literal["prevent_change", "apply_change"]] | Omit = omit,
1151
1182
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1152
1183
  # The extra values given here take precedence over values defined on the client or passed to this method.
1153
1184
  extra_headers: Headers | None = None,
@@ -1169,6 +1200,14 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1169
1200
  metadata: Metadata for the payment. If not passed, the metadata of the subscription will
1170
1201
  be taken
1171
1202
 
1203
+ on_payment_failure: Controls behavior when the plan change payment fails.
1204
+
1205
+ - `prevent_change`: Keep subscription on current plan until payment succeeds
1206
+ - `apply_change` (default): Apply plan change immediately regardless of payment
1207
+ outcome
1208
+
1209
+ If not specified, uses the business-level default setting.
1210
+
1172
1211
  extra_headers: Send extra headers
1173
1212
 
1174
1213
  extra_query: Add additional query parameters to the request
@@ -1188,6 +1227,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
1188
1227
  "quantity": quantity,
1189
1228
  "addons": addons,
1190
1229
  "metadata": metadata,
1230
+ "on_payment_failure": on_payment_failure,
1191
1231
  },
1192
1232
  subscription_preview_change_plan_params.SubscriptionPreviewChangePlanParams,
1193
1233
  ),
@@ -35,11 +35,13 @@ from .meter_aggregation import MeterAggregation as MeterAggregation
35
35
  from .meter_list_params import MeterListParams as MeterListParams
36
36
  from .add_meter_to_price import AddMeterToPrice as AddMeterToPrice
37
37
  from .attach_addon_param import AttachAddonParam as AttachAddonParam
38
+ from .custom_field_param import CustomFieldParam as CustomFieldParam
38
39
  from .license_key_status import LicenseKeyStatus as LicenseKeyStatus
39
40
  from .meter_filter_param import MeterFilterParam as MeterFilterParam
40
41
  from .new_customer_param import NewCustomerParam as NewCustomerParam
41
42
  from .payout_list_params import PayoutListParams as PayoutListParams
42
43
  from .refund_list_params import RefundListParams as RefundListParams
44
+ from .theme_config_param import ThemeConfigParam as ThemeConfigParam
43
45
  from .webhook_event_type import WebhookEventType as WebhookEventType
44
46
  from .addon_create_params import AddonCreateParams as AddonCreateParams
45
47
  from .addon_update_params import AddonUpdateParams as AddonUpdateParams
@@ -52,6 +54,7 @@ from .payment_list_params import PaymentListParams as PaymentListParams
52
54
  from .product_list_params import ProductListParams as ProductListParams
53
55
  from .subscription_status import SubscriptionStatus as SubscriptionStatus
54
56
  from .webhook_list_params import WebhookListParams as WebhookListParams
57
+ from .balance_ledger_entry import BalanceLedgerEntry as BalanceLedgerEntry
55
58
  from .customer_list_params import CustomerListParams as CustomerListParams
56
59
  from .discount_list_params import DiscountListParams as DiscountListParams
57
60
  from .license_key_duration import LicenseKeyDuration as LicenseKeyDuration
@@ -75,6 +78,7 @@ from .customer_request_param import CustomerRequestParam as CustomerRequestParam
75
78
  from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams
76
79
  from .discount_create_params import DiscountCreateParams as DiscountCreateParams
77
80
  from .discount_update_params import DiscountUpdateParams as DiscountUpdateParams
81
+ from .product_item_req_param import ProductItemReqParam as ProductItemReqParam
78
82
  from .checkout_session_status import CheckoutSessionStatus as CheckoutSessionStatus
79
83
  from .customer_portal_session import CustomerPortalSession as CustomerPortalSession
80
84
  from .license_activate_params import LicenseActivateParams as LicenseActivateParams
@@ -82,6 +86,8 @@ from .license_key_list_params import LicenseKeyListParams as LicenseKeyListParam
82
86
  from .license_validate_params import LicenseValidateParams as LicenseValidateParams
83
87
  from .meter_aggregation_param import MeterAggregationParam as MeterAggregationParam
84
88
  from .payment_create_response import PaymentCreateResponse as PaymentCreateResponse
89
+ from .subscription_data_param import SubscriptionDataParam as SubscriptionDataParam
90
+ from .theme_mode_config_param import ThemeModeConfigParam as ThemeModeConfigParam
85
91
  from .usage_event_list_params import UsageEventListParams as UsageEventListParams
86
92
  from .add_meter_to_price_param import AddMeterToPriceParam as AddMeterToPriceParam
87
93
  from .addon_cart_response_item import AddonCartResponseItem as AddonCartResponseItem
@@ -107,6 +113,7 @@ from .unsafe_unwrap_webhook_event import UnsafeUnwrapWebhookEvent as UnsafeUnwra
107
113
  from .usage_event_ingest_response import UsageEventIngestResponse as UsageEventIngestResponse
108
114
  from .addon_update_images_response import AddonUpdateImagesResponse as AddonUpdateImagesResponse
109
115
  from .brand_update_images_response import BrandUpdateImagesResponse as BrandUpdateImagesResponse
116
+ from .checkout_session_flags_param import CheckoutSessionFlagsParam as CheckoutSessionFlagsParam
110
117
  from .dispute_opened_webhook_event import DisputeOpenedWebhookEvent as DisputeOpenedWebhookEvent
111
118
  from .on_demand_subscription_param import OnDemandSubscriptionParam as OnDemandSubscriptionParam
112
119
  from .payment_failed_webhook_event import PaymentFailedWebhookEvent as PaymentFailedWebhookEvent
@@ -115,6 +122,7 @@ from .subscription_create_response import SubscriptionCreateResponse as Subscrip
115
122
  from .dispute_expired_webhook_event import DisputeExpiredWebhookEvent as DisputeExpiredWebhookEvent
116
123
  from .product_update_files_response import ProductUpdateFilesResponse as ProductUpdateFilesResponse
117
124
  from .attach_existing_customer_param import AttachExistingCustomerParam as AttachExistingCustomerParam
125
+ from .balance_retrieve_ledger_params import BalanceRetrieveLedgerParams as BalanceRetrieveLedgerParams
118
126
  from .checkout_session_create_params import CheckoutSessionCreateParams as CheckoutSessionCreateParams
119
127
  from .dispute_accepted_webhook_event import DisputeAcceptedWebhookEvent as DisputeAcceptedWebhookEvent
120
128
  from .refund_succeeded_webhook_event import RefundSucceededWebhookEvent as RefundSucceededWebhookEvent
@@ -137,8 +145,12 @@ from .subscription_expired_webhook_event import SubscriptionExpiredWebhookEvent
137
145
  from .subscription_on_hold_webhook_event import SubscriptionOnHoldWebhookEvent as SubscriptionOnHoldWebhookEvent
138
146
  from .subscription_renewed_webhook_event import SubscriptionRenewedWebhookEvent as SubscriptionRenewedWebhookEvent
139
147
  from .subscription_updated_webhook_event import SubscriptionUpdatedWebhookEvent as SubscriptionUpdatedWebhookEvent
148
+ from .checkout_session_customization_param import CheckoutSessionCustomizationParam as CheckoutSessionCustomizationParam
140
149
  from .payment_retrieve_line_items_response import PaymentRetrieveLineItemsResponse as PaymentRetrieveLineItemsResponse
141
150
  from .subscription_cancelled_webhook_event import SubscriptionCancelledWebhookEvent as SubscriptionCancelledWebhookEvent
151
+ from .checkout_session_billing_address_param import (
152
+ CheckoutSessionBillingAddressParam as CheckoutSessionBillingAddressParam,
153
+ )
142
154
  from .misc_list_supported_countries_response import (
143
155
  MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse,
144
156
  )
@@ -0,0 +1,55 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from .._models import BaseModel
8
+ from .currency import Currency
9
+
10
+ __all__ = ["BalanceLedgerEntry"]
11
+
12
+
13
+ class BalanceLedgerEntry(BaseModel):
14
+ id: str
15
+
16
+ amount: int
17
+
18
+ business_id: str
19
+
20
+ created_at: datetime
21
+
22
+ currency: Currency
23
+
24
+ event_type: Literal[
25
+ "payment",
26
+ "refund",
27
+ "refund_reversal",
28
+ "dispute",
29
+ "dispute_reversal",
30
+ "tax",
31
+ "tax_reversal",
32
+ "payment_fees",
33
+ "refund_fees",
34
+ "refund_fees_reversal",
35
+ "dispute_fees",
36
+ "payout",
37
+ "payout_fees",
38
+ "payout_reversal",
39
+ "payout_fees_reversal",
40
+ "dodo_credits",
41
+ "adjustment",
42
+ "currency_conversion",
43
+ ]
44
+
45
+ is_credit: bool
46
+
47
+ usd_equivalent_amount: int
48
+
49
+ after_balance: Optional[int] = None
50
+
51
+ before_balance: Optional[int] = None
52
+
53
+ description: Optional[str] = None
54
+
55
+ reference_object_id: Optional[str] = None
@@ -0,0 +1,204 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from datetime import datetime
7
+ from typing_extensions import Literal, Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["BalanceRetrieveLedgerParams"]
12
+
13
+
14
+ class BalanceRetrieveLedgerParams(TypedDict, total=False):
15
+ created_at_gte: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
16
+ """Get events after this created time"""
17
+
18
+ created_at_lte: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
19
+ """Get events created before this time"""
20
+
21
+ currency: Literal[
22
+ "AED",
23
+ "ALL",
24
+ "AMD",
25
+ "ANG",
26
+ "AOA",
27
+ "ARS",
28
+ "AUD",
29
+ "AWG",
30
+ "AZN",
31
+ "BAM",
32
+ "BBD",
33
+ "BDT",
34
+ "BGN",
35
+ "BHD",
36
+ "BIF",
37
+ "BMD",
38
+ "BND",
39
+ "BOB",
40
+ "BRL",
41
+ "BSD",
42
+ "BWP",
43
+ "BYN",
44
+ "BZD",
45
+ "CAD",
46
+ "CHF",
47
+ "CLP",
48
+ "CNY",
49
+ "COP",
50
+ "CRC",
51
+ "CUP",
52
+ "CVE",
53
+ "CZK",
54
+ "DJF",
55
+ "DKK",
56
+ "DOP",
57
+ "DZD",
58
+ "EGP",
59
+ "ETB",
60
+ "EUR",
61
+ "FJD",
62
+ "FKP",
63
+ "GBP",
64
+ "GEL",
65
+ "GHS",
66
+ "GIP",
67
+ "GMD",
68
+ "GNF",
69
+ "GTQ",
70
+ "GYD",
71
+ "HKD",
72
+ "HNL",
73
+ "HRK",
74
+ "HTG",
75
+ "HUF",
76
+ "IDR",
77
+ "ILS",
78
+ "INR",
79
+ "IQD",
80
+ "JMD",
81
+ "JOD",
82
+ "JPY",
83
+ "KES",
84
+ "KGS",
85
+ "KHR",
86
+ "KMF",
87
+ "KRW",
88
+ "KWD",
89
+ "KYD",
90
+ "KZT",
91
+ "LAK",
92
+ "LBP",
93
+ "LKR",
94
+ "LRD",
95
+ "LSL",
96
+ "LYD",
97
+ "MAD",
98
+ "MDL",
99
+ "MGA",
100
+ "MKD",
101
+ "MMK",
102
+ "MNT",
103
+ "MOP",
104
+ "MRU",
105
+ "MUR",
106
+ "MVR",
107
+ "MWK",
108
+ "MXN",
109
+ "MYR",
110
+ "MZN",
111
+ "NAD",
112
+ "NGN",
113
+ "NIO",
114
+ "NOK",
115
+ "NPR",
116
+ "NZD",
117
+ "OMR",
118
+ "PAB",
119
+ "PEN",
120
+ "PGK",
121
+ "PHP",
122
+ "PKR",
123
+ "PLN",
124
+ "PYG",
125
+ "QAR",
126
+ "RON",
127
+ "RSD",
128
+ "RUB",
129
+ "RWF",
130
+ "SAR",
131
+ "SBD",
132
+ "SCR",
133
+ "SEK",
134
+ "SGD",
135
+ "SHP",
136
+ "SLE",
137
+ "SLL",
138
+ "SOS",
139
+ "SRD",
140
+ "SSP",
141
+ "STN",
142
+ "SVC",
143
+ "SZL",
144
+ "THB",
145
+ "TND",
146
+ "TOP",
147
+ "TRY",
148
+ "TTD",
149
+ "TWD",
150
+ "TZS",
151
+ "UAH",
152
+ "UGX",
153
+ "USD",
154
+ "UYU",
155
+ "UZS",
156
+ "VES",
157
+ "VND",
158
+ "VUV",
159
+ "WST",
160
+ "XAF",
161
+ "XCD",
162
+ "XOF",
163
+ "XPF",
164
+ "YER",
165
+ "ZAR",
166
+ "ZMW",
167
+ ]
168
+ """Filter by currency"""
169
+
170
+ event_type: Literal[
171
+ "payment",
172
+ "refund",
173
+ "refund_reversal",
174
+ "dispute",
175
+ "dispute_reversal",
176
+ "tax",
177
+ "tax_reversal",
178
+ "payment_fees",
179
+ "refund_fees",
180
+ "refund_fees_reversal",
181
+ "dispute_fees",
182
+ "payout",
183
+ "payout_fees",
184
+ "payout_reversal",
185
+ "payout_fees_reversal",
186
+ "dodo_credits",
187
+ "adjustment",
188
+ "currency_conversion",
189
+ ]
190
+ """Filter by Ledger Event Type"""
191
+
192
+ limit: int
193
+ """Min : 1, Max : 100, default 10"""
194
+
195
+ page_number: int
196
+ """Page number default is 0"""
197
+
198
+ page_size: int
199
+ """Page size default is 10 max is 100"""
200
+
201
+ reference_object_id: str
202
+ """
203
+ Get events history of a specific object like payment/subscription/refund/dispute
204
+ """
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ from .country_code import CountryCode
9
+
10
+ __all__ = ["CheckoutSessionBillingAddressParam"]
11
+
12
+
13
+ class CheckoutSessionBillingAddressParam(TypedDict, total=False):
14
+ country: Required[CountryCode]
15
+ """Two-letter ISO country code (ISO 3166-1 alpha-2)"""
16
+
17
+ city: Optional[str]
18
+ """City name"""
19
+
20
+ state: Optional[str]
21
+ """State or province name"""
22
+
23
+ street: Optional[str]
24
+ """Street address including house number and unit/apartment if applicable"""
25
+
26
+ zipcode: Optional[str]
27
+ """Postal code or ZIP code"""