dodopayments 2.10.0 → 2.11.0

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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +9 -9
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
  6. data/lib/dodopayments/models/checkout_session_request.rb +11 -1
  7. data/lib/dodopayments/models/checkout_session_response.rb +33 -1
  8. data/lib/dodopayments/models/discount_detail.rb +143 -0
  9. data/lib/dodopayments/models/filter_type.rb +71 -0
  10. data/lib/dodopayments/models/github_permission.rb +19 -0
  11. data/lib/dodopayments/models/integration_config.rb +3 -19
  12. data/lib/dodopayments/models/integration_config_response.rb +3 -19
  13. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
  14. data/lib/dodopayments/models/meter_filter.rb +3 -331
  15. data/lib/dodopayments/models/payment.rb +3 -141
  16. data/lib/dodopayments/models/payment_create_params.rb +11 -1
  17. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  18. data/lib/dodopayments/models/product_collection.rb +74 -0
  19. data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
  20. data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
  21. data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
  22. data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
  23. data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
  24. data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
  25. data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
  26. data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
  27. data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
  28. data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
  29. data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
  30. data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
  31. data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
  32. data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
  33. data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
  34. data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
  35. data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
  36. data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
  37. data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
  38. data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
  39. data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
  40. data/lib/dodopayments/models/subscription.rb +13 -142
  41. data/lib/dodopayments/models/subscription_create_params.rb +11 -1
  42. data/lib/dodopayments/models/subscription_list_response.rb +10 -1
  43. data/lib/dodopayments/models/subscription_update_params.rb +12 -1
  44. data/lib/dodopayments/models/subscription_update_payment_method_params.rb +9 -9
  45. data/lib/dodopayments/models/webhook_event_type.rb +1 -5
  46. data/lib/dodopayments/models.rb +24 -0
  47. data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
  48. data/lib/dodopayments/resources/invoices/payments.rb +18 -0
  49. data/lib/dodopayments/resources/payments.rb +3 -1
  50. data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
  51. data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
  52. data/lib/dodopayments/resources/product_collections.rb +179 -0
  53. data/lib/dodopayments/resources/subscriptions.rb +9 -5
  54. data/lib/dodopayments/version.rb +1 -1
  55. data/lib/dodopayments.rb +29 -0
  56. data/rbi/dodopayments/client.rbi +3 -0
  57. data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
  58. data/rbi/dodopayments/models/checkout_session_request.rbi +12 -0
  59. data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
  60. data/rbi/dodopayments/models/discount_detail.rbi +161 -0
  61. data/rbi/dodopayments/models/filter_type.rbi +112 -0
  62. data/rbi/dodopayments/models/github_permission.rbi +26 -0
  63. data/rbi/dodopayments/models/integration_config.rbi +3 -59
  64. data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
  65. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
  66. data/rbi/dodopayments/models/meter_filter.rbi +3 -572
  67. data/rbi/dodopayments/models/payment.rbi +3 -163
  68. data/rbi/dodopayments/models/payment_create_params.rbi +12 -0
  69. data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
  70. data/rbi/dodopayments/models/product_collection.rbi +108 -0
  71. data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
  72. data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
  73. data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
  74. data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
  75. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
  76. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
  77. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
  78. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
  79. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
  80. data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
  81. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
  82. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
  83. data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
  84. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
  85. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
  86. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
  87. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
  88. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
  89. data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
  90. data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
  91. data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
  92. data/rbi/dodopayments/models/subscription.rbi +13 -164
  93. data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
  94. data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
  95. data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
  96. data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +16 -16
  97. data/rbi/dodopayments/models/webhook_event_type.rbi +4 -18
  98. data/rbi/dodopayments/models.rbi +31 -0
  99. data/rbi/dodopayments/resources/checkout_sessions.rbi +10 -0
  100. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  101. data/rbi/dodopayments/resources/payments.rbi +5 -0
  102. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
  103. data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
  104. data/rbi/dodopayments/resources/product_collections.rbi +149 -0
  105. data/rbi/dodopayments/resources/subscriptions.rbi +15 -4
  106. data/sig/dodopayments/client.rbs +2 -0
  107. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  108. data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
  109. data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
  110. data/sig/dodopayments/models/discount_detail.rbs +95 -0
  111. data/sig/dodopayments/models/filter_type.rbs +52 -0
  112. data/sig/dodopayments/models/github_permission.rbs +17 -0
  113. data/sig/dodopayments/models/integration_config.rbs +4 -18
  114. data/sig/dodopayments/models/integration_config_response.rbs +4 -18
  115. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
  116. data/sig/dodopayments/models/meter_filter.rbs +4 -252
  117. data/sig/dodopayments/models/payment.rbs +4 -96
  118. data/sig/dodopayments/models/payment_create_params.rbs +5 -0
  119. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  120. data/sig/dodopayments/models/product_collection.rbs +55 -0
  121. data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
  122. data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
  123. data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
  124. data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
  125. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
  126. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
  127. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
  128. data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
  129. data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
  130. data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
  131. data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
  132. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
  133. data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
  134. data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
  135. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
  136. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
  137. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
  138. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
  139. data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
  140. data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
  141. data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
  142. data/sig/dodopayments/models/subscription.rbs +9 -96
  143. data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
  144. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  145. data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
  146. data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +9 -9
  147. data/sig/dodopayments/models/webhook_event_type.rbs +2 -10
  148. data/sig/dodopayments/models.rbs +24 -0
  149. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
  150. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  151. data/sig/dodopayments/resources/payments.rbs +1 -0
  152. data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
  153. data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
  154. data/sig/dodopayments/resources/product_collections.rbs +56 -0
  155. data/sig/dodopayments/resources/subscriptions.rbs +3 -1
  156. metadata +89 -2
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ module Groups
7
+ class ProductCollectionProduct < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute addons_count
14
+ #
15
+ # @return [Integer]
16
+ required :addons_count, Integer
17
+
18
+ # @!attribute files_count
19
+ #
20
+ # @return [Integer]
21
+ required :files_count, Integer
22
+
23
+ # @!attribute has_credit_entitlements
24
+ # Whether this product has any credit entitlements attached
25
+ #
26
+ # @return [Boolean]
27
+ required :has_credit_entitlements, Dodopayments::Internal::Type::Boolean
28
+
29
+ # @!attribute is_recurring
30
+ #
31
+ # @return [Boolean]
32
+ required :is_recurring, Dodopayments::Internal::Type::Boolean
33
+
34
+ # @!attribute license_key_enabled
35
+ #
36
+ # @return [Boolean]
37
+ required :license_key_enabled, Dodopayments::Internal::Type::Boolean
38
+
39
+ # @!attribute meters_count
40
+ #
41
+ # @return [Integer]
42
+ required :meters_count, Integer
43
+
44
+ # @!attribute product_id
45
+ #
46
+ # @return [String]
47
+ required :product_id, String
48
+
49
+ # @!attribute status
50
+ #
51
+ # @return [Boolean]
52
+ required :status, Dodopayments::Internal::Type::Boolean
53
+
54
+ # @!attribute currency
55
+ #
56
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
57
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
58
+
59
+ # @!attribute description
60
+ #
61
+ # @return [String, nil]
62
+ optional :description, String, nil?: true
63
+
64
+ # @!attribute name
65
+ #
66
+ # @return [String, nil]
67
+ optional :name, String, nil?: true
68
+
69
+ # @!attribute price
70
+ #
71
+ # @return [Integer, nil]
72
+ optional :price, Integer, nil?: true
73
+
74
+ # @!attribute price_detail
75
+ # One-time price details.
76
+ #
77
+ # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil]
78
+ optional :price_detail, union: -> { Dodopayments::Price }, nil?: true
79
+
80
+ # @!attribute tax_category
81
+ # Represents the different categories of taxation applicable to various products
82
+ # and services.
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::TaxCategory, nil]
85
+ optional :tax_category, enum: -> { Dodopayments::TaxCategory }, nil?: true
86
+
87
+ # @!attribute tax_inclusive
88
+ #
89
+ # @return [Boolean, nil]
90
+ optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
91
+
92
+ # @!method initialize(id:, addons_count:, files_count:, has_credit_entitlements:, is_recurring:, license_key_enabled:, meters_count:, product_id:, status:, currency: nil, description: nil, name: nil, price: nil, price_detail: nil, tax_category: nil, tax_inclusive: nil)
93
+ # Some parameter documentations has been truncated, see
94
+ # {Dodopayments::Models::ProductCollections::Groups::ProductCollectionProduct} for
95
+ # more details.
96
+ #
97
+ # @param id [String]
98
+ #
99
+ # @param addons_count [Integer]
100
+ #
101
+ # @param files_count [Integer]
102
+ #
103
+ # @param has_credit_entitlements [Boolean] Whether this product has any credit entitlements attached
104
+ #
105
+ # @param is_recurring [Boolean]
106
+ #
107
+ # @param license_key_enabled [Boolean]
108
+ #
109
+ # @param meters_count [Integer]
110
+ #
111
+ # @param product_id [String]
112
+ #
113
+ # @param status [Boolean]
114
+ #
115
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil]
116
+ #
117
+ # @param description [String, nil]
118
+ #
119
+ # @param name [String, nil]
120
+ #
121
+ # @param price [Integer, nil]
122
+ #
123
+ # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] One-time price details.
124
+ #
125
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
126
+ #
127
+ # @param tax_inclusive [Boolean, nil]
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ class ProductCollectionGroupDetails < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute products
8
+ # Products in this group
9
+ #
10
+ # @return [Array<Dodopayments::Models::ProductCollections::GroupProduct>]
11
+ required :products,
12
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::GroupProduct] }
13
+
14
+ # @!attribute group_name
15
+ # Optional group name. Multiple groups can have null names, but named groups must
16
+ # be unique per collection
17
+ #
18
+ # @return [String, nil]
19
+ optional :group_name, String, nil?: true
20
+
21
+ # @!attribute status
22
+ # Status of the group (defaults to true if not provided)
23
+ #
24
+ # @return [Boolean, nil]
25
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
26
+
27
+ # @!method initialize(products:, group_name: nil, status: nil)
28
+ # Some parameter documentations has been truncated, see
29
+ # {Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails} for
30
+ # more details.
31
+ #
32
+ # @param products [Array<Dodopayments::Models::ProductCollections::GroupProduct>] Products in this group
33
+ #
34
+ # @param group_name [String, nil] Optional group name. Multiple groups can have null names, but named groups must
35
+ #
36
+ # @param status [Boolean, nil] Status of the group (defaults to true if not provided)
37
+ end
38
+ end
39
+
40
+ ProductCollectionGroupDetails = ProductCollections::ProductCollectionGroupDetails
41
+ end
42
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#create
7
+ class ProductCollectionGroupResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute group_id
9
+ #
10
+ # @return [String]
11
+ required :group_id, String
12
+
13
+ # @!attribute products
14
+ #
15
+ # @return [Array<Dodopayments::Models::ProductCollections::Groups::ProductCollectionProduct>]
16
+ required :products,
17
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::Groups::ProductCollectionProduct] }
18
+
19
+ # @!attribute status
20
+ #
21
+ # @return [Boolean]
22
+ required :status, Dodopayments::Internal::Type::Boolean
23
+
24
+ # @!attribute group_name
25
+ #
26
+ # @return [String, nil]
27
+ optional :group_name, String, nil?: true
28
+
29
+ # @!method initialize(group_id:, products:, status:, group_name: nil)
30
+ # @param group_id [String]
31
+ # @param products [Array<Dodopayments::Models::ProductCollections::Groups::ProductCollectionProduct>]
32
+ # @param status [Boolean]
33
+ # @param group_name [String, nil]
34
+ end
35
+ end
36
+
37
+ ProductCollectionGroupResponse = ProductCollections::ProductCollectionGroupResponse
38
+ end
39
+ end
@@ -178,6 +178,13 @@ module Dodopayments
178
178
  -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CustomFieldResponse] },
