dodopayments 1.51.1__py3-none-any.whl → 1.56.5__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 (139) hide show
  1. dodopayments/__init__.py +5 -1
  2. dodopayments/_base_client.py +12 -12
  3. dodopayments/_client.py +52 -14
  4. dodopayments/_compat.py +48 -48
  5. dodopayments/_exceptions.py +4 -0
  6. dodopayments/_models.py +50 -44
  7. dodopayments/_qs.py +7 -7
  8. dodopayments/_streaming.py +4 -6
  9. dodopayments/_types.py +18 -11
  10. dodopayments/_utils/__init__.py +8 -2
  11. dodopayments/_utils/_compat.py +45 -0
  12. dodopayments/_utils/_datetime_parse.py +136 -0
  13. dodopayments/_utils/_transform.py +13 -3
  14. dodopayments/_utils/_typing.py +1 -1
  15. dodopayments/_utils/_utils.py +5 -6
  16. dodopayments/_version.py +1 -1
  17. dodopayments/resources/__init__.py +28 -0
  18. dodopayments/resources/addons.py +29 -29
  19. dodopayments/resources/brands.py +29 -29
  20. dodopayments/resources/checkout_sessions.py +110 -27
  21. dodopayments/resources/customers/__init__.py +14 -0
  22. dodopayments/resources/customers/customer_portal.py +5 -5
  23. dodopayments/resources/customers/customers.py +53 -21
  24. dodopayments/resources/customers/wallets/__init__.py +33 -0
  25. dodopayments/resources/customers/wallets/ledger_entries.py +318 -0
  26. dodopayments/resources/customers/wallets/wallets.py +191 -0
  27. dodopayments/resources/discounts.py +44 -44
  28. dodopayments/resources/disputes.py +19 -19
  29. dodopayments/resources/invoices/payments.py +83 -3
  30. dodopayments/resources/license_key_instances.py +13 -13
  31. dodopayments/resources/license_keys.py +23 -23
  32. dodopayments/resources/licenses.py +14 -14
  33. dodopayments/resources/meters.py +554 -0
  34. dodopayments/resources/misc.py +3 -3
  35. dodopayments/resources/payments.py +49 -41
  36. dodopayments/resources/payouts.py +26 -7
  37. dodopayments/resources/products/images.py +5 -5
  38. dodopayments/resources/products/products.py +82 -82
  39. dodopayments/resources/refunds.py +39 -30
  40. dodopayments/resources/subscriptions.py +316 -73
  41. dodopayments/resources/usage_events.py +597 -0
  42. dodopayments/resources/webhooks/headers.py +5 -5
  43. dodopayments/resources/webhooks/webhooks.py +119 -44
  44. dodopayments/types/__init__.py +48 -0
  45. dodopayments/types/add_meter_to_price.py +29 -0
  46. dodopayments/types/add_meter_to_price_param.py +30 -0
  47. dodopayments/types/checkout_session_create_params.py +6 -0
  48. dodopayments/types/checkout_session_status.py +35 -0
  49. dodopayments/types/customer_limited_details.py +5 -0
  50. dodopayments/types/customers/__init__.py +2 -0
  51. dodopayments/types/customers/customer_wallet.py +20 -0
  52. dodopayments/types/customers/wallet_list_response.py +15 -0
  53. dodopayments/types/customers/wallets/__init__.py +7 -0
  54. dodopayments/types/customers/wallets/customer_wallet_transaction.py +38 -0
  55. dodopayments/types/customers/wallets/ledger_entry_create_params.py +25 -0
  56. dodopayments/types/customers/wallets/ledger_entry_list_params.py +18 -0
  57. dodopayments/types/discount_create_params.py +3 -2
  58. dodopayments/types/discount_update_params.py +3 -2
  59. dodopayments/types/dispute_accepted_webhook_event.py +29 -0
  60. dodopayments/types/dispute_accepted_webhook_event1.py +29 -0
  61. dodopayments/types/dispute_cancelled_webhook_event.py +29 -0
  62. dodopayments/types/dispute_cancelled_webhook_event1.py +29 -0
  63. dodopayments/types/dispute_challenged_webhook_event.py +29 -0
  64. dodopayments/types/dispute_challenged_webhook_event1.py +29 -0
  65. dodopayments/types/dispute_expired_webhook_event.py +29 -0
  66. dodopayments/types/dispute_expired_webhook_event1.py +29 -0
  67. dodopayments/types/dispute_lost_webhook_event.py +29 -0
  68. dodopayments/types/dispute_lost_webhook_event1.py +29 -0
  69. dodopayments/types/dispute_opened_webhook_event.py +29 -0
  70. dodopayments/types/dispute_opened_webhook_event1.py +29 -0
  71. dodopayments/types/dispute_won_webhook_event.py +29 -0
  72. dodopayments/types/dispute_won_webhook_event1.py +29 -0
  73. dodopayments/types/event.py +26 -0
  74. dodopayments/types/event_input_param.py +38 -0
  75. dodopayments/types/license_activate_response.py +40 -0
  76. dodopayments/types/license_key_created_webhook_event.py +29 -0
  77. dodopayments/types/license_key_created_webhook_event1.py +29 -0
  78. dodopayments/types/meter.py +40 -0
  79. dodopayments/types/meter_aggregation.py +16 -0
  80. dodopayments/types/meter_aggregation_param.py +16 -0
  81. dodopayments/types/meter_create_params.py +31 -0
  82. dodopayments/types/meter_filter.py +131 -0
  83. dodopayments/types/meter_filter_param.py +143 -0
  84. dodopayments/types/meter_list_params.py +18 -0
  85. dodopayments/types/new_customer_param.py +7 -1
  86. dodopayments/types/payment.py +37 -2
  87. dodopayments/types/payment_cancelled_webhook_event.py +29 -0
  88. dodopayments/types/payment_cancelled_webhook_event1.py +29 -0
  89. dodopayments/types/payment_create_params.py +3 -0
  90. dodopayments/types/payment_failed_webhook_event.py +29 -0
  91. dodopayments/types/payment_failed_webhook_event1.py +29 -0
  92. dodopayments/types/payment_method_types.py +1 -0
  93. dodopayments/types/payment_processing_webhook_event.py +29 -0
  94. dodopayments/types/payment_processing_webhook_event1.py +29 -0
  95. dodopayments/types/payment_succeeded_webhook_event.py +29 -0
  96. dodopayments/types/payment_succeeded_webhook_event1.py +29 -0
  97. dodopayments/types/payout_list_params.py +11 -1
  98. dodopayments/types/price.py +52 -5
  99. dodopayments/types/price_param.py +52 -5
  100. dodopayments/types/product_create_params.py +3 -2
  101. dodopayments/types/product_update_params.py +4 -3
  102. dodopayments/types/refund.py +8 -1
  103. dodopayments/types/refund_create_params.py +4 -1
  104. dodopayments/types/refund_failed_webhook_event.py +29 -0
  105. dodopayments/types/refund_failed_webhook_event1.py +29 -0
  106. dodopayments/types/refund_list_response.py +39 -0
  107. dodopayments/types/refund_succeeded_webhook_event.py +29 -0
  108. dodopayments/types/refund_succeeded_webhook_event1.py +29 -0
  109. dodopayments/types/subscription.py +23 -1
  110. dodopayments/types/subscription_active_webhook_event.py +29 -0
  111. dodopayments/types/subscription_active_webhook_event1.py +29 -0
  112. dodopayments/types/subscription_cancelled_webhook_event.py +29 -0
  113. dodopayments/types/subscription_cancelled_webhook_event1.py +29 -0
  114. dodopayments/types/subscription_charge_params.py +12 -1
  115. dodopayments/types/subscription_create_params.py +3 -0
  116. dodopayments/types/subscription_expired_webhook_event.py +29 -0
  117. dodopayments/types/subscription_expired_webhook_event1.py +29 -0
  118. dodopayments/types/subscription_failed_webhook_event.py +29 -0
  119. dodopayments/types/subscription_failed_webhook_event1.py +29 -0
  120. dodopayments/types/subscription_list_response.py +3 -0
  121. dodopayments/types/subscription_on_hold_webhook_event.py +29 -0
  122. dodopayments/types/subscription_on_hold_webhook_event1.py +29 -0
  123. dodopayments/types/subscription_plan_changed_webhook_event.py +29 -0
  124. dodopayments/types/subscription_plan_changed_webhook_event1.py +29 -0
  125. dodopayments/types/subscription_renewed_webhook_event.py +29 -0
  126. dodopayments/types/subscription_renewed_webhook_event1.py +29 -0
  127. dodopayments/types/subscription_retrieve_usage_history_params.py +28 -0
  128. dodopayments/types/subscription_retrieve_usage_history_response.py +46 -0
  129. dodopayments/types/subscription_update_params.py +2 -0
  130. dodopayments/types/unsafe_unwrap_webhook_event.py +52 -0
  131. dodopayments/types/unwrap_webhook_event.py +52 -0
  132. dodopayments/types/usage_event_ingest_params.py +15 -0
  133. dodopayments/types/usage_event_ingest_response.py +9 -0
  134. dodopayments/types/usage_event_list_params.py +42 -0
  135. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/METADATA +6 -4
  136. dodopayments-1.56.5.dist-info/RECORD +239 -0
  137. dodopayments-1.51.1.dist-info/RECORD +0 -163
  138. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/WHEEL +0 -0
  139. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/licenses/LICENSE +0 -0
