@usehercules/sdk 1.7.0 → 1.8.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 (201) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +17 -16
  3. package/package.json +1 -1
  4. package/resources/beta/beta.d.mts +4 -4
  5. package/resources/beta/beta.d.mts.map +1 -1
  6. package/resources/beta/beta.d.ts +4 -4
  7. package/resources/beta/beta.d.ts.map +1 -1
  8. package/resources/beta/beta.js +4 -4
  9. package/resources/beta/beta.js.map +1 -1
  10. package/resources/beta/beta.mjs +4 -4
  11. package/resources/beta/beta.mjs.map +1 -1
  12. package/resources/beta/commerce/commerce.d.mts +201 -0
  13. package/resources/beta/commerce/commerce.d.mts.map +1 -0
  14. package/resources/beta/commerce/commerce.d.ts +201 -0
  15. package/resources/beta/commerce/commerce.d.ts.map +1 -0
  16. package/resources/beta/{pay/pay.js → commerce/commerce.js} +10 -14
  17. package/resources/beta/commerce/commerce.js.map +1 -0
  18. package/resources/beta/{pay/pay.mjs → commerce/commerce.mjs} +8 -12
  19. package/resources/beta/commerce/commerce.mjs.map +1 -0
  20. package/resources/beta/commerce/coupons.d.mts +333 -0
  21. package/resources/beta/commerce/coupons.d.mts.map +1 -0
  22. package/resources/beta/commerce/coupons.d.ts +333 -0
  23. package/resources/beta/commerce/coupons.d.ts.map +1 -0
  24. package/resources/beta/{pay → commerce}/coupons.js +8 -5
  25. package/resources/beta/commerce/coupons.js.map +1 -0
  26. package/resources/beta/{pay → commerce}/coupons.mjs +8 -5
  27. package/resources/beta/commerce/coupons.mjs.map +1 -0
  28. package/resources/beta/commerce/customers.d.mts +407 -0
  29. package/resources/beta/commerce/customers.d.mts.map +1 -0
  30. package/resources/beta/commerce/customers.d.ts +407 -0
  31. package/resources/beta/commerce/customers.d.ts.map +1 -0
  32. package/resources/beta/{pay → commerce}/customers.js +9 -6
  33. package/resources/beta/commerce/customers.js.map +1 -0
  34. package/resources/beta/{pay → commerce}/customers.mjs +9 -6
  35. package/resources/beta/commerce/customers.mjs.map +1 -0
  36. package/resources/beta/commerce/index.d.mts +5 -0
  37. package/resources/beta/commerce/index.d.mts.map +1 -0
  38. package/resources/beta/commerce/index.d.ts +5 -0
  39. package/resources/beta/commerce/index.d.ts.map +1 -0
  40. package/resources/beta/{pay → commerce}/index.js +3 -5
  41. package/resources/beta/commerce/index.js.map +1 -0
  42. package/resources/beta/{pay → commerce}/index.mjs +1 -2
  43. package/resources/beta/commerce/index.mjs.map +1 -0
  44. package/resources/beta/commerce/products/index.d.mts +4 -0
  45. package/resources/beta/commerce/products/index.d.mts.map +1 -0
  46. package/resources/beta/commerce/products/index.d.ts +4 -0
  47. package/resources/beta/commerce/products/index.d.ts.map +1 -0
  48. package/resources/beta/{pay → commerce}/products/index.js +3 -3
  49. package/resources/beta/commerce/products/index.js.map +1 -0
  50. package/resources/beta/{pay → commerce}/products/index.mjs +1 -1
  51. package/resources/beta/commerce/products/index.mjs.map +1 -0
  52. package/resources/beta/commerce/products/products.d.mts +967 -0
  53. package/resources/beta/commerce/products/products.d.mts.map +1 -0
  54. package/resources/beta/commerce/products/products.d.ts +967 -0
  55. package/resources/beta/commerce/products/products.d.ts.map +1 -0
  56. package/resources/beta/{pay → commerce}/products/products.js +16 -12
  57. package/resources/beta/commerce/products/products.js.map +1 -0
  58. package/resources/beta/{pay → commerce}/products/products.mjs +16 -12
  59. package/resources/beta/commerce/products/products.mjs.map +1 -0
  60. package/resources/beta/commerce/products/resources.d.mts +160 -0
  61. package/resources/beta/commerce/products/resources.d.mts.map +1 -0
  62. package/resources/beta/commerce/products/resources.d.ts +160 -0
  63. package/resources/beta/commerce/products/resources.d.ts.map +1 -0
  64. package/resources/beta/commerce/products/resources.js +41 -0
  65. package/resources/beta/commerce/products/resources.js.map +1 -0
  66. package/resources/beta/commerce/products/resources.mjs +37 -0
  67. package/resources/beta/commerce/products/resources.mjs.map +1 -0
  68. package/resources/beta/commerce/products/variants.d.mts +798 -0
  69. package/resources/beta/commerce/products/variants.d.mts.map +1 -0
  70. package/resources/beta/commerce/products/variants.d.ts +798 -0
  71. package/resources/beta/commerce/products/variants.d.ts.map +1 -0
  72. package/resources/beta/{pay → commerce}/products/variants.js +5 -8
  73. package/resources/beta/commerce/products/variants.js.map +1 -0
  74. package/resources/beta/{pay → commerce}/products/variants.mjs +5 -8
  75. package/resources/beta/commerce/products/variants.mjs.map +1 -0
  76. package/resources/beta/commerce/products.d.mts.map +1 -0
  77. package/resources/beta/commerce/products.d.ts.map +1 -0
  78. package/resources/beta/commerce/products.js.map +1 -0
  79. package/resources/beta/commerce/products.mjs.map +1 -0
  80. package/resources/beta/commerce.d.mts +2 -0
  81. package/resources/beta/commerce.d.mts.map +1 -0
  82. package/resources/beta/commerce.d.ts +2 -0
  83. package/resources/beta/commerce.d.ts.map +1 -0
  84. package/resources/beta/{pay.js → commerce.js} +2 -2
  85. package/resources/beta/commerce.js.map +1 -0
  86. package/resources/beta/{pay.mjs → commerce.mjs} +2 -2
  87. package/resources/beta/commerce.mjs.map +1 -0
  88. package/resources/beta/index.d.mts +1 -1
  89. package/resources/beta/index.d.mts.map +1 -1
  90. package/resources/beta/index.d.ts +1 -1
  91. package/resources/beta/index.d.ts.map +1 -1
  92. package/resources/beta/index.js +3 -3
  93. package/resources/beta/index.js.map +1 -1
  94. package/resources/beta/index.mjs +1 -1
  95. package/resources/beta/index.mjs.map +1 -1
  96. package/resources/push-notifications/push-notifications.d.mts +8 -9
  97. package/resources/push-notifications/push-notifications.d.mts.map +1 -1
  98. package/resources/push-notifications/push-notifications.d.ts +8 -9
  99. package/resources/push-notifications/push-notifications.d.ts.map +1 -1
  100. package/resources/push-notifications/push-notifications.js +5 -6
  101. package/resources/push-notifications/push-notifications.js.map +1 -1
  102. package/resources/push-notifications/push-notifications.mjs +5 -6
  103. package/resources/push-notifications/push-notifications.mjs.map +1 -1
  104. package/src/resources/beta/beta.ts +18 -18
  105. package/src/resources/beta/{pay/pay.ts → commerce/commerce.ts} +82 -85
  106. package/src/resources/beta/commerce/coupons.ts +440 -0
  107. package/src/resources/beta/commerce/customers.ts +532 -0
  108. package/src/resources/beta/commerce/index.ts +47 -0
  109. package/src/resources/beta/commerce/products/index.ts +37 -0
  110. package/src/resources/beta/commerce/products/products.ts +1199 -0
  111. package/src/resources/beta/commerce/products/resources.ts +213 -0
  112. package/src/resources/beta/commerce/products/variants.ts +984 -0
  113. package/src/resources/beta/{pay.ts → commerce.ts} +1 -1
  114. package/src/resources/beta/index.ts +8 -8
  115. package/src/resources/push-notifications/push-notifications.ts +8 -9
  116. package/src/version.ts +1 -1
  117. package/version.d.mts +1 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/version.mjs +1 -1
  121. package/resources/beta/pay/coupons.d.mts +0 -156
  122. package/resources/beta/pay/coupons.d.mts.map +0 -1
  123. package/resources/beta/pay/coupons.d.ts +0 -156
  124. package/resources/beta/pay/coupons.d.ts.map +0 -1
  125. package/resources/beta/pay/coupons.js.map +0 -1
  126. package/resources/beta/pay/coupons.mjs.map +0 -1
  127. package/resources/beta/pay/customers.d.mts +0 -160
  128. package/resources/beta/pay/customers.d.mts.map +0 -1
  129. package/resources/beta/pay/customers.d.ts +0 -160
  130. package/resources/beta/pay/customers.d.ts.map +0 -1
  131. package/resources/beta/pay/customers.js.map +0 -1
  132. package/resources/beta/pay/customers.mjs.map +0 -1
  133. package/resources/beta/pay/entitlements.d.mts +0 -76
  134. package/resources/beta/pay/entitlements.d.mts.map +0 -1
  135. package/resources/beta/pay/entitlements.d.ts +0 -76
  136. package/resources/beta/pay/entitlements.d.ts.map +0 -1
  137. package/resources/beta/pay/entitlements.js +0 -41
  138. package/resources/beta/pay/entitlements.js.map +0 -1
  139. package/resources/beta/pay/entitlements.mjs +0 -37
  140. package/resources/beta/pay/entitlements.mjs.map +0 -1
  141. package/resources/beta/pay/index.d.mts +0 -6
  142. package/resources/beta/pay/index.d.mts.map +0 -1
  143. package/resources/beta/pay/index.d.ts +0 -6
  144. package/resources/beta/pay/index.d.ts.map +0 -1
  145. package/resources/beta/pay/index.js.map +0 -1
  146. package/resources/beta/pay/index.mjs.map +0 -1
  147. package/resources/beta/pay/pay.d.mts +0 -206
  148. package/resources/beta/pay/pay.d.mts.map +0 -1
  149. package/resources/beta/pay/pay.d.ts +0 -206
  150. package/resources/beta/pay/pay.d.ts.map +0 -1
  151. package/resources/beta/pay/pay.js.map +0 -1
  152. package/resources/beta/pay/pay.mjs.map +0 -1
  153. package/resources/beta/pay/products/entitlements.d.mts +0 -53
  154. package/resources/beta/pay/products/entitlements.d.mts.map +0 -1
  155. package/resources/beta/pay/products/entitlements.d.ts +0 -53
  156. package/resources/beta/pay/products/entitlements.d.ts.map +0 -1
  157. package/resources/beta/pay/products/entitlements.js +0 -38
  158. package/resources/beta/pay/products/entitlements.js.map +0 -1
  159. package/resources/beta/pay/products/entitlements.mjs +0 -34
  160. package/resources/beta/pay/products/entitlements.mjs.map +0 -1
  161. package/resources/beta/pay/products/index.d.mts +0 -4
  162. package/resources/beta/pay/products/index.d.mts.map +0 -1
  163. package/resources/beta/pay/products/index.d.ts +0 -4
  164. package/resources/beta/pay/products/index.d.ts.map +0 -1
  165. package/resources/beta/pay/products/index.js.map +0 -1
  166. package/resources/beta/pay/products/index.mjs.map +0 -1
  167. package/resources/beta/pay/products/products.d.mts +0 -183
  168. package/resources/beta/pay/products/products.d.mts.map +0 -1
  169. package/resources/beta/pay/products/products.d.ts +0 -183
  170. package/resources/beta/pay/products/products.d.ts.map +0 -1
  171. package/resources/beta/pay/products/products.js.map +0 -1
  172. package/resources/beta/pay/products/products.mjs.map +0 -1
  173. package/resources/beta/pay/products/variants.d.mts +0 -206
  174. package/resources/beta/pay/products/variants.d.mts.map +0 -1
  175. package/resources/beta/pay/products/variants.d.ts +0 -206
  176. package/resources/beta/pay/products/variants.d.ts.map +0 -1
  177. package/resources/beta/pay/products/variants.js.map +0 -1
  178. package/resources/beta/pay/products/variants.mjs.map +0 -1
  179. package/resources/beta/pay/products.d.mts.map +0 -1
  180. package/resources/beta/pay/products.d.ts.map +0 -1
  181. package/resources/beta/pay/products.js.map +0 -1
  182. package/resources/beta/pay/products.mjs.map +0 -1
  183. package/resources/beta/pay.d.mts +0 -2
  184. package/resources/beta/pay.d.mts.map +0 -1
  185. package/resources/beta/pay.d.ts +0 -2
  186. package/resources/beta/pay.d.ts.map +0 -1
  187. package/resources/beta/pay.js.map +0 -1
  188. package/resources/beta/pay.mjs.map +0 -1
  189. package/src/resources/beta/pay/coupons.ts +0 -218
  190. package/src/resources/beta/pay/customers.ts +0 -229
  191. package/src/resources/beta/pay/entitlements.ts +0 -113
  192. package/src/resources/beta/pay/index.ts +0 -46
  193. package/src/resources/beta/pay/products/entitlements.ts +0 -93
  194. package/src/resources/beta/pay/products/index.ts +0 -28
  195. package/src/resources/beta/pay/products/products.ts +0 -280
  196. package/src/resources/beta/pay/products/variants.ts +0 -279
  197. /package/resources/beta/{pay → commerce}/products.d.mts +0 -0
  198. /package/resources/beta/{pay → commerce}/products.d.ts +0 -0
  199. /package/resources/beta/{pay → commerce}/products.js +0 -0
  200. /package/resources/beta/{pay → commerce}/products.mjs +0 -0
  201. /package/src/resources/beta/{pay → commerce}/products.ts +0 -0