179
179
  nil?: true
180
180
 
181
+ # @!attribute customer_business_name
182
+ # Business / legal name associated with the tax id (B2B). When set this is used on
183
+ # the invoice in place of the customer's personal name.
184
+ #
185
+ # @return [String, nil]
186
+ optional :customer_business_name, String, nil?: true
187
+
181
188
  # @!attribute discount_cycles_remaining
182
189
  # DEPRECATED: Use discounts[].cycles_remaining instead.
183
190
  #
@@ -193,9 +200,9 @@ module Dodopayments
193
200
  # @!attribute discounts
194
201
  # All stacked discounts applied, ordered by position
195
202
  #
196
- # @return [Array<Dodopayments::Models::Subscription::Discount>, nil]
203
+ # @return [Array<Dodopayments::Models::DiscountDetail>, nil]
197
204
  optional :discounts,
198
- -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Subscription::Discount] },
205
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::DiscountDetail] },
199
206
  nil?: true
200
207
 
201
208
  # @!attribute expires_at
@@ -222,7 +229,7 @@ module Dodopayments
222
229
  # @return [String, nil]
223
230
  optional :tax_id, String, nil?: true
224
231
 
225
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
232
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
226
233
  # Some parameter documentations has been truncated, see
227
234
  # {Dodopayments::Models::Subscription} for more details.
228
235
  #
@@ -284,11 +291,13 @@ module Dodopayments
284
291
  #
285
292
  # @param custom_field_responses [Array<Dodopayments::Models::CustomFieldResponse>, nil] Customer's responses to custom fields collected during checkout
286
293
  #
294
+ # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
295
+ #
287
296
  # @param discount_cycles_remaining [Integer, nil] DEPRECATED: Use discounts[].cycles_remaining instead.
288
297
  #
289
298
  # @param discount_id [String, nil] DEPRECATED: Use discounts instead. Returns the first discount's ID if present.
290
299
  #
291
- # @param discounts [Array<Dodopayments::Models::Subscription::Discount>, nil] All stacked discounts applied, ordered by position
300
+ # @param discounts [Array<Dodopayments::Models::DiscountDetail>, nil] All stacked discounts applied, ordered by position
292
301
  #
293
302
  # @param expires_at [Time, nil] Timestamp when the subscription will expire
294
303
  #
@@ -297,144 +306,6 @@ module Dodopayments
297
306
  # @param scheduled_change [Dodopayments::Models::ScheduledPlanChange, nil] Scheduled plan change details, if any
298
307
  #
299
308
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
300
-
301
- class Discount < Dodopayments::Internal::Type::BaseModel
302
- # @!attribute amount
303
- # The discount amount (basis points for percentage, USD cents for flat)
304
- #
305
- # @return [Integer]
306
- required :amount, Integer
307
-
308
- # @!attribute business_id
309
- # The business this discount belongs to
310
- #
311
- # @return [String]
312
- required :business_id, String
313
-
314
- # @!attribute code
315
- # The discount code
316
- #
317
- # @return [String]
318
- required :code, String
319
-
320
- # @!attribute created_at
321
- # Timestamp when the discount was created
322
- #
323
- # @return [Time]
324
- required :created_at, Time
325
-
326
- # @!attribute discount_id
327
- # The unique discount ID
328
- #
329
- # @return [String]
330
- required :discount_id, String
331
-
332
- # @!attribute metadata
333
- # Additional metadata
334
- #
335
- # @return [Hash{Symbol=>String}]
336
- required :metadata, Dodopayments::Internal::Type::HashOf[String]
337
-
338
- # @!attribute position
339
- # Position of this discount in the stack (0-based)
340
- #
341
- # @return [Integer]
342
- required :position, Integer
343
-
344
- # @!attribute preserve_on_plan_change
345
- # Whether this discount should be preserved when a subscription changes plans
346
- #
347
- # @return [Boolean]
348
- required :preserve_on_plan_change, Dodopayments::Internal::Type::Boolean
349
-
350
- # @!attribute restricted_to
351
- # List of product IDs to which this discount is restricted
352
- #
353
- # @return [Array<String>]
354
- required :restricted_to, Dodopayments::Internal::Type::ArrayOf[String]
355
-
356
- # @!attribute times_used
357
- # How many times this discount has been used
358
- #
359
- # @return [Integer]
360
- required :times_used, Integer
361
-
362
- # @!attribute type
363
- # The type of discount
364
- #
365
- # @return [Symbol, Dodopayments::Models::DiscountType]
366
- required :type, enum: -> { Dodopayments::DiscountType }
367
-
368
- # @!attribute cycles_remaining
369
- # Remaining billing cycles for this discount on this subscription (None for
370
- # one-time payments)
371
- #
372
- # @return [Integer, nil]
373
- optional :cycles_remaining, Integer, nil?: true
374
-
375
- # @!attribute expires_at
376
- # Optional date/time after which discount is expired
377
- #
378
- # @return [Time, nil]
379
- optional :expires_at, Time, nil?: true
380
-
381
- # @!attribute name
382
- # Name for the Discount
383
- #
384
- # @return [String, nil]
385
- optional :name, String, nil?: true
386
-
387
- # @!attribute subscription_cycles
388
- # Number of subscription billing cycles this discount is valid for
389
- #
390
- # @return [Integer, nil]
391
- optional :subscription_cycles, Integer, nil?: true
392
-
393
- # @!attribute usage_limit
394
- # Usage limit for this discount, if any
395
- #
396
- # @return [Integer, nil]
397
- optional :usage_limit, Integer, nil?: true
398
-
399
- # @!method initialize(amount:, business_id:, code:, created_at:, discount_id:, metadata:, position:, preserve_on_plan_change:, restricted_to:, times_used:, type:, cycles_remaining: nil, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil)
400
- # Some parameter documentations has been truncated, see
401
- # {Dodopayments::Models::Subscription::Discount} for more details.
402
- #
403
- # Response struct for a discount with its position in a stack and optional
404
- # cycle-tracking information (for subscriptions).
405
- #
406
- # @param amount [Integer] The discount amount (basis points for percentage, USD cents for flat)
407
- #
408
- # @param business_id [String] The business this discount belongs to
409
- #
410
- # @param code [String] The discount code
411
- #
412
- # @param created_at [Time] Timestamp when the discount was created
413
- #
414
- # @param discount_id [String] The unique discount ID
415
- #
416
- # @param metadata [Hash{Symbol=>String}] Additional metadata
417
- #
418
- # @param position [Integer] Position of this discount in the stack (0-based)
419
- #
420
- # @param preserve_on_plan_change [Boolean] Whether this discount should be preserved when a subscription changes plans
421
- #
422
- # @param restricted_to [Array<String>] List of product IDs to which this discount is restricted
423
- #
424
- # @param times_used [Integer] How many times this discount has been used
425
- #
426
- # @param type [Symbol, Dodopayments::Models::DiscountType] The type of discount
427
- #
428
- # @param cycles_remaining [Integer, nil] Remaining billing cycles for this discount on this subscription (None for one-ti
429
- #
430
- # @param expires_at [Time, nil] Optional date/time after which discount is expired
431
- #
432
- # @param name [String, nil] Name for the Discount
433
- #
434
- # @param subscription_cycles [Integer, nil] Number of subscription billing cycles this discount is valid for
435
- #
436
- # @param usage_limit [Integer, nil] Usage limit for this discount, if any
437
- end
438
309
  end
