@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,440 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../core/pagination';
6
+ import { buildHeaders } from '../../../internal/headers';
7
+ import { RequestOptions } from '../../../internal/request-options';
8
+ import { path } from '../../../internal/utils/path';
9
+
10
+ export class Coupons extends APIResource {
11
+ /**
12
+ * Creates a discount coupon with a promo code. Coupons can offer percentage or
13
+ * fixed-amount discounts and can be limited by redemption count or expiration
14
+ * date. Customers can apply coupons during checkout.
15
+ */
16
+ create(body: CouponCreateParams, options?: RequestOptions): APIPromise<CouponCreateResponse> {
17
+ return this._client.post('/v1/commerce/coupons', { body, ...options });
18
+ }
19
+
20
+ /**
21
+ * Updates an existing coupon. Use this to modify the display name or deactivate
22
+ * the coupon. Discount amounts and codes cannot be changed after creation.
23
+ */
24
+ update(
25
+ couponID: string,
26
+ body: CouponUpdateParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): APIPromise<CouponUpdateResponse> {
29
+ return this._client.patch(path`/v1/commerce/coupons/${couponID}`, { body, ...options });
30
+ }
31
+
32
+ /**
33
+ * Retrieves a paginated list of all coupons. Coupons provide discounts that
34
+ * customers can apply during checkout using a promo code.
35
+ */
36
+ list(
37
+ query: CouponListParams | null | undefined = {},
38
+ options?: RequestOptions,
39
+ ): PagePromise<CouponListResponsesCursorIDPage, CouponListResponse> {
40
+ return this._client.getAPIList('/v1/commerce/coupons', CursorIDPage<CouponListResponse>, {
41
+ query,
42
+ ...options,
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Permanently deletes a coupon. The promo code can no longer be used. Existing
48
+ * discounts applied to active subscriptions are not affected.
49
+ */
50
+ delete(couponID: string, options?: RequestOptions): APIPromise<void> {
51
+ return this._client.delete(path`/v1/commerce/coupons/${couponID}`, {
52
+ ...options,
53
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Retrieves a coupon by ID. Returns the coupon object including discount details
59
+ * and redemption statistics.
60
+ */
61
+ get(couponID: string, options?: RequestOptions): APIPromise<CouponGetResponse> {
62
+ return this._client.get(path`/v1/commerce/coupons/${couponID}`, options);
63
+ }
64
+ }
65
+
66
+ export type CouponListResponsesCursorIDPage = CursorIDPage<CouponListResponse>;
67
+
68
+ /**
69
+ * A discount coupon that customers can apply during checkout using a promo code
70
+ */
71
+ export interface CouponCreateResponse {
72
+ /**
73
+ * Unique identifier for the topic subscription
74
+ */
75
+ id: string;
76
+
77
+ /**
78
+ * Whether the coupon is currently active and can be redeemed
79
+ */
80
+ active: boolean;
81
+
82
+ /**
83
+ * The promo code customers enter to apply the discount
84
+ */
85
+ code: string;
86
+
87
+ /**
88
+ * Timestamp when the coupon was created
89
+ */
90
+ created: string;
91
+
92
+ /**
93
+ * How long the discount applies: once (first payment only), repeating (for
94
+ * duration_in_months), or forever
95
+ */
96
+ duration: 'once' | 'repeating' | 'forever';
97
+
98
+ /**
99
+ * Number of times this coupon has been successfully redeemed
100
+ */
101
+ times_redeemed: number;
102
+
103
+ /**
104
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
105
+ * exclusive with percent_off.
106
+ */
107
+ amount_off?: number | null;
108
+
109
+ /**
110
+ * Three-letter ISO currency code for amount_off discounts
111
+ */
112
+ currency?: string | null;
113
+
114
+ /**
115
+ * Number of months the discount applies when duration is 'repeating'
116
+ */
117
+ duration_in_months?: number | null;
118
+
119
+ /**
120
+ * Maximum number of times this coupon can be redeemed across all customers
121
+ */
122
+ max_redemptions?: number | null;
123
+
124
+ /**
125
+ * Display name for the coupon (shown to customers)
126
+ */
127
+ name?: string | null;
128
+
129
+ /**
130
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
131
+ */
132
+ percent_off?: number | null;
133
+
134
+ /**
135
+ * Expiration date after which the coupon can no longer be redeemed
136
+ */
137
+ redeem_by?: string | null;
138
+ }
139
+
140
+ /**
141
+ * A discount coupon that customers can apply during checkout using a promo code
142
+ */
143
+ export interface CouponUpdateResponse {
144
+ /**
145
+ * Unique identifier for the topic subscription
146
+ */
147
+ id: string;
148
+
149
+ /**
150
+ * Whether the coupon is currently active and can be redeemed
151
+ */
152
+ active: boolean;
153
+
154
+ /**
155
+ * The promo code customers enter to apply the discount
156
+ */
157
+ code: string;
158
+
159
+ /**
160
+ * Timestamp when the coupon was created
161
+ */
162
+ created: string;
163
+
164
+ /**
165
+ * How long the discount applies: once (first payment only), repeating (for
166
+ * duration_in_months), or forever
167
+ */
168
+ duration: 'once' | 'repeating' | 'forever';
169
+
170
+ /**
171
+ * Number of times this coupon has been successfully redeemed
172
+ */
173
+ times_redeemed: number;
174
+
175
+ /**
176
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
177
+ * exclusive with percent_off.
178
+ */
179
+ amount_off?: number | null;
180
+
181
+ /**
182
+ * Three-letter ISO currency code for amount_off discounts
183
+ */
184
+ currency?: string | null;
185
+
186
+ /**
187
+ * Number of months the discount applies when duration is 'repeating'
188
+ */
189
+ duration_in_months?: number | null;
190
+
191
+ /**
192
+ * Maximum number of times this coupon can be redeemed across all customers
193
+ */
194
+ max_redemptions?: number | null;
195
+
196
+ /**
197
+ * Display name for the coupon (shown to customers)
198
+ */
199
+ name?: string | null;
200
+
201
+ /**
202
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
203
+ */
204
+ percent_off?: number | null;
205
+
206
+ /**
207
+ * Expiration date after which the coupon can no longer be redeemed
208
+ */
209
+ redeem_by?: string | null;
210
+ }
211
+
212
+ /**
213
+ * A discount coupon that customers can apply during checkout using a promo code
214
+ */
215
+ export interface CouponListResponse {
216
+ /**
217
+ * Unique identifier for the topic subscription
218
+ */
219
+ id: string;
220
+
221
+ /**
222
+ * Whether the coupon is currently active and can be redeemed
223
+ */
224
+ active: boolean;
225
+
226
+ /**
227
+ * The promo code customers enter to apply the discount
228
+ */
229
+ code: string;
230
+
231
+ /**
232
+ * Timestamp when the coupon was created
233
+ */
234
+ created: string;
235
+
236
+ /**
237
+ * How long the discount applies: once (first payment only), repeating (for
238
+ * duration_in_months), or forever
239
+ */
240
+ duration: 'once' | 'repeating' | 'forever';
241
+
242
+ /**
243
+ * Number of times this coupon has been successfully redeemed
244
+ */
245
+ times_redeemed: number;
246
+
247
+ /**
248
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
249
+ * exclusive with percent_off.
250
+ */
251
+ amount_off?: number | null;
252
+
253
+ /**
254
+ * Three-letter ISO currency code for amount_off discounts
255
+ */
256
+ currency?: string | null;
257
+
258
+ /**
259
+ * Number of months the discount applies when duration is 'repeating'
260
+ */
261
+ duration_in_months?: number | null;
262
+
263
+ /**
264
+ * Maximum number of times this coupon can be redeemed across all customers
265
+ */
266
+ max_redemptions?: number | null;
267
+
268
+ /**
269
+ * Display name for the coupon (shown to customers)
270
+ */
271
+ name?: string | null;
272
+
273
+ /**
274
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
275
+ */
276
+ percent_off?: number | null;
277
+
278
+ /**
279
+ * Expiration date after which the coupon can no longer be redeemed
280
+ */
281
+ redeem_by?: string | null;
282
+ }
283
+
284
+ /**
285
+ * A discount coupon that customers can apply during checkout using a promo code
286
+ */
287
+ export interface CouponGetResponse {
288
+ /**
289
+ * Unique identifier for the topic subscription
290
+ */
291
+ id: string;
292
+
293
+ /**
294
+ * Whether the coupon is currently active and can be redeemed
295
+ */
296
+ active: boolean;
297
+
298
+ /**
299
+ * The promo code customers enter to apply the discount
300
+ */
301
+ code: string;
302
+
303
+ /**
304
+ * Timestamp when the coupon was created
305
+ */
306
+ created: string;
307
+
308
+ /**
309
+ * How long the discount applies: once (first payment only), repeating (for
310
+ * duration_in_months), or forever
311
+ */
312
+ duration: 'once' | 'repeating' | 'forever';
313
+
314
+ /**
315
+ * Number of times this coupon has been successfully redeemed
316
+ */
317
+ times_redeemed: number;
318
+
319
+ /**
320
+ * Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
321
+ * exclusive with percent_off.
322
+ */
323
+ amount_off?: number | null;
324
+
325
+ /**
326
+ * Three-letter ISO currency code for amount_off discounts
327
+ */
328
+ currency?: string | null;
329
+
330
+ /**
331
+ * Number of months the discount applies when duration is 'repeating'
332
+ */
333
+ duration_in_months?: number | null;
334
+
335
+ /**
336
+ * Maximum number of times this coupon can be redeemed across all customers
337
+ */
338
+ max_redemptions?: number | null;
339
+
340
+ /**
341
+ * Display name for the coupon (shown to customers)
342
+ */
343
+ name?: string | null;
344
+
345
+ /**
346
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
347
+ */
348
+ percent_off?: number | null;
349
+
350
+ /**
351
+ * Expiration date after which the coupon can no longer be redeemed
352
+ */
353
+ redeem_by?: string | null;
354
+ }
355
+
356
+ export interface CouponCreateParams {
357
+ /**
358
+ * The promo code customers will enter to apply the discount
359
+ */
360
+ code: string;
361
+
362
+ /**
363
+ * Optional custom ID for the coupon. If not provided, one will be generated.
364
+ */
365
+ id?: string;
366
+
367
+ /**
368
+ * Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
369
+ * with percent_off.
370
+ */
371
+ amount_off?: number;
372
+
373
+ /**
374
+ * Three-letter ISO currency code for amount_off discounts
375
+ */
376
+ currency?: string;
377
+
378
+ /**
379
+ * How long the discount applies: once (first payment only), repeating (for
380
+ * duration_in_months), or forever
381
+ */
382
+ duration?: 'once' | 'repeating' | 'forever';
383
+
384
+ /**
385
+ * Number of months the discount applies when duration is 'repeating'
386
+ */
387
+ duration_in_months?: number;
388
+
389
+ /**
390
+ * Maximum number of times this coupon can be redeemed
391
+ */
392
+ max_redemptions?: number;
393
+
394
+ /**
395
+ * Display name for the coupon (shown to customers)
396
+ */
397
+ name?: string;
398
+
399
+ /**
400
+ * Percentage discount (1-100). Mutually exclusive with amount_off.
401
+ */
402
+ percent_off?: number;
403
+
404
+ /**
405
+ * Expiration date after which the coupon can no longer be redeemed
406
+ */
407
+ redeem_by?: string;
408
+ }
409
+
410
+ export interface CouponUpdateParams {
411
+ /**
412
+ * Whether the coupon is active and can be redeemed
413
+ */
414
+ active?: boolean;
415
+
416
+ /**
417
+ * Display name for the coupon
418
+ */
419
+ name?: string;
420
+ }
421
+
422
+ export interface CouponListParams extends CursorIDPageParams {
423
+ /**
424
+ * Filter by active status
425
+ */
426
+ active?: boolean;
427
+ }
428
+
429
+ export declare namespace Coupons {
430
+ export {
431
+ type CouponCreateResponse as CouponCreateResponse,
432
+ type CouponUpdateResponse as CouponUpdateResponse,
433
+ type CouponListResponse as CouponListResponse,
434
+ type CouponGetResponse as CouponGetResponse,
435
+ type CouponListResponsesCursorIDPage as CouponListResponsesCursorIDPage,
436
+ type CouponCreateParams as CouponCreateParams,
437
+ type CouponUpdateParams as CouponUpdateParams,
438
+ type CouponListParams as CouponListParams,
439
+ };
440
+ }