@@ -7,7 +7,7 @@ from typing_extensions import Required, TypedDict
7
7
 
8
8
  from .currency import Currency
9
9
 
10
- __all__ = ["SubscriptionChargeParams"]
10
+ __all__ = ["SubscriptionChargeParams", "CustomerBalanceConfig"]
11
11
 
12
12
 
13
13
  class SubscriptionChargeParams(TypedDict, total=False):
@@ -25,6 +25,9 @@ class SubscriptionChargeParams(TypedDict, total=False):
25
25
  for the business.
26
26
  """
27
27
 
28
+ customer_balance_config: Optional[CustomerBalanceConfig]
29
+ """Specify how customer balance is used for the payment"""
30
+
28
31
  metadata: Optional[Dict[str, str]]
29
32
  """Metadata for the payment.
30
33
 
@@ -42,3 +45,11 @@ class SubscriptionChargeParams(TypedDict, total=False):
42
45
  Optional product description override for billing and line items. If not
43
46
  specified, the stored description of the product will be used.
44
47
  """
48
+
49
+
50
+ class CustomerBalanceConfig(TypedDict, total=False):
51
+ allow_customer_credits_purchase: Optional[bool]
52
+ """Allows Customer Credit to be purchased to settle payments"""
53
+
54
+ allow_customer_credits_usage: Optional[bool]
55
+ """Allows Customer Credit Balance to be used to settle payments"""
@@ -49,6 +49,9 @@ class SubscriptionCreateParams(TypedDict, total=False):
49
49
  discount_code: Optional[str]
50
50
  """Discount Code to apply to the subscription"""
51
51
 
52
+ force_3ds: Optional[bool]
53
+ """Override merchant default 3DS behaviour for this subscription"""
54
+
52
55
  metadata: Dict[str, str]
53
56
  """Additional metadata for the subscription Defaults to empty if not specified"""
54
57
 
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionExpiredWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionExpiredWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.expired"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionExpiredWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionExpiredWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.expired"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionFailedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionFailedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.failed"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionFailedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionFailedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.failed"]
29
+ """The event type"""
@@ -88,3 +88,6 @@ class SubscriptionListResponse(BaseModel):
88
88
 
89
89
  discount_id: Optional[str] = None
90
90
  """The discount id if discount is applied"""
91
+
92
+ tax_id: Optional[str] = None
93
+ """Tax identifier provided for this subscription (if applicable)"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionOnHoldWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionOnHoldWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.on_hold"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionOnHoldWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionOnHoldWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.on_hold"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionPlanChangedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionPlanChangedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.plan_changed"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionPlanChangedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionPlanChangedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.plan_changed"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionRenewedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionRenewedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.renewed"]
29
+ """The event type"""
@@ -0,0 +1,29 @@
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 .subscription import Subscription
9
+
10
+ __all__ = ["SubscriptionRenewedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(Subscription):
14
+ payload_type: Optional[Literal["Subscription"]] = None
15
+ """The type of payload in the data field"""
16
+
17
+
18
+ class SubscriptionRenewedWebhookEvent(BaseModel):
19
+ business_id: str
20
+ """The business identifier"""
21
+
22
+ data: Data
23
+ """Event-specific data"""
24
+
25
+ timestamp: datetime
26
+ """The timestamp of when the event occurred"""
27
+
28
+ type: Literal["subscription.renewed"]
29
+ """The event type"""
@@ -0,0 +1,28 @@
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, Optional
6
+ from datetime import datetime
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["SubscriptionRetrieveUsageHistoryParams"]
12
+
13
+
14
+ class SubscriptionRetrieveUsageHistoryParams(TypedDict, total=False):
15
+ end_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
16
+ """Filter by end date (inclusive)"""
17
+
18
+ meter_id: Optional[str]
19
+ """Filter by specific meter ID"""
20
+
21
+ page_number: Optional[int]
22
+ """Page number (default: 0)"""
23
+
24
+ page_size: Optional[int]
25
+ """Page size (default: 10, max: 100)"""
26
+
27
+ start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
28
+ """Filter by start date (inclusive)"""
@@ -0,0 +1,46 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+ from .currency import Currency
8
+
9
+ __all__ = ["SubscriptionRetrieveUsageHistoryResponse", "Meter"]
10
+
11
+
12
+ class Meter(BaseModel):
13
+ id: str
14
+ """Meter identifier"""
15
+
16
+ chargeable_units: str
17
+ """Chargeable units (after free threshold) as string for precision"""
18
+
19
+ consumed_units: str
20
+ """Total units consumed as string for precision"""
21
+
22
+ currency: Currency
23
+ """Currency for the price per unit"""
24
+
25
+ free_threshold: int
26
+ """Free threshold units for this meter"""
27
+
28
+ name: str
29
+ """Meter name"""
30
+
31
+ price_per_unit: str
32
+ """Price per unit in string format for precision"""
33
+
34
+ total_price: int
35
+ """Total price charged for this meter in smallest currency unit (cents)"""
36
+
37
+
38
+ class SubscriptionRetrieveUsageHistoryResponse(BaseModel):
39
+ end_date: datetime
40
+ """End date of the billing period"""
41
+
42
+ meters: List[Meter]
43
+ """List of meters and their usage for this billing period"""
44
+
45
+ start_date: datetime
46
+ """Start date of the billing period"""
@@ -19,6 +19,8 @@ class SubscriptionUpdateParams(TypedDict, total=False):
19
19
  cancel_at_next_billing_date: Optional[bool]
20
20
  """When set, the subscription will remain active until the end of billing period"""
21
21
 
22
+ customer_name: Optional[str]
23
+
22
24
  disable_on_demand: Optional[DisableOnDemand]
23
25
 
24
26
  metadata: Optional[Dict[str, str]]
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Union
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .dispute_won_webhook_event import DisputeWonWebhookEvent
7
+ from .dispute_lost_webhook_event import DisputeLostWebhookEvent
8
+ from .refund_failed_webhook_event import RefundFailedWebhookEvent
9
+ from .dispute_opened_webhook_event import DisputeOpenedWebhookEvent
10
+ from .payment_failed_webhook_event import PaymentFailedWebhookEvent
11
+ from .dispute_expired_webhook_event import DisputeExpiredWebhookEvent
12
+ from .dispute_accepted_webhook_event import DisputeAcceptedWebhookEvent
13
+ from .refund_succeeded_webhook_event import RefundSucceededWebhookEvent
14
+ from .dispute_cancelled_webhook_event import DisputeCancelledWebhookEvent
15
+ from .payment_cancelled_webhook_event import PaymentCancelledWebhookEvent
16
+ from .payment_succeeded_webhook_event import PaymentSucceededWebhookEvent
17
+ from .dispute_challenged_webhook_event import DisputeChallengedWebhookEvent
18
+ from .payment_processing_webhook_event import PaymentProcessingWebhookEvent
19
+ from .license_key_created_webhook_event import LicenseKeyCreatedWebhookEvent
20
+ from .subscription_active_webhook_event import SubscriptionActiveWebhookEvent
21
+ from .subscription_failed_webhook_event import SubscriptionFailedWebhookEvent
22
+ from .subscription_expired_webhook_event import SubscriptionExpiredWebhookEvent
23
+ from .subscription_on_hold_webhook_event import SubscriptionOnHoldWebhookEvent
24
+ from .subscription_renewed_webhook_event import SubscriptionRenewedWebhookEvent
25
+ from .subscription_cancelled_webhook_event import SubscriptionCancelledWebhookEvent
26
+ from .subscription_plan_changed_webhook_event import SubscriptionPlanChangedWebhookEvent
27
+
28
+ __all__ = ["UnsafeUnwrapWebhookEvent"]
29
+
30
+ UnsafeUnwrapWebhookEvent: TypeAlias = Union[
31
+ DisputeAcceptedWebhookEvent,
32
+ DisputeCancelledWebhookEvent,
33
+ DisputeChallengedWebhookEvent,
34
+ DisputeExpiredWebhookEvent,
35
+ DisputeLostWebhookEvent,
36
+ DisputeOpenedWebhookEvent,
37
+ DisputeWonWebhookEvent,
38
+ LicenseKeyCreatedWebhookEvent,
39
+ PaymentCancelledWebhookEvent,
40
+ PaymentFailedWebhookEvent,
41
+ PaymentProcessingWebhookEvent,
42
+ PaymentSucceededWebhookEvent,
43
+ RefundFailedWebhookEvent,
44
+ RefundSucceededWebhookEvent,
45
+ SubscriptionActiveWebhookEvent,
46
+ SubscriptionCancelledWebhookEvent,
47
+ SubscriptionExpiredWebhookEvent,
48
+ SubscriptionFailedWebhookEvent,
49
+ SubscriptionOnHoldWebhookEvent,
50
+ SubscriptionPlanChangedWebhookEvent,
51
+ SubscriptionRenewedWebhookEvent,
52
+ ]
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Union
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .dispute_won_webhook_event import DisputeWonWebhookEvent
7
+ from .dispute_lost_webhook_event import DisputeLostWebhookEvent
8
+ from .refund_failed_webhook_event import RefundFailedWebhookEvent
9
+ from .dispute_opened_webhook_event import DisputeOpenedWebhookEvent
10
+ from .payment_failed_webhook_event import PaymentFailedWebhookEvent
11
+ from .dispute_expired_webhook_event import DisputeExpiredWebhookEvent
12
+ from .dispute_accepted_webhook_event import DisputeAcceptedWebhookEvent
13
+ from .refund_succeeded_webhook_event import RefundSucceededWebhookEvent
14
+ from .dispute_cancelled_webhook_event import DisputeCancelledWebhookEvent
15
+ from .payment_cancelled_webhook_event import PaymentCancelledWebhookEvent
16
+ from .payment_succeeded_webhook_event import PaymentSucceededWebhookEvent
17
+ from .dispute_challenged_webhook_event import DisputeChallengedWebhookEvent
18
+ from .payment_processing_webhook_event import PaymentProcessingWebhookEvent
19
+ from .license_key_created_webhook_event import LicenseKeyCreatedWebhookEvent
20
+ from .subscription_active_webhook_event import SubscriptionActiveWebhookEvent
21
+ from .subscription_failed_webhook_event import SubscriptionFailedWebhookEvent
22
+ from .subscription_expired_webhook_event import SubscriptionExpiredWebhookEvent
23
+ from .subscription_on_hold_webhook_event import SubscriptionOnHoldWebhookEvent
24
+ from .subscription_renewed_webhook_event import SubscriptionRenewedWebhookEvent
25
+ from .subscription_cancelled_webhook_event import SubscriptionCancelledWebhookEvent
26
+ from .subscription_plan_changed_webhook_event import SubscriptionPlanChangedWebhookEvent
27
+
28
+ __all__ = ["UnwrapWebhookEvent"]
29
+
30
+ UnwrapWebhookEvent: TypeAlias = Union[
31
+ DisputeAcceptedWebhookEvent,
32
+ DisputeCancelledWebhookEvent,
33
+ DisputeChallengedWebhookEvent,
34
+ DisputeExpiredWebhookEvent,
35
+ DisputeLostWebhookEvent,
36
+ DisputeOpenedWebhookEvent,
37
+ DisputeWonWebhookEvent,
38
+ LicenseKeyCreatedWebhookEvent,
39
+ PaymentCancelledWebhookEvent,
40
+ PaymentFailedWebhookEvent,
41
+ PaymentProcessingWebhookEvent,
42
+ PaymentSucceededWebhookEvent,
43
+ RefundFailedWebhookEvent,
44
+ RefundSucceededWebhookEvent,
45
+ SubscriptionActiveWebhookEvent,
46
+ SubscriptionCancelledWebhookEvent,
47
+ SubscriptionExpiredWebhookEvent,
48
+ SubscriptionFailedWebhookEvent,
49
+ SubscriptionOnHoldWebhookEvent,
50
+ SubscriptionPlanChangedWebhookEvent,
51
+ SubscriptionRenewedWebhookEvent,
52
+ ]
@@ -0,0 +1,15 @@
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 Iterable
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ from .event_input_param import EventInputParam
9
+
10
+ __all__ = ["UsageEventIngestParams"]
11
+
12
+
13
+ class UsageEventIngestParams(TypedDict, total=False):
14
+ events: Required[Iterable[EventInputParam]]
15
+ """List of events to be pushed"""
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["UsageEventIngestResponse"]
6
+
7
+
8
+ class UsageEventIngestResponse(BaseModel):
9
+ ingested_count: int
@@ -0,0 +1,42 @@
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 Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["UsageEventListParams"]
12
+
13
+
14
+ class UsageEventListParams(TypedDict, total=False):
15
+ customer_id: str
16
+ """Filter events by customer ID"""
17
+
18
+ end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
19
+ """Filter events created before this timestamp"""
20
+
21
+ event_name: str
22
+ """Filter events by event name.
23
+
24
+ If both event_name and meter_id are provided, they must match the meter's
25
+ configured event_name
26
+ """
27
+
28
+ meter_id: str
29
+ """Filter events by meter ID.
30
+
31
+ When provided, only events that match the meter's event_name and filter criteria
32
+ will be returned
33
+ """
34
+
35
+ page_number: int
36
+ """Page number (0-based, default: 0)"""
37
+
38
+ page_size: int
39
+ """Number of events to return per page (default: 10)"""
40
+
41
+ start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
42
+ """Filter events created after this timestamp"""
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dodopayments
3
- Version: 1.51.1
3
+ Version: 1.56.5
4
4
  Summary: The official Python library for the Dodo Payments API
5
5
  Project-URL: Homepage, https://github.com/dodopayments/dodopayments-python
6
6
  Project-URL: Repository, https://github.com/dodopayments/dodopayments-python
7
- Author-email: Dodo Payments <founders@dodopayments.com>
7
+ Author-email: Dodo Payments <support@dodopayments.com>
8
8
  License: Apache-2.0
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: Apache Software License
@@ -30,7 +30,9 @@ Requires-Dist: sniffio
30
30
  Requires-Dist: typing-extensions<5,>=4.10
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
- Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
34
+ Provides-Extra: webhooks
35
+ Requires-Dist: standardwebhooks; extra == 'webhooks'
34
36
  Description-Content-Type: text/markdown
35
37
 
36
38
  # Dodo Payments Python API library
@@ -46,7 +48,7 @@ It is generated with [Stainless](https://www.stainless.com/).
46
48
 
47
49
  ## Documentation
48
50
 
49
- The REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com). The full API of this library can be found in [api.md](https://github.com/dodopayments/dodopayments-python/tree/main/api.md).
51
+ The REST API documentation can be found on [docs.dodopayments.com](https://docs.dodopayments.com/api-reference/introduction). The full API of this library can be found in [api.md](https://github.com/dodopayments/dodopayments-python/tree/main/api.md).
50
52
 
51
53
  ## Installation
52
54