439
310
  end
440
311
  end
@@ -57,6 +57,14 @@ module Dodopayments
57
57
  # @return [Symbol, Dodopayments::Models::Currency, nil]
58
58
  optional :billing_currency, enum: -> { Dodopayments::Currency }, nil?: true
59
59
 
60
+ # @!attribute customer_business_name
61
+ # Optional business / legal name associated with the tax id. When provided
62
+ # together with a valid tax id for a B2B purchase, this name is rendered on the
63
+ # invoice instead of the customer's personal name.
64
+ #
65
+ # @return [String, nil]
66
+ optional :customer_business_name, String, nil?: true
67
+
60
68
  # @!attribute discount_code
61
69
  # @deprecated Use `discount_id` instead.
62
70
  #
@@ -171,7 +179,7 @@ module Dodopayments
171
179
  # @return [Integer, nil]
172
180
  optional :trial_period_days, Integer, nil?: true
173
181
 
174
- # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, discount_codes: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
182
+ # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, customer_business_name: nil, discount_code: nil, discount_codes: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
175
183
  # Some parameter documentations has been truncated, see
176
184
  # {Dodopayments::Models::SubscriptionCreateParams} for more details.
177
185
  #
@@ -189,6 +197,8 @@ module Dodopayments
189
197
  #