@@ -0,0 +1,967 @@
1
+ import { APIResource } from "../../../../core/resource.js";
2
+ import * as ResourcesAPI from "./resources.js";
3
+ import { ResourceAttachParams, ResourceAttachResponse, ResourceListParams, ResourceListResponse, ResourceListResponsesCursorIDPage, ResourceRemoveParams, Resources } from "./resources.js";
4
+ import * as VariantsAPI from "./variants.js";
5
+ import { VariantArchiveParams, VariantArchiveResponse, VariantCreateParams, VariantCreateResponse, VariantGetParams, VariantGetResponse, VariantListParams, VariantListResponse, VariantListResponsesCursorIDPage, VariantUpdateParams, VariantUpdateResponse, Variants } from "./variants.js";
6
+ import { APIPromise } from "../../../../core/api-promise.js";
7
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../../core/pagination.js";
8
+ import { RequestOptions } from "../../../../internal/request-options.js";
9
+ export declare class Products extends APIResource {
10
+ resources: ResourcesAPI.Resources;
11
+ variants: VariantsAPI.Variants;
12
+ /**
13
+ * Creates a new subscription product with a recurring price. Common examples
14
+ * include Free, Pro, Business, or Teams tiers. After creating a product, attach
15
+ * resources to define which features or content customers on this product can
16
+ * access.
17
+ */
18
+ create(body: ProductCreateParams, options?: RequestOptions): APIPromise<ProductCreateResponse>;
19
+ /**
20
+ * Updates an existing product. Use this to modify the product name, description,
21
+ * or active status. Pricing cannot be changed after creation—create a new product
22
+ * instead.
23
+ */
24
+ update(productID: string, body?: ProductUpdateParams | null | undefined, options?: RequestOptions): APIPromise<ProductUpdateResponse>;
25
+ /**
26
+ * Retrieves a paginated list of subscription products. Products define the pricing
27
+ * and billing intervals for subscriptions. Each product can have resources
28
+ * attached that grant access to features or content.
29
+ */
30
+ list(query?: ProductListParams | null | undefined, options?: RequestOptions): PagePromise<ProductListResponsesCursorIDPage, ProductListResponse>;
31
+ /**
32
+ * Archives a product, preventing new subscriptions. Existing subscriptions remain
33
+ * active. Use this instead of deletion to preserve subscription history.
34
+ */
35
+ archive(productID: string, options?: RequestOptions): APIPromise<ProductArchiveResponse>;
36
+ /**
37
+ * Retrieves a product by ID. Returns the product object including pricing details
38
+ * and status.
39
+ */
40
+ get(productID: string, options?: RequestOptions): APIPromise<ProductGetResponse>;
41
+ }
42
+ export type ProductListResponsesCursorIDPage = CursorIDPage<ProductListResponse>;
43
+ /**
44
+ * A product that customers can purchase. Products can be one-time purchases or
45
+ * recurring subscriptions. Attach resources to a product to grant features to
46
+ * customers.
47
+ */
48
+ export interface ProductCreateResponse {
49
+ /**
50
+ * Unique identifier for the topic subscription
51
+ */
52
+ id: string;
53
+ /**
54
+ * Whether the product is available for new purchases
55
+ */
56
+ active: boolean;
57
+ /**
58
+ * Timestamp when the product was created
59
+ */
60
+ created: string;
61
+ /**
62
+ * Display name for the product (e.g., Pro, Business, Teams)
63
+ */
64
+ name: string;
65
+ /**
66
+ * Price configuration for a product. Can be one-time or recurring (subscription).
67
+ */
68
+ default_price?: ProductCreateResponse.DefaultPrice | null;
69
+ /**
70
+ * Detailed description of what the product includes
71
+ */
72
+ description?: string | null;
73
+ /**
74
+ * Media attachments (images, videos) for the product
75
+ */
76
+ media?: Array<ProductCreateResponse.Media>;
77
+ /**
78
+ * Custom metadata for the product
79
+ */
80
+ metadata?: {
81
+ [key: string]: unknown;
82
+ };
83
+ /**
84
+ * ID of the product group this product belongs to. Product groups define shared
85
+ * billing configuration.
86
+ */
87
+ product_group_id?: string | null;
88
+ /**
89
+ * Resources attached to this product. Customers get access to these resources when
90
+ * they purchase the product.
91
+ */
92
+ resources?: Array<ProductCreateResponse.Resource>;
93
+ /**
94
+ * Tags for categorizing and filtering products
95
+ */
96
+ tags?: Array<string>;
97
+ }
98
+ export declare namespace ProductCreateResponse {
99
+ /**
100
+ * Price configuration for a product. Can be one-time or recurring (subscription).
101
+ */
102
+ interface DefaultPrice {
103
+ /**
104
+ * Unique identifier for the topic subscription
105
+ */
106
+ id: string;
107
+ /**
108
+ * How to handle the billing cycle when switching plans. 'now' resets to current
109
+ * time, 'unchanged' keeps the original anchor. Null for one-time prices.
110
+ */
111
+ billing_cycle_anchor: 'now' | 'unchanged' | null;
112
+ /**
113
+ * Three-letter ISO currency code (e.g., usd, eur)
114
+ */
115
+ currency: string;
116
+ /**
117
+ * Billing frequency for recurring prices: day, week, month, or year. Null for
118
+ * one-time prices.
119
+ */
120
+ interval: 'day' | 'week' | 'month' | 'year' | null;
121
+ /**
122
+ * Number of intervals between billings for recurring prices. Null for one-time
123
+ * prices.
124
+ */
125
+ interval_count: number | null;
126
+ /**
127
+ * How to handle prorations when switching plans. 'default' creates prorations,
128
+ * 'none' disables them. Null for one-time prices.
129
+ */
130
+ proration_behavior: 'default' | 'none' | null;
131
+ /**
132
+ * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
133
+ * billing period start. Null for one-time prices or to use Stripe's default.
134
+ */
135
+ proration_date: 'now' | 'start_of_period' | null;
136
+ /**
137
+ * Price type: one_time for single purchases, recurring for subscriptions
138
+ */
139
+ type: 'one_time' | 'recurring';
140
+ /**
141
+ * Price amount in the smallest currency unit (e.g., cents)
142
+ */
143
+ unit_amount: number | null;
144
+ }
145
+ /**
146
+ * Media attachment for products or variants
147
+ */
148
+ interface Media {
149
+ /**
150
+ * Type of media: image, video, or external link
151
+ */
152
+ type: 'image' | 'video' | 'external';
153
+ /**
154
+ * URL of the media resource
155
+ */
156
+ url: string;
157
+ }
158
+ /**
159
+ * A resource that can be attached to products to grant access to customers.
160
+ * Resources represent monetizable content or features in your app.
161
+ */
162
+ interface Resource {
163
+ /**
164
+ * Unique identifier for the topic subscription
165
+ */
166
+ id: string;
167
+ /**
168
+ * Whether the resource is active and grants access
169
+ */
170
+ active: boolean;
171
+ /**
172
+ * Timestamp when the resource was created
173
+ */
174
+ created: string;
175
+ /**
176
+ * Type of resource: custom_entitlement, file, content, course, or ticket
177
+ */
178
+ type: 'custom_entitlement' | 'file' | 'content' | 'course' | 'ticket';
179
+ /**
180
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
181
+ */
182
+ custom_entitlement?: Resource.CustomEntitlement | null;
183
+ }
184
+ namespace Resource {
185
+ /**
186
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
187
+ */
188
+ interface CustomEntitlement {
189
+ /**
190
+ * Unique identifier for the custom entitlement. Must not contain '.'
191
+ */
192
+ id: string;
193
+ /**
194
+ * Custom metadata for the entitlement
195
+ */
196
+ metadata?: {
197
+ [key: string]: unknown;
198
+ };
199
+ }
200
+ }
201
+ }
202
+ /**
203
+ * A product that customers can purchase. Products can be one-time purchases or
204
+ * recurring subscriptions. Attach resources to a product to grant features to
205
+ * customers.
206
+ */
207
+ export interface ProductUpdateResponse {
208
+ /**
209
+ * Unique identifier for the topic subscription
210
+ */
211
+ id: string;
212
+ /**
213
+ * Whether the product is available for new purchases
214
+ */
215
+ active: boolean;
216
+ /**
217
+ * Timestamp when the product was created
218
+ */
219
+ created: string;
220
+ /**
221
+ * Display name for the product (e.g., Pro, Business, Teams)
222
+ */
223
+ name: string;
224
+ /**
225
+ * Price configuration for a product. Can be one-time or recurring (subscription).
226
+ */
227
+ default_price?: ProductUpdateResponse.DefaultPrice | null;
228
+ /**
229
+ * Detailed description of what the product includes
230
+ */
231
+ description?: string | null;
232
+ /**
233
+ * Media attachments (images, videos) for the product
234
+ */
235
+ media?: Array<ProductUpdateResponse.Media>;
236
+ /**
237
+ * Custom metadata for the product
238
+ */
239
+ metadata?: {
240
+ [key: string]: unknown;
241
+ };
242
+ /**
243
+ * ID of the product group this product belongs to. Product groups define shared
244
+ * billing configuration.
245
+ */
246
+ product_group_id?: string | null;
247
+ /**
248
+ * Resources attached to this product. Customers get access to these resources when
249
+ * they purchase the product.
250
+ */
251
+ resources?: Array<ProductUpdateResponse.Resource>;
252
+ /**
253
+ * Tags for categorizing and filtering products
254
+ */
255
+ tags?: Array<string>;
256
+ }
257
+ export declare namespace ProductUpdateResponse {
258
+ /**
259
+ * Price configuration for a product. Can be one-time or recurring (subscription).
260
+ */
261
+ interface DefaultPrice {
262
+ /**
263
+ * Unique identifier for the topic subscription
264
+ */
265
+ id: string;
266
+ /**
267
+ * How to handle the billing cycle when switching plans. 'now' resets to current
268
+ * time, 'unchanged' keeps the original anchor. Null for one-time prices.
269
+ */
270
+ billing_cycle_anchor: 'now' | 'unchanged' | null;
271
+ /**
272
+ * Three-letter ISO currency code (e.g., usd, eur)
273
+ */
274
+ currency: string;
275
+ /**
276
+ * Billing frequency for recurring prices: day, week, month, or year. Null for
277
+ * one-time prices.
278
+ */
279
+ interval: 'day' | 'week' | 'month' | 'year' | null;
280
+ /**
281
+ * Number of intervals between billings for recurring prices. Null for one-time
282
+ * prices.
283
+ */
284
+ interval_count: number | null;
285
+ /**
286
+ * How to handle prorations when switching plans. 'default' creates prorations,
287
+ * 'none' disables them. Null for one-time prices.
288
+ */
289
+ proration_behavior: 'default' | 'none' | null;
290
+ /**
291
+ * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
292
+ * billing period start. Null for one-time prices or to use Stripe's default.
293
+ */
294
+ proration_date: 'now' | 'start_of_period' | null;
295
+ /**
296
+ * Price type: one_time for single purchases, recurring for subscriptions
297
+ */
298
+ type: 'one_time' | 'recurring';
299
+ /**
300
+ * Price amount in the smallest currency unit (e.g., cents)
301
+ */
302
+ unit_amount: number | null;
303
+ }
304
+ /**
305
+ * Media attachment for products or variants
306
+ */
307
+ interface Media {
308
+ /**
309
+ * Type of media: image, video, or external link
310
+ */
311
+ type: 'image' | 'video' | 'external';
312
+ /**
313
+ * URL of the media resource
314
+ */
315
+ url: string;
316
+ }
317
+ /**
318
+ * A resource that can be attached to products to grant access to customers.
319
+ * Resources represent monetizable content or features in your app.
320
+ */
321
+ interface Resource {
322
+ /**
323
+ * Unique identifier for the topic subscription
324
+ */
325
+ id: string;
326
+ /**
327
+ * Whether the resource is active and grants access
328
+ */
329
+ active: boolean;
330
+ /**
331
+ * Timestamp when the resource was created
332
+ */
333
+ created: string;
334
+ /**
335
+ * Type of resource: custom_entitlement, file, content, course, or ticket
336
+ */
337
+ type: 'custom_entitlement' | 'file' | 'content' | 'course' | 'ticket';
338
+ /**
339
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
340
+ */
341
+ custom_entitlement?: Resource.CustomEntitlement | null;
342
+ }
343
+ namespace Resource {
344
+ /**
345
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
346
+ */
347
+ interface CustomEntitlement {
348
+ /**
349
+ * Unique identifier for the custom entitlement. Must not contain '.'
350
+ */
351
+ id: string;
352
+ /**
353
+ * Custom metadata for the entitlement
354
+ */
355
+ metadata?: {
356
+ [key: string]: unknown;
357
+ };
358
+ }
359
+ }
360
+ }
361
+ /**
362
+ * A product that customers can purchase. Products can be one-time purchases or
363
+ * recurring subscriptions. Attach resources to a product to grant features to
364
+ * customers.
365
+ */
366
+ export interface ProductListResponse {
367
+ /**
368
+ * Unique identifier for the topic subscription
369
+ */
370
+ id: string;
371
+ /**
372
+ * Whether the product is available for new purchases
373
+ */
374
+ active: boolean;
375
+ /**
376
+ * Timestamp when the product was created
377
+ */
378
+ created: string;
379
+ /**
380
+ * Display name for the product (e.g., Pro, Business, Teams)
381
+ */
382
+ name: string;
383
+ /**
384
+ * Price configuration for a product. Can be one-time or recurring (subscription).
385
+ */
386
+ default_price?: ProductListResponse.DefaultPrice | null;
387
+ /**
388
+ * Detailed description of what the product includes
389
+ */
390
+ description?: string | null;
391
+ /**
392
+ * Media attachments (images, videos) for the product
393
+ */
394
+ media?: Array<ProductListResponse.Media>;
395
+ /**
396
+ * Custom metadata for the product
397
+ */
398
+ metadata?: {
399
+ [key: string]: unknown;
400
+ };
401
+ /**
402
+ * ID of the product group this product belongs to. Product groups define shared
403
+ * billing configuration.
404
+ */
405
+ product_group_id?: string | null;
406
+ /**
407
+ * Resources attached to this product. Customers get access to these resources when
408
+ * they purchase the product.
409
+ */
410
+ resources?: Array<ProductListResponse.Resource>;
411
+ /**
412
+ * Tags for categorizing and filtering products
413
+ */
414
+ tags?: Array<string>;
415
+ }
416
+ export declare namespace ProductListResponse {
417
+ /**
418
+ * Price configuration for a product. Can be one-time or recurring (subscription).
419
+ */
420
+ interface DefaultPrice {
421
+ /**
422
+ * Unique identifier for the topic subscription
423
+ */
424
+ id: string;
425
+ /**
426
+ * How to handle the billing cycle when switching plans. 'now' resets to current
427
+ * time, 'unchanged' keeps the original anchor. Null for one-time prices.
428
+ */
429
+ billing_cycle_anchor: 'now' | 'unchanged' | null;
430
+ /**
431
+ * Three-letter ISO currency code (e.g., usd, eur)
432
+ */
433
+ currency: string;
434
+ /**
435
+ * Billing frequency for recurring prices: day, week, month, or year. Null for
436
+ * one-time prices.
437
+ */
438
+ interval: 'day' | 'week' | 'month' | 'year' | null;
439
+ /**
440
+ * Number of intervals between billings for recurring prices. Null for one-time
441
+ * prices.
442
+ */
443
+ interval_count: number | null;
444
+ /**
445
+ * How to handle prorations when switching plans. 'default' creates prorations,
446
+ * 'none' disables them. Null for one-time prices.
447
+ */
448
+ proration_behavior: 'default' | 'none' | null;
449
+ /**
450
+ * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
451
+ * billing period start. Null for one-time prices or to use Stripe's default.
452
+ */
453
+ proration_date: 'now' | 'start_of_period' | null;
454
+ /**
455
+ * Price type: one_time for single purchases, recurring for subscriptions
456
+ */
457
+ type: 'one_time' | 'recurring';
458
+ /**
459
+ * Price amount in the smallest currency unit (e.g., cents)
460
+ */
461
+ unit_amount: number | null;
462
+ }
463
+ /**
464
+ * Media attachment for products or variants
465
+ */
466
+ interface Media {
467
+ /**
468
+ * Type of media: image, video, or external link
469
+ */
470
+ type: 'image' | 'video' | 'external';
471
+ /**
472
+ * URL of the media resource
473
+ */
474
+ url: string;
475
+ }
476
+ /**
477
+ * A resource that can be attached to products to grant access to customers.
478
+ * Resources represent monetizable content or features in your app.
479
+ */
480
+ interface Resource {
481
+ /**
482
+ * Unique identifier for the topic subscription
483
+ */
484
+ id: string;
485
+ /**
486
+ * Whether the resource is active and grants access
487
+ */
488
+ active: boolean;
489
+ /**
490
+ * Timestamp when the resource was created
491
+ */
492
+ created: string;
493
+ /**
494
+ * Type of resource: custom_entitlement, file, content, course, or ticket
495
+ */
496
+ type: 'custom_entitlement' | 'file' | 'content' | 'course' | 'ticket';
497
+ /**
498
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
499
+ */
500
+ custom_entitlement?: Resource.CustomEntitlement | null;
501
+ }
502
+ namespace Resource {
503
+ /**
504
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
505
+ */
506
+ interface CustomEntitlement {
507
+ /**
508
+ * Unique identifier for the custom entitlement. Must not contain '.'
509
+ */
510
+ id: string;
511
+ /**
512
+ * Custom metadata for the entitlement
513
+ */
514
+ metadata?: {
515
+ [key: string]: unknown;
516
+ };
517
+ }
518
+ }
519
+ }
520
+ /**
521
+ * A product that customers can purchase. Products can be one-time purchases or
522
+ * recurring subscriptions. Attach resources to a product to grant features to
523
+ * customers.
524
+ */
525
+ export interface ProductArchiveResponse {
526
+ /**
527
+ * Unique identifier for the topic subscription
528
+ */
529
+ id: string;
530
+ /**
531
+ * Whether the product is available for new purchases
532
+ */
533
+ active: boolean;
534
+ /**
535
+ * Timestamp when the product was created
536
+ */
537
+ created: string;
538
+ /**
539
+ * Display name for the product (e.g., Pro, Business, Teams)
540
+ */
541
+ name: string;
542
+ /**
543
+ * Price configuration for a product. Can be one-time or recurring (subscription).
544
+ */
545
+ default_price?: ProductArchiveResponse.DefaultPrice | null;
546
+ /**
547
+ * Detailed description of what the product includes
548
+ */
549
+ description?: string | null;
550
+ /**
551
+ * Media attachments (images, videos) for the product
552
+ */
553
+ media?: Array<ProductArchiveResponse.Media>;
554
+ /**
555
+ * Custom metadata for the product
556
+ */
557
+ metadata?: {
558
+ [key: string]: unknown;
559
+ };
560
+ /**
561
+ * ID of the product group this product belongs to. Product groups define shared
562
+ * billing configuration.
563
+ */
564
+ product_group_id?: string | null;
565
+ /**
566
+ * Resources attached to this product. Customers get access to these resources when
567
+ * they purchase the product.
568
+ */
569
+ resources?: Array<ProductArchiveResponse.Resource>;
570
+ /**
571
+ * Tags for categorizing and filtering products
572
+ */
573
+ tags?: Array<string>;
574
+ }
575
+ export declare namespace ProductArchiveResponse {
576
+ /**
577
+ * Price configuration for a product. Can be one-time or recurring (subscription).
578
+ */
579
+ interface DefaultPrice {
580
+ /**
581
+ * Unique identifier for the topic subscription
582
+ */
583
+ id: string;
584
+ /**
585
+ * How to handle the billing cycle when switching plans. 'now' resets to current
586
+ * time, 'unchanged' keeps the original anchor. Null for one-time prices.
587
+ */
588
+ billing_cycle_anchor: 'now' | 'unchanged' | null;
589
+ /**
590
+ * Three-letter ISO currency code (e.g., usd, eur)
591
+ */
592
+ currency: string;
593
+ /**
594
+ * Billing frequency for recurring prices: day, week, month, or year. Null for
595
+ * one-time prices.
596
+ */
597
+ interval: 'day' | 'week' | 'month' | 'year' | null;
598
+ /**
599
+ * Number of intervals between billings for recurring prices. Null for one-time
600
+ * prices.
601
+ */
602
+ interval_count: number | null;
603
+ /**
604
+ * How to handle prorations when switching plans. 'default' creates prorations,
605
+ * 'none' disables them. Null for one-time prices.
606
+ */
607
+ proration_behavior: 'default' | 'none' | null;
608
+ /**
609
+ * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
610
+ * billing period start. Null for one-time prices or to use Stripe's default.
611
+ */
612
+ proration_date: 'now' | 'start_of_period' | null;
613
+ /**
614
+ * Price type: one_time for single purchases, recurring for subscriptions
615
+ */
616
+ type: 'one_time' | 'recurring';
617
+ /**
618
+ * Price amount in the smallest currency unit (e.g., cents)
619
+ */
620
+ unit_amount: number | null;
621
+ }
622
+ /**
623
+ * Media attachment for products or variants
624
+ */
625
+ interface Media {
626
+ /**
627
+ * Type of media: image, video, or external link
628
+ */
629
+ type: 'image' | 'video' | 'external';
630
+ /**
631
+ * URL of the media resource
632
+ */
633
+ url: string;
634
+ }
635
+ /**
636
+ * A resource that can be attached to products to grant access to customers.
637
+ * Resources represent monetizable content or features in your app.
638
+ */
639
+ interface Resource {
640
+ /**
641
+ * Unique identifier for the topic subscription
642
+ */
643
+ id: string;
644
+ /**
645
+ * Whether the resource is active and grants access
646
+ */
647
+ active: boolean;
648
+ /**
649
+ * Timestamp when the resource was created
650
+ */
651
+ created: string;
652
+ /**
653
+ * Type of resource: custom_entitlement, file, content, course, or ticket
654
+ */
655
+ type: 'custom_entitlement' | 'file' | 'content' | 'course' | 'ticket';
656
+ /**
657
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
658
+ */
659
+ custom_entitlement?: Resource.CustomEntitlement | null;
660
+ }
661
+ namespace Resource {
662
+ /**
663
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
664
+ */
665
+ interface CustomEntitlement {
666
+ /**
667
+ * Unique identifier for the custom entitlement. Must not contain '.'
668
+ */
669
+ id: string;
670
+ /**
671
+ * Custom metadata for the entitlement
672
+ */
673
+ metadata?: {
674
+ [key: string]: unknown;
675
+ };
676
+ }
677
+ }
678
+ }
679
+ /**
680
+ * A product that customers can purchase. Products can be one-time purchases or
681
+ * recurring subscriptions. Attach resources to a product to grant features to
682
+ * customers.
683
+ */
684
+ export interface ProductGetResponse {
685
+ /**
686
+ * Unique identifier for the topic subscription
687
+ */
688
+ id: string;
689
+ /**
690
+ * Whether the product is available for new purchases
691
+ */
692
+ active: boolean;
693
+ /**
694
+ * Timestamp when the product was created
695
+ */
696
+ created: string;
697
+ /**
698
+ * Display name for the product (e.g., Pro, Business, Teams)
699
+ */
700
+ name: string;
701
+ /**
702
+ * Price configuration for a product. Can be one-time or recurring (subscription).
703
+ */
704
+ default_price?: ProductGetResponse.DefaultPrice | null;
705
+ /**
706
+ * Detailed description of what the product includes
707
+ */
708
+ description?: string | null;
709
+ /**
710
+ * Media attachments (images, videos) for the product
711
+ */
712
+ media?: Array<ProductGetResponse.Media>;
713
+ /**
714
+ * Custom metadata for the product
715
+ */
716
+ metadata?: {
717
+ [key: string]: unknown;
718
+ };
719
+ /**
720
+ * ID of the product group this product belongs to. Product groups define shared
721
+ * billing configuration.
722
+ */
723
+ product_group_id?: string | null;
724
+ /**
725
+ * Resources attached to this product. Customers get access to these resources when
726
+ * they purchase the product.
727
+ */
728
+ resources?: Array<ProductGetResponse.Resource>;
729
+ /**
730
+ * Tags for categorizing and filtering products
731
+ */
732
+ tags?: Array<string>;
733
+ }
734
+ export declare namespace ProductGetResponse {
735
+ /**
736
+ * Price configuration for a product. Can be one-time or recurring (subscription).
737
+ */
738
+ interface DefaultPrice {
739
+ /**
740
+ * Unique identifier for the topic subscription
741
+ */
742
+ id: string;
743
+ /**
744
+ * How to handle the billing cycle when switching plans. 'now' resets to current
745
+ * time, 'unchanged' keeps the original anchor. Null for one-time prices.
746
+ */
747
+ billing_cycle_anchor: 'now' | 'unchanged' | null;
748
+ /**
749
+ * Three-letter ISO currency code (e.g., usd, eur)
750
+ */
751
+ currency: string;
752
+ /**
753
+ * Billing frequency for recurring prices: day, week, month, or year. Null for
754
+ * one-time prices.
755
+ */
756
+ interval: 'day' | 'week' | 'month' | 'year' | null;
757
+ /**
758
+ * Number of intervals between billings for recurring prices. Null for one-time
759
+ * prices.
760
+ */
761
+ interval_count: number | null;
762
+ /**
763
+ * How to handle prorations when switching plans. 'default' creates prorations,
764
+ * 'none' disables them. Null for one-time prices.
765
+ */
766
+ proration_behavior: 'default' | 'none' | null;
767
+ /**
768
+ * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
769
+ * billing period start. Null for one-time prices or to use Stripe's default.
770
+ */
771
+ proration_date: 'now' | 'start_of_period' | null;
772
+ /**
773
+ * Price type: one_time for single purchases, recurring for subscriptions
774
+ */
775
+ type: 'one_time' | 'recurring';
776
+ /**
777
+ * Price amount in the smallest currency unit (e.g., cents)
778
+ */
779
+ unit_amount: number | null;
780
+ }
781
+ /**
782
+ * Media attachment for products or variants
783
+ */
784
+ interface Media {
785
+ /**
786
+ * Type of media: image, video, or external link
787
+ */
788
+ type: 'image' | 'video' | 'external';
789
+ /**
790
+ * URL of the media resource
791
+ */
792
+ url: string;
793
+ }
794
+ /**
795
+ * A resource that can be attached to products to grant access to customers.
796
+ * Resources represent monetizable content or features in your app.
797
+ */
798
+ interface Resource {
799
+ /**
800
+ * Unique identifier for the topic subscription
801
+ */
802
+ id: string;
803
+ /**
804
+ * Whether the resource is active and grants access
805
+ */
806
+ active: boolean;
807
+ /**
808
+ * Timestamp when the resource was created
809
+ */
810
+ created: string;
811
+ /**
812
+ * Type of resource: custom_entitlement, file, content, course, or ticket
813
+ */
814
+ type: 'custom_entitlement' | 'file' | 'content' | 'course' | 'ticket';
815
+ /**
816
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
817
+ */
818
+ custom_entitlement?: Resource.CustomEntitlement | null;
819
+ }
820
+ namespace Resource {
821
+ /**
822
+ * Custom entitlement data. Required when type is 'custom_entitlement'.
823
+ */
824
+ interface CustomEntitlement {
825
+ /**
826
+ * Unique identifier for the custom entitlement. Must not contain '.'
827
+ */
828
+ id: string;
829
+ /**
830
+ * Custom metadata for the entitlement
831
+ */
832
+ metadata?: {
833
+ [key: string]: unknown;
834
+ };
835
+ }
836
+ }
837
+ }
838
+ export interface ProductCreateParams {
839
+ /**
840
+ * Display name for the product (e.g., Pro, Business, Teams)
841
+ */
842
+ name: string;
843
+ /**
844
+ * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
845
+ * products.
846
+ */
847
+ unit_amount: number;
848
+ /**
849
+ * Optional custom ID for the product. If not provided, one will be generated.
850
+ */
851
+ id?: string;
852
+ /**
853
+ * Three-letter ISO currency code
854
+ */
855
+ currency?: string;
856
+ /**
857
+ * Detailed description of what the product includes
858
+ */
859
+ description?: string;
860
+ /**
861
+ * Billing frequency for recurring prices: day, week, month, or year. Required for
862
+ * recurring type, ignored for one_time.
863
+ */
864
+ interval?: 'day' | 'week' | 'month' | 'year';
865
+ /**
866
+ * Number of intervals between billings for recurring prices. Required for
867
+ * recurring type, ignored for one_time.
868
+ */
869
+ interval_count?: number;
870
+ /**
871
+ * Media attachments (images, videos) for the product
872
+ */
873
+ media?: Array<ProductCreateParams.Media>;
874
+ /**
875
+ * Custom metadata for the product
876
+ */
877
+ metadata?: {
878
+ [key: string]: unknown;
879
+ };
880
+ /**
881
+ * ID of the product group this product belongs to. Product groups define shared
882
+ * billing configuration.
883
+ */
884
+ product_group_id?: string;
885
+ /**
886
+ * Tags for categorizing and filtering products
887
+ */
888
+ tags?: Array<string>;
889
+ /**
890
+ * Price type: one_time for single purchases, recurring for subscriptions
891
+ */
892
+ type?: 'one_time' | 'recurring';
893
+ }
894
+ export declare namespace ProductCreateParams {
895
+ /**
896
+ * Media attachment for products or variants
897
+ */
898
+ interface Media {
899
+ /**
900
+ * Type of media: image, video, or external link
901
+ */
902
+ type: 'image' | 'video' | 'external';
903
+ /**
904
+ * URL of the media resource
905
+ */
906
+ url: string;
907
+ }
908
+ }
909
+ export interface ProductUpdateParams {
910
+ /**
911
+ * Whether the product is available for new subscriptions
912
+ */
913
+ active?: boolean;
914
+ /**
915
+ * Detailed description of what the product includes
916
+ */
917
+ description?: string;
918
+ /**
919
+ * Media attachments (images, videos) for the product
920
+ */
921
+ media?: Array<ProductUpdateParams.Media>;
922
+ /**
923
+ * Custom metadata for the product
924
+ */
925
+ metadata?: {
926
+ [key: string]: unknown;
927
+ };
928
+ /**
929
+ * Display name for the product
930
+ */
931
+ name?: string;
932
+ /**
933
+ * ID of the product group. Set to null to remove from a group.
934
+ */
935
+ product_group_id?: string | null;
936
+ /**
937
+ * Tags for categorizing and filtering products
938
+ */
939
+ tags?: Array<string>;
940
+ }
941
+ export declare namespace ProductUpdateParams {
942
+ /**
943
+ * Media attachment for products or variants
944
+ */
945
+ interface Media {
946
+ /**
947
+ * Type of media: image, video, or external link
948
+ */
949
+ type: 'image' | 'video' | 'external';
950
+ /**
951
+ * URL of the media resource
952
+ */
953
+ url: string;
954
+ }
955
+ }
956
+ export interface ProductListParams extends CursorIDPageParams {
957
+ /**
958
+ * Filter by active status
959
+ */
960
+ active?: 'true' | 'false';
961
+ }
962
+ export declare namespace Products {
963
+ export { type ProductCreateResponse as ProductCreateResponse, type ProductUpdateResponse as ProductUpdateResponse, type ProductListResponse as ProductListResponse, type ProductArchiveResponse as ProductArchiveResponse, type ProductGetResponse as ProductGetResponse, type ProductListResponsesCursorIDPage as ProductListResponsesCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
964
+ export { Resources as Resources, type ResourceListResponse as ResourceListResponse, type ResourceAttachResponse as ResourceAttachResponse, type ResourceListResponsesCursorIDPage as ResourceListResponsesCursorIDPage, type ResourceListParams as ResourceListParams, type ResourceAttachParams as ResourceAttachParams, type ResourceRemoveParams as ResourceRemoveParams, };
965
+ export { Variants as Variants, type VariantCreateResponse as VariantCreateResponse, type VariantUpdateResponse as VariantUpdateResponse, type VariantListResponse as VariantListResponse, type VariantArchiveResponse as VariantArchiveResponse, type VariantGetResponse as VariantGetResponse, type VariantListResponsesCursorIDPage as VariantListResponsesCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantArchiveParams as VariantArchiveParams, type VariantGetParams as VariantGetParams, };
966
+ }
967
+ //# sourceMappingURL=products.d.ts.map