190
198
  # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] Fix the currency in which the end customer is billed.
191
199
  #
200
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
201
+ #
192
202
  # @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
193
203
  #
194
204
  # @param discount_codes [Array<String>, nil] Stacked discount codes to apply, in order of application. Max 20.
@@ -139,6 +139,13 @@ module Dodopayments
139
139
  # @return [Time, nil]
140
140
  optional :cancelled_at, Time, nil?: true
141
141
 
142
+ # @!attribute customer_business_name
143
+ # Business / legal name associated with the tax id (B2B). When set this is used on
144
+ # the invoice in place of the customer's personal name.
145
+ #
146
+ # @return [String, nil]
147
+ optional :customer_business_name, String, nil?: true
148
+
142
149
  # @!attribute discount_cycles_remaining
143
150
  # DEPRECATED: Use discounts[].cycles_remaining instead.
144
151
  #
@@ -175,7 +182,7 @@ module Dodopayments
175
182
  # @return [String, nil]
176
183
  optional :tax_id, String, nil?: true
177
184
 
178
- # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
185
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
179
186
  # Some parameter documentations has been truncated, see
180
187
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
181
188
  #
@@ -225,6 +232,8 @@ module Dodopayments
225
232
  #
226
233
  # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
227
234
  #
235
+ # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
236
+ #
228
237
  # @param discount_cycles_remaining [Integer, nil] DEPRECATED: Use discounts[].cycles_remaining instead.
229
238
  #
230
239
  # @param discount_id [String, nil] DEPRECATED: Use discounts instead.
@@ -52,6 +52,15 @@ module Dodopayments
52
52
  },
53
53
  nil?: true
54
54
 
55
+ # @!attribute customer_business_name
56
+ # Optional business / legal name associated with the tax id. When provided
57
+ # together with a valid tax id for a B2B subscription, this name is rendered on
58
+ # the invoice instead of the customer's personal name. Send `null` to explicitly
59
+ # clear the business name.
60
+ #
61
+ # @return [String, nil]
62
+ optional :customer_business_name, String, nil?: true
63
+
55
64
  # @!attribute customer_name
56
65
  #
57
66
  # @return [String, nil]
@@ -82,7 +91,7 @@ module Dodopayments
82
91
  # @return [String, nil]
83
92
  optional :tax_id, String, nil?: true
84
93
 
85
- # @!method initialize(subscription_id:, billing: nil, cancel_at_next_billing_date: nil, cancel_reason: nil, cancellation_comment: nil, cancellation_feedback: nil, credit_entitlement_cart: nil, customer_name: nil, disable_on_demand: nil, metadata: nil, next_billing_date: nil, status: nil, tax_id: nil, request_options: {})
94
+ # @!method initialize(subscription_id:, billing: nil, cancel_at_next_billing_date: nil, cancel_reason: nil, cancellation_comment: nil, cancellation_feedback: nil, credit_entitlement_cart: nil, customer_business_name: nil, customer_name: nil, disable_on_demand: nil, metadata: nil, next_billing_date: nil, status: nil, tax_id: nil, request_options: {})
86
95
  # Some parameter documentations has been truncated, see
87
96
  # {Dodopayments::Models::SubscriptionUpdateParams} for more details.
88
97
  #
@@ -100,6 +109,8 @@ module Dodopayments
100
109
  #
101
110
  # @param credit_entitlement_cart [Array<Dodopayments::Models::SubscriptionUpdateParams::CreditEntitlementCart>, nil] Update credit entitlement cart settings
102
111
  #
112
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
113
+ #
103
114
  # @param customer_name [String, nil]
104
115
  #
105
116
  # @param disable_on_demand [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
@@ -12,24 +12,24 @@ module Dodopayments
12
12
  # @return [String]
13
13
  required :subscription_id, String
14
14
 
15
- # @!attribute body
15
+ # @!attribute payment_method
16
16
  #
17
- # @return [Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing]
18
- required :body, union: -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body }
17
+ # @return [Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing]
18
+ required :payment_method, union: -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod }
19
19
 
20
- # @!method initialize(subscription_id:, body:, request_options: {})
20
+ # @!method initialize(subscription_id:, payment_method:, request_options: {})
21
21
  # @param subscription_id [String]
22
- # @param body [Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing]
22
+ # @param payment_method [Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing]
23
23
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
24
24
 
25
- module Body
25
+ module PaymentMethod
26
26
  extend Dodopayments::Internal::Type::Union
27
27
 
28
28
  discriminator :type
29
29
 
30
- variant :new, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::New }
30
+ variant :new, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New }
31
31
 
32
- variant :existing, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::Existing }
32
+ variant :existing, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing }
33
33
 
34
34
  class New < Dodopayments::Internal::Type::BaseModel
35
35
  # @!attribute type
@@ -64,7 +64,7 @@ module Dodopayments
64
64
  end
65
65
 
66
66
  # @!method self.variants
67
- # @return [Array(Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing)]
67
+ # @return [Array(Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing)]
68
68
  end
69
69
  end
70
70
  end
@@ -22,10 +22,8 @@ module Dodopayments
22
22
  SUBSCRIPTION_ACTIVE = :"subscription.active"
23
23
  SUBSCRIPTION_RENEWED = :"subscription.renewed"
24
24
  SUBSCRIPTION_ON_HOLD = :"subscription.on_hold"
25
+ SUBSCRIPTION_PAUSED = :"subscription.paused"
25
26
  SUBSCRIPTION_CANCELLED = :"subscription.cancelled"
26
- SUBSCRIPTION_CANCELLATION_SCHEDULED = :"subscription.cancellation_scheduled"
27
- SUBSCRIPTION_TRIAL_ENDING = :"subscription.trial_ending"
28
- SUBSCRIPTION_UPCOMING_RENEWAL = :"subscription.upcoming_renewal"
29
27
  SUBSCRIPTION_FAILED = :"subscription.failed"
30
28
  SUBSCRIPTION_EXPIRED = :"subscription.expired"
31
29
  SUBSCRIPTION_PLAN_CHANGED = :"subscription.plan_changed"
@@ -49,8 +47,6 @@ module Dodopayments
49
47
  ABANDONED_CHECKOUT_RECOVERED = :"abandoned_checkout.recovered"
50
48
  DUNNING_STARTED = :"dunning.started"
51
49
  DUNNING_RECOVERED = :"dunning.recovered"
52
- ACR_EMAIL = :"acr.email"
53
- DUNNING_EMAIL = :"dunning.email"
54
50
  ENTITLEMENT_GRANT_CREATED = :"entitlement_grant.created"
55
51
  ENTITLEMENT_GRANT_DELIVERED = :"entitlement_grant.delivered"
56
52
  ENTITLEMENT_GRANT_FAILED = :"entitlement_grant.failed"
@@ -195,6 +195,8 @@ module Dodopayments
195
195
 
196
196
  DiscountDeleteParams = Dodopayments::Models::DiscountDeleteParams
197
197
 
198
+ DiscountDetail = Dodopayments::Models::DiscountDetail
199
+
198
200
  DiscountListParams = Dodopayments::Models::DiscountListParams
199
201
 
200
202
  DiscountRetrieveByCodeParams = Dodopayments::Models::DiscountRetrieveByCodeParams
@@ -263,8 +265,12 @@ module Dodopayments
263
265
 
264
266
  FilterOperator = Dodopayments::Models::FilterOperator
265
267
 
268
+ FilterType = Dodopayments::Models::FilterType
269
+
266
270
  GetDispute = Dodopayments::Models::GetDispute
267
271
 
272
+ GitHubPermission = Dodopayments::Models::GitHubPermission
273
+
268
274
  IntegrationConfig = Dodopayments::Models::IntegrationConfig
269
275
 
270
276
  IntegrationConfigResponse = Dodopayments::Models::IntegrationConfigResponse
@@ -363,6 +369,24 @@ module Dodopayments
363
369
 
364
370
  ProductArchiveParams = Dodopayments::Models::ProductArchiveParams
365
371
 
372
+ ProductCollection = Dodopayments::Models::ProductCollection
373
+
374
+ ProductCollectionCreateParams = Dodopayments::Models::ProductCollectionCreateParams
375
+
376
+ ProductCollectionDeleteParams = Dodopayments::Models::ProductCollectionDeleteParams
377
+
378
+ ProductCollectionListParams = Dodopayments::Models::ProductCollectionListParams
379
+
380
+ ProductCollectionRetrieveParams = Dodopayments::Models::ProductCollectionRetrieveParams
381
+
382
+ ProductCollections = Dodopayments::Models::ProductCollections
383
+
384
+ ProductCollectionUnarchiveParams = Dodopayments::Models::ProductCollectionUnarchiveParams
385
+
386
+ ProductCollectionUpdateImagesParams = Dodopayments::Models::ProductCollectionUpdateImagesParams
387
+
388
+ ProductCollectionUpdateParams = Dodopayments::Models::ProductCollectionUpdateParams
389
+
366
390
  ProductCreateParams = Dodopayments::Models::ProductCreateParams
367
391
 
368
392
  ProductEntitlementSummary = Dodopayments::Models::ProductEntitlementSummary
@@ -6,7 +6,7 @@ module Dodopayments
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {Dodopayments::Models::CheckoutSessionCreateParams} for more details.
8
8
  #
9
- # @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
9
+ # @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customer_business_name: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
10
10
  #
11
11
  # @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
12
12
  #
@@ -24,6 +24,8 @@ module Dodopayments
24
24
  #
25
25
  # @param customer [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil] Customer details for the session
26
26
  #
27
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
28
+ #
27
29
  # @param customization [Dodopayments::Models::CheckoutSessionCustomization] Customization for the checkout session page
28
30
  #
29
31
  # @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
@@ -90,7 +92,7 @@ module Dodopayments
90
92
  # Some parameter documentations has been truncated, see
91
93
  # {Dodopayments::Models::CheckoutSessionPreviewParams} for more details.
92
94
  #
93
- # @overload preview(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
95
+ # @overload preview(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customer_business_name: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
94
96
  #
95
97
  # @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
96
98
  #
@@ -108,6 +110,8 @@ module Dodopayments
108
110
  #
109
111
  # @param customer [Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer, nil] Customer details for the session
110
112
  #
113
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
114
+ #
111
115
  # @param customization [Dodopayments::Models::CheckoutSessionCustomization] Customization for the checkout session page
112
116
  #
113
117
  # @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co