dodopayments 2.32.0 → 2.32.2

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 (273) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/bin/migration-config.json +17 -17
  3. package/client.d.mts +15 -15
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +15 -15
  6. package/client.d.ts.map +1 -1
  7. package/package.json +1 -1
  8. package/resources/addons.d.mts +4 -4
  9. package/resources/addons.d.mts.map +1 -1
  10. package/resources/addons.d.ts +4 -4
  11. package/resources/addons.d.ts.map +1 -1
  12. package/resources/addons.js +6 -6
  13. package/resources/addons.js.map +1 -1
  14. package/resources/addons.mjs +6 -6
  15. package/resources/addons.mjs.map +1 -1
  16. package/resources/brands.d.mts +1 -1
  17. package/resources/brands.d.mts.map +1 -1
  18. package/resources/brands.d.ts +1 -1
  19. package/resources/brands.d.ts.map +1 -1
  20. package/resources/brands.js +3 -3
  21. package/resources/brands.js.map +1 -1
  22. package/resources/brands.mjs +3 -3
  23. package/resources/brands.mjs.map +1 -1
  24. package/resources/credit-entitlements/balances.d.mts +69 -69
  25. package/resources/credit-entitlements/balances.d.mts.map +1 -1
  26. package/resources/credit-entitlements/balances.d.ts +69 -69
  27. package/resources/credit-entitlements/balances.d.ts.map +1 -1
  28. package/resources/credit-entitlements/balances.js +41 -41
  29. package/resources/credit-entitlements/balances.js.map +1 -1
  30. package/resources/credit-entitlements/balances.mjs +41 -41
  31. package/resources/credit-entitlements/balances.mjs.map +1 -1
  32. package/resources/credit-entitlements/credit-entitlements.d.mts +38 -38
  33. package/resources/credit-entitlements/credit-entitlements.d.mts.map +1 -1
  34. package/resources/credit-entitlements/credit-entitlements.d.ts +38 -38
  35. package/resources/credit-entitlements/credit-entitlements.d.ts.map +1 -1
  36. package/resources/credit-entitlements/credit-entitlements.js +40 -40
  37. package/resources/credit-entitlements/credit-entitlements.js.map +1 -1
  38. package/resources/credit-entitlements/credit-entitlements.mjs +40 -40
  39. package/resources/credit-entitlements/credit-entitlements.mjs.map +1 -1
  40. package/resources/credit-entitlements/index.d.mts +2 -2
  41. package/resources/credit-entitlements/index.d.mts.map +1 -1
  42. package/resources/credit-entitlements/index.d.ts +2 -2
  43. package/resources/credit-entitlements/index.d.ts.map +1 -1
  44. package/resources/customers/customers.d.mts +23 -23
  45. package/resources/customers/customers.d.mts.map +1 -1
  46. package/resources/customers/customers.d.ts +23 -23
  47. package/resources/customers/customers.d.ts.map +1 -1
  48. package/resources/customers/customers.js +16 -16
  49. package/resources/customers/customers.js.map +1 -1
  50. package/resources/customers/customers.mjs +16 -16
  51. package/resources/customers/customers.mjs.map +1 -1
  52. package/resources/customers/index.d.mts +1 -1
  53. package/resources/customers/index.d.mts.map +1 -1
  54. package/resources/customers/index.d.ts +1 -1
  55. package/resources/customers/index.d.ts.map +1 -1
  56. package/resources/customers/wallets/index.d.mts +1 -1
  57. package/resources/customers/wallets/index.d.mts.map +1 -1
  58. package/resources/customers/wallets/index.d.ts +1 -1
  59. package/resources/customers/wallets/index.d.ts.map +1 -1
  60. package/resources/customers/wallets/ledger-entries.d.mts +8 -8
  61. package/resources/customers/wallets/ledger-entries.d.mts.map +1 -1
  62. package/resources/customers/wallets/ledger-entries.d.ts +8 -8
  63. package/resources/customers/wallets/ledger-entries.d.ts.map +1 -1
  64. package/resources/customers/wallets/ledger-entries.js +3 -3
  65. package/resources/customers/wallets/ledger-entries.js.map +1 -1
  66. package/resources/customers/wallets/ledger-entries.mjs +3 -3
  67. package/resources/customers/wallets/ledger-entries.mjs.map +1 -1
  68. package/resources/customers/wallets/wallets.d.mts +1 -1
  69. package/resources/customers/wallets/wallets.d.mts.map +1 -1
  70. package/resources/customers/wallets/wallets.d.ts +1 -1
  71. package/resources/customers/wallets/wallets.d.ts.map +1 -1
  72. package/resources/discounts.d.mts +27 -27
  73. package/resources/discounts.d.mts.map +1 -1
  74. package/resources/discounts.d.ts +27 -27
  75. package/resources/discounts.d.ts.map +1 -1
  76. package/resources/discounts.js +15 -15
  77. package/resources/discounts.js.map +1 -1
  78. package/resources/discounts.mjs +15 -15
  79. package/resources/discounts.mjs.map +1 -1
  80. package/resources/disputes.d.mts +1 -1
  81. package/resources/disputes.d.mts.map +1 -1
  82. package/resources/disputes.d.ts +1 -1
  83. package/resources/disputes.d.ts.map +1 -1
  84. package/resources/disputes.js +3 -3
  85. package/resources/disputes.js.map +1 -1
  86. package/resources/disputes.mjs +3 -3
  87. package/resources/disputes.mjs.map +1 -1
  88. package/resources/entitlements/entitlements.d.mts +15 -15
  89. package/resources/entitlements/entitlements.d.mts.map +1 -1
  90. package/resources/entitlements/entitlements.d.ts +15 -15
  91. package/resources/entitlements/entitlements.d.ts.map +1 -1
  92. package/resources/entitlements/entitlements.js +15 -15
  93. package/resources/entitlements/entitlements.js.map +1 -1
  94. package/resources/entitlements/entitlements.mjs +15 -15
  95. package/resources/entitlements/entitlements.mjs.map +1 -1
  96. package/resources/entitlements/files.d.mts +4 -4
  97. package/resources/entitlements/files.d.mts.map +1 -1
  98. package/resources/entitlements/files.d.ts +4 -4
  99. package/resources/entitlements/files.d.ts.map +1 -1
  100. package/resources/entitlements/files.js +6 -6
  101. package/resources/entitlements/files.js.map +1 -1
  102. package/resources/entitlements/files.mjs +6 -6
  103. package/resources/entitlements/files.mjs.map +1 -1
  104. package/resources/entitlements/index.d.mts +1 -1
  105. package/resources/entitlements/index.d.mts.map +1 -1
  106. package/resources/entitlements/index.d.ts +1 -1
  107. package/resources/entitlements/index.d.ts.map +1 -1
  108. package/resources/index.d.mts +15 -15
  109. package/resources/index.d.mts.map +1 -1
  110. package/resources/index.d.ts +15 -15
  111. package/resources/index.d.ts.map +1 -1
  112. package/resources/invoices/payments.d.mts +1 -1
  113. package/resources/invoices/payments.d.ts +1 -1
  114. package/resources/invoices/payments.js +4 -4
  115. package/resources/invoices/payments.mjs +4 -4
  116. package/resources/license-key-instances.d.mts +14 -14
  117. package/resources/license-key-instances.d.mts.map +1 -1
  118. package/resources/license-key-instances.d.ts +14 -14
  119. package/resources/license-key-instances.d.ts.map +1 -1
  120. package/resources/license-key-instances.js +12 -12
  121. package/resources/license-key-instances.js.map +1 -1
  122. package/resources/license-key-instances.mjs +12 -12
  123. package/resources/license-key-instances.mjs.map +1 -1
  124. package/resources/license-keys.d.mts +38 -38
  125. package/resources/license-keys.d.mts.map +1 -1
  126. package/resources/license-keys.d.ts +38 -38
  127. package/resources/license-keys.d.ts.map +1 -1
  128. package/resources/license-keys.js +16 -16
  129. package/resources/license-keys.js.map +1 -1
  130. package/resources/license-keys.mjs +16 -16
  131. package/resources/license-keys.mjs.map +1 -1
  132. package/resources/meters.d.mts +8 -8
  133. package/resources/meters.d.mts.map +1 -1
  134. package/resources/meters.d.ts +8 -8
  135. package/resources/meters.d.ts.map +1 -1
  136. package/resources/meters.js +3 -3
  137. package/resources/meters.js.map +1 -1
  138. package/resources/meters.mjs +3 -3
  139. package/resources/meters.mjs.map +1 -1
  140. package/resources/payments.d.mts +32 -32
  141. package/resources/payments.d.mts.map +1 -1
  142. package/resources/payments.d.ts +32 -32
  143. package/resources/payments.d.ts.map +1 -1
  144. package/resources/payments.js +6 -6
  145. package/resources/payments.js.map +1 -1
  146. package/resources/payments.mjs +6 -6
  147. package/resources/payments.mjs.map +1 -1
  148. package/resources/product-collections/groups/groups.d.mts +9 -9
  149. package/resources/product-collections/groups/groups.d.mts.map +1 -1
  150. package/resources/product-collections/groups/groups.d.ts +9 -9
  151. package/resources/product-collections/groups/groups.d.ts.map +1 -1
  152. package/resources/product-collections/groups/groups.js +7 -7
  153. package/resources/product-collections/groups/groups.js.map +1 -1
  154. package/resources/product-collections/groups/groups.mjs +7 -7
  155. package/resources/product-collections/groups/groups.mjs.map +1 -1
  156. package/resources/product-collections/groups/index.d.mts +2 -2
  157. package/resources/product-collections/groups/index.d.ts +2 -2
  158. package/resources/product-collections/groups/items.d.mts +12 -12
  159. package/resources/product-collections/groups/items.d.mts.map +1 -1
  160. package/resources/product-collections/groups/items.d.ts +12 -12
  161. package/resources/product-collections/groups/items.d.ts.map +1 -1
  162. package/resources/product-collections/groups/items.js +7 -7
  163. package/resources/product-collections/groups/items.js.map +1 -1
  164. package/resources/product-collections/groups/items.mjs +7 -7
  165. package/resources/product-collections/groups/items.mjs.map +1 -1
  166. package/resources/product-collections/index.d.mts +2 -2
  167. package/resources/product-collections/index.d.mts.map +1 -1
  168. package/resources/product-collections/index.d.ts +2 -2
  169. package/resources/product-collections/index.d.ts.map +1 -1
  170. package/resources/product-collections/product-collections.d.mts +15 -15
  171. package/resources/product-collections/product-collections.d.mts.map +1 -1
  172. package/resources/product-collections/product-collections.d.ts +15 -15
  173. package/resources/product-collections/product-collections.d.ts.map +1 -1
  174. package/resources/product-collections/product-collections.js +11 -11
  175. package/resources/product-collections/product-collections.js.map +1 -1
  176. package/resources/product-collections/product-collections.mjs +11 -11
  177. package/resources/product-collections/product-collections.mjs.map +1 -1
  178. package/resources/products/index.d.mts +2 -2
  179. package/resources/products/index.d.mts.map +1 -1
  180. package/resources/products/index.d.ts +2 -2
  181. package/resources/products/index.d.ts.map +1 -1
  182. package/resources/products/products.d.mts +21 -21
  183. package/resources/products/products.d.mts.map +1 -1
  184. package/resources/products/products.d.ts +21 -21
  185. package/resources/products/products.d.ts.map +1 -1
  186. package/resources/products/products.js +6 -6
  187. package/resources/products/products.js.map +1 -1
  188. package/resources/products/products.mjs +6 -6
  189. package/resources/products/products.mjs.map +1 -1
  190. package/resources/products/short-links.d.mts +11 -11
  191. package/resources/products/short-links.d.mts.map +1 -1
  192. package/resources/products/short-links.d.ts +11 -11
  193. package/resources/products/short-links.d.ts.map +1 -1
  194. package/resources/products/short-links.js +6 -6
  195. package/resources/products/short-links.js.map +1 -1
  196. package/resources/products/short-links.mjs +6 -6
  197. package/resources/products/short-links.mjs.map +1 -1
  198. package/resources/refunds.d.mts +24 -24
  199. package/resources/refunds.d.mts.map +1 -1
  200. package/resources/refunds.d.ts +24 -24
  201. package/resources/refunds.d.ts.map +1 -1
  202. package/resources/refunds.js +6 -6
  203. package/resources/refunds.js.map +1 -1
  204. package/resources/refunds.mjs +6 -6
  205. package/resources/refunds.mjs.map +1 -1
  206. package/resources/subscriptions.d.mts +86 -86
  207. package/resources/subscriptions.d.mts.map +1 -1
  208. package/resources/subscriptions.d.ts +86 -86
  209. package/resources/subscriptions.d.ts.map +1 -1
  210. package/resources/subscriptions.js +23 -23
  211. package/resources/subscriptions.js.map +1 -1
  212. package/resources/subscriptions.mjs +23 -23
  213. package/resources/subscriptions.mjs.map +1 -1
  214. package/resources/usage-events.d.mts +61 -61
  215. package/resources/usage-events.d.mts.map +1 -1
  216. package/resources/usage-events.d.ts +61 -61
  217. package/resources/usage-events.d.ts.map +1 -1
  218. package/resources/usage-events.js +56 -56
  219. package/resources/usage-events.js.map +1 -1
  220. package/resources/usage-events.mjs +56 -56
  221. package/resources/usage-events.mjs.map +1 -1
  222. package/resources/webhooks/index.d.mts +1 -1
  223. package/resources/webhooks/index.d.mts.map +1 -1
  224. package/resources/webhooks/index.d.ts +1 -1
  225. package/resources/webhooks/index.d.ts.map +1 -1
  226. package/resources/webhooks/webhooks.d.mts +12 -12
  227. package/resources/webhooks/webhooks.d.mts.map +1 -1
  228. package/resources/webhooks/webhooks.d.ts +12 -12
  229. package/resources/webhooks/webhooks.d.ts.map +1 -1
  230. package/resources/webhooks/webhooks.js +15 -15
  231. package/resources/webhooks/webhooks.js.map +1 -1
  232. package/resources/webhooks/webhooks.mjs +15 -15
  233. package/resources/webhooks/webhooks.mjs.map +1 -1
  234. package/src/client.ts +18 -18
  235. package/src/resources/addons.ts +13 -13
  236. package/src/resources/brands.ts +4 -4
  237. package/src/resources/credit-entitlements/balances.ts +91 -91
  238. package/src/resources/credit-entitlements/credit-entitlements.ts +55 -55
  239. package/src/resources/credit-entitlements/index.ts +3 -3
  240. package/src/resources/customers/customers.ts +49 -49
  241. package/src/resources/customers/index.ts +1 -1
  242. package/src/resources/customers/wallets/index.ts +1 -1
  243. package/src/resources/customers/wallets/ledger-entries.ts +16 -16
  244. package/src/resources/customers/wallets/wallets.ts +1 -1
  245. package/src/resources/discounts.ts +43 -43
  246. package/src/resources/disputes.ts +4 -4
  247. package/src/resources/entitlements/entitlements.ts +36 -36
  248. package/src/resources/entitlements/files.ts +7 -7
  249. package/src/resources/entitlements/index.ts +1 -1
  250. package/src/resources/index.ts +18 -18
  251. package/src/resources/invoices/payments.ts +4 -4
  252. package/src/resources/license-key-instances.ts +25 -25
  253. package/src/resources/license-keys.ts +48 -48
  254. package/src/resources/meters.ts +15 -15
  255. package/src/resources/payments.ts +59 -59
  256. package/src/resources/product-collections/groups/groups.ts +16 -16
  257. package/src/resources/product-collections/groups/index.ts +2 -2
  258. package/src/resources/product-collections/groups/items.ts +19 -19
  259. package/src/resources/product-collections/index.ts +2 -2
  260. package/src/resources/product-collections/product-collections.ts +32 -32
  261. package/src/resources/products/index.ts +2 -2
  262. package/src/resources/products/products.ts +33 -33
  263. package/src/resources/products/short-links.ts +20 -20
  264. package/src/resources/refunds.ts +36 -36
  265. package/src/resources/subscriptions.ts +130 -130
  266. package/src/resources/usage-events.ts +64 -64
  267. package/src/resources/webhooks/index.ts +1 -1
  268. package/src/resources/webhooks/webhooks.ts +24 -24
  269. package/src/version.ts +1 -1
  270. package/version.d.mts +1 -1
  271. package/version.d.ts +1 -1
  272. package/version.js +1 -1
  273. package/version.mjs +1 -1
@@ -12,17 +12,16 @@ import { path } from '../internal/utils/path';
12
12
 
13
13
  export class LicenseKeys extends APIResource {
14
14
  /**
15
- * @example
16
- * ```ts
17
- * const licenseKey = await client.licenseKeys.create({
18
- * customer_id: 'customer_id',
19
- * key: 'key',
20
- * product_id: 'product_id',
21
- * });
22
- * ```
15
+ * @deprecated
23
16
  */
24
- create(body: LicenseKeyCreateParams, options?: RequestOptions): APIPromise<LicenseKey> {
25
- return this._client.post('/license_keys', { body, ...options });
17
+ list(
18
+ query: LicenseKeyListParams | null | undefined = {},
19
+ options?: RequestOptions,
20
+ ): PagePromise<LicenseKeysDefaultPageNumberPagination, LicenseKey> {
21
+ return this._client.getAPIList('/license_keys', DefaultPageNumberPagination<LicenseKey>, {
22
+ query,
23
+ ...options,
24
+ });
26
25
  }
27
26
 
28
27
  /**
@@ -40,16 +39,17 @@ export class LicenseKeys extends APIResource {
40
39
  }
41
40
 
42
41
  /**
43
- * @deprecated
42
+ * @example
43
+ * ```ts
44
+ * const licenseKey = await client.licenseKeys.create({
45
+ * customer_id: 'customer_id',
46
+ * key: 'key',
47
+ * product_id: 'product_id',
48
+ * });
49
+ * ```
44
50
  */
45
- list(
46
- query: LicenseKeyListParams | null | undefined = {},
47
- options?: RequestOptions,
48
- ): PagePromise<LicenseKeysDefaultPageNumberPagination, LicenseKey> {
49
- return this._client.getAPIList('/license_keys', DefaultPageNumberPagination<LicenseKey>, {
50
- query,
51
- ...options,
52
- });
51
+ create(body: LicenseKeyCreateParams, options?: RequestOptions): APIPromise<LicenseKey> {
52
+ return this._client.post('/license_keys', { body, ...options });
53
53
  }
54
54
  }
55
55
 
@@ -126,31 +126,36 @@ export interface LicenseKey {
126
126
 
127
127
  export type LicenseKeyStatus = 'active' | 'expired' | 'disabled';
128
128
 
129
- export interface LicenseKeyCreateParams {
129
+ export interface LicenseKeyListParams extends DefaultPageNumberPaginationParams {
130
130
  /**
131
- * The customer this license key belongs to.
131
+ * Filter license keys created on or after this timestamp
132
132
  */
133
- customer_id: string;
133
+ created_at_gte?: string;
134
134
 
135
135
  /**
136
- * The license key string to import.
136
+ * Filter license keys created on or before this timestamp
137
137
  */
138
- key: string;
138
+ created_at_lte?: string;
139
139
 
140
140
  /**
141
- * The product this license key is for.
141
+ * Filter by customer ID
142
142
  */
143
- product_id: string;
143
+ customer_id?: string;
144
144
 
145
145
  /**
146
- * Maximum number of activations allowed. Null means unlimited.
146
+ * Filter by product ID
147
147
  */
148
- activations_limit?: number | null;
148
+ product_id?: string;
149
149
 
150
150
  /**
151
- * Expiration timestamp. Null means the key never expires.
151
+ * Filter by license key source
152
152
  */
153
- expires_at?: string | null;
153
+ source?: 'auto' | 'import';
154
+
155
+ /**
156
+ * Filter by license key status
157
+ */
158
+ status?: 'active' | 'expired' | 'disabled';
154
159
  }
155
160
 
156
161
  export interface LicenseKeyUpdateParams {
@@ -173,36 +178,31 @@ export interface LicenseKeyUpdateParams {
173
178
  expires_at?: string | null;
174
179
  }
175
180
 
176
- export interface LicenseKeyListParams extends DefaultPageNumberPaginationParams {
177
- /**
178
- * Filter license keys created on or after this timestamp
179
- */
180
- created_at_gte?: string;
181
-
181
+ export interface LicenseKeyCreateParams {
182
182
  /**
183
- * Filter license keys created on or before this timestamp
183
+ * The customer this license key belongs to.
184
184
  */
185
- created_at_lte?: string;
185
+ customer_id: string;
186
186
 
187
187
  /**
188
- * Filter by customer ID
188
+ * The license key string to import.
189
189
  */
190
- customer_id?: string;
190
+ key: string;
191
191
 
192
192
  /**
193
- * Filter by product ID
193
+ * The product this license key is for.
194
194
  */
195
- product_id?: string;
195
+ product_id: string;
196
196
 
197
197
  /**
198
- * Filter by license key source
198
+ * Maximum number of activations allowed. Null means unlimited.
199
199
  */
200
- source?: 'auto' | 'import';
200
+ activations_limit?: number | null;
201
201
 
202
202
  /**
203
- * Filter by license key status
203
+ * Expiration timestamp. Null means the key never expires.
204
204
  */
205
- status?: 'active' | 'expired' | 'disabled';
205
+ expires_at?: string | null;
206
206
  }
207
207
 
208
208
  export declare namespace LicenseKeys {
@@ -210,8 +210,8 @@ export declare namespace LicenseKeys {
210
210
  type LicenseKey as LicenseKey,
211
211
  type LicenseKeyStatus as LicenseKeyStatus,
212
212
  type LicenseKeysDefaultPageNumberPagination as LicenseKeysDefaultPageNumberPagination,
213
- type LicenseKeyCreateParams as LicenseKeyCreateParams,
214
- type LicenseKeyUpdateParams as LicenseKeyUpdateParams,
215
213
  type LicenseKeyListParams as LicenseKeyListParams,
214
+ type LicenseKeyUpdateParams as LicenseKeyUpdateParams,
215
+ type LicenseKeyCreateParams as LicenseKeyCreateParams,
216
216
  };
217
217
  }
@@ -13,6 +13,13 @@ import { RequestOptions } from '../internal/request-options';
13
13
  import { path } from '../internal/utils/path';
14
14
 
15
15
  export class Meters extends APIResource {
16
+ list(
17
+ query: MeterListParams | null | undefined = {},
18
+ options?: RequestOptions,
19
+ ): PagePromise<MetersDefaultPageNumberPagination, Meter> {
20
+ return this._client.getAPIList('/meters', DefaultPageNumberPagination<Meter>, { query, ...options });
21
+ }
22
+
16
23
  create(body: MeterCreateParams, options?: RequestOptions): APIPromise<Meter> {
17
24
  return this._client.post('/meters', { body, ...options });
18
25
  }
@@ -21,13 +28,6 @@ export class Meters extends APIResource {
21
28
  return this._client.get(path`/meters/${id}`, options);
22
29
  }
23
30
 
24
- list(
25
- query: MeterListParams | null | undefined = {},
26
- options?: RequestOptions,
27
- ): PagePromise<MetersDefaultPageNumberPagination, Meter> {
28
- return this._client.getAPIList('/meters', DefaultPageNumberPagination<Meter>, { query, ...options });
29
- }
30
-
31
31
  archive(id: string, options?: RequestOptions): APIPromise<void> {
32
32
  return this._client.delete(path`/meters/${id}`, {
33
33
  ...options,
@@ -146,6 +146,13 @@ export interface MeterFilter {
146
146
  conjunction: Conjunction;
147
147
  }
148
148
 
149
+ export interface MeterListParams extends DefaultPageNumberPaginationParams {
150
+ /**
151
+ * List archived meters
152
+ */
153
+ archived?: boolean;
154
+ }
155
+
149
156
  export interface MeterCreateParams {
150
157
  /**
151
158
  * Aggregation configuration for the meter
@@ -178,13 +185,6 @@ export interface MeterCreateParams {
178
185
  filter?: MeterFilter | null;
179
186
  }
180
187
 
181
- export interface MeterListParams extends DefaultPageNumberPaginationParams {
182
- /**
183
- * List archived meters
184
- */
185
- archived?: boolean;
186
- }
187
-
188
188
  export declare namespace Meters {
189
189
  export {
190
190
  type Conjunction as Conjunction,
@@ -194,7 +194,7 @@ export declare namespace Meters {
194
194
  type MeterAggregation as MeterAggregation,
195
195
  type MeterFilter as MeterFilter,
196
196
  type MetersDefaultPageNumberPagination as MetersDefaultPageNumberPagination,
197
- type MeterCreateParams as MeterCreateParams,
198
197
  type MeterListParams as MeterListParams,
198
+ type MeterCreateParams as MeterCreateParams,
199
199
  };
200
200
  }
@@ -15,6 +15,16 @@ import { RequestOptions } from '../internal/request-options';
15
15
  import { path } from '../internal/utils/path';
16
16
 
17
17
  export class Payments extends APIResource {
18
+ list(
19
+ query: PaymentListParams | null | undefined = {},
20
+ options?: RequestOptions,
21
+ ): PagePromise<PaymentListResponsesDefaultPageNumberPagination, PaymentListResponse> {
22
+ return this._client.getAPIList('/payments', DefaultPageNumberPagination<PaymentListResponse>, {
23
+ query,
24
+ ...options,
25
+ });
26
+ }
27
+
18
28
  /**
19
29
  * @deprecated
20
30
  */
@@ -26,16 +36,6 @@ export class Payments extends APIResource {
26
36
  return this._client.get(path`/payments/${paymentID}`, options);
27
37
  }
28
38
 
29
- list(
30
- query: PaymentListParams | null | undefined = {},
31
- options?: RequestOptions,
32
- ): PagePromise<PaymentListResponsesDefaultPageNumberPagination, PaymentListResponse> {
33
- return this._client.getAPIList('/payments', DefaultPageNumberPagination<PaymentListResponse>, {
34
- query,
35
- ...options,
36
- });
37
- }
38
-
39
39
  retrieveLineItems(
40
40
  paymentID: string,
41
41
  options?: RequestOptions,
@@ -670,6 +670,54 @@ export namespace PaymentRetrieveLineItemsResponse {
670
670
  }
671
671
  }
672
672
 
673
+ export interface PaymentListParams extends DefaultPageNumberPaginationParams {
674
+ /**
675
+ * filter by Brand id
676
+ */
677
+ brand_id?: string;
678
+
679
+ /**
680
+ * Get events after this created time
681
+ */
682
+ created_at_gte?: string;
683
+
684
+ /**
685
+ * Get events created before this time
686
+ */
687
+ created_at_lte?: string;
688
+
689
+ /**
690
+ * Filter by customer id
691
+ */
692
+ customer_id?: string;
693
+
694
+ /**
695
+ * Filter by product id
696
+ */
697
+ product_id?: string;
698
+
699
+ /**
700
+ * Filter by status
701
+ */
702
+ status?:
703
+ | 'succeeded'
704
+ | 'failed'
705
+ | 'cancelled'
706
+ | 'processing'
707
+ | 'requires_customer_action'
708
+ | 'requires_merchant_action'
709
+ | 'requires_payment_method'
710
+ | 'requires_confirmation'
711
+ | 'requires_capture'
712
+ | 'partially_captured'
713
+ | 'partially_captured_and_capturable';
714
+
715
+ /**
716
+ * Filter by subscription id
717
+ */
718
+ subscription_id?: string;
719
+ }
720
+
673
721
  export interface PaymentCreateParams {
674
722
  /**
675
723
  * Billing address details for the payment
@@ -785,54 +833,6 @@ export interface PaymentCreateParams {
785
833
  tax_id?: string | null;
786
834
  }
787
835
 
788
- export interface PaymentListParams extends DefaultPageNumberPaginationParams {
789
- /**
790
- * filter by Brand id
791
- */
792
- brand_id?: string;
793
-
794
- /**
795
- * Get events after this created time
796
- */
797
- created_at_gte?: string;
798
-
799
- /**
800
- * Get events created before this time
801
- */
802
- created_at_lte?: string;
803
-
804
- /**
805
- * Filter by customer id
806
- */
807
- customer_id?: string;
808
-
809
- /**
810
- * Filter by product id
811
- */
812
- product_id?: string;
813
-
814
- /**
815
- * Filter by status
816
- */
817
- status?:
818
- | 'succeeded'
819
- | 'failed'
820
- | 'cancelled'
821
- | 'processing'
822
- | 'requires_customer_action'
823
- | 'requires_merchant_action'
824
- | 'requires_payment_method'
825
- | 'requires_confirmation'
826
- | 'requires_capture'
827
- | 'partially_captured'
828
- | 'partially_captured_and_capturable';
829
-
830
- /**
831
- * Filter by subscription id
832
- */
833
- subscription_id?: string;
834
- }
835
-
836
836
  export declare namespace Payments {
837
837
  export {
838
838
  type AttachExistingCustomer as AttachExistingCustomer,
@@ -852,7 +852,7 @@ export declare namespace Payments {
852
852
  type PaymentListResponse as PaymentListResponse,
853
853
  type PaymentRetrieveLineItemsResponse as PaymentRetrieveLineItemsResponse,
854
854
  type PaymentListResponsesDefaultPageNumberPagination as PaymentListResponsesDefaultPageNumberPagination,
855
- type PaymentCreateParams as PaymentCreateParams,
856
855
  type PaymentListParams as PaymentListParams,
856
+ type PaymentCreateParams as PaymentCreateParams,
857
857
  };
858
858
  }
@@ -26,18 +26,18 @@ export class Groups extends APIResource {
26
26
  return this._client.post(path`/product-collections/${id}/groups`, { body, ...options });
27
27
  }
28
28
 
29
- update(groupID: string, params: GroupUpdateParams, options?: RequestOptions): APIPromise<void> {
30
- const { id, ...body } = params;
31
- return this._client.patch(path`/product-collections/${id}/groups/${groupID}`, {
32
- body,
29
+ delete(groupID: string, params: GroupDeleteParams, options?: RequestOptions): APIPromise<void> {
30
+ const { id } = params;
31
+ return this._client.delete(path`/product-collections/${id}/groups/${groupID}`, {
33
32
  ...options,
34
33
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
34
  });
36
35
  }
37
36
 
38
- delete(groupID: string, params: GroupDeleteParams, options?: RequestOptions): APIPromise<void> {
39
- const { id } = params;
40
- return this._client.delete(path`/product-collections/${id}/groups/${groupID}`, {
37
+ update(groupID: string, params: GroupUpdateParams, options?: RequestOptions): APIPromise<void> {
38
+ const { id, ...body } = params;
39
+ return this._client.patch(path`/product-collections/${id}/groups/${groupID}`, {
40
+ body,
41
41
  ...options,
42
42
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
43
43
  });
@@ -102,6 +102,13 @@ export interface GroupCreateParams {
102
102
  status?: boolean | null;
103
103
  }
104
104
 
105
+ export interface GroupDeleteParams {
106
+ /**
107
+ * Product Collection Id
108
+ */
109
+ id: string;
110
+ }
111
+
105
112
  export interface GroupUpdateParams {
106
113
  /**
107
114
  * Path param: Product Collection Id
@@ -126,13 +133,6 @@ export interface GroupUpdateParams {
126
133
  status?: boolean | null;
127
134
  }
128
135
 
129
- export interface GroupDeleteParams {
130
- /**
131
- * Product Collection Id
132
- */
133
- id: string;
134
- }
135
-
136
136
  Groups.Items = Items;
137
137
 
138
138
  export declare namespace Groups {
@@ -141,8 +141,8 @@ export declare namespace Groups {
141
141
  type ProductCollectionGroupDetails as ProductCollectionGroupDetails,
142
142
  type ProductCollectionGroupResponse as ProductCollectionGroupResponse,
143
143
  type GroupCreateParams as GroupCreateParams,
144
- type GroupUpdateParams as GroupUpdateParams,
145
144
  type GroupDeleteParams as GroupDeleteParams,
145
+ type GroupUpdateParams as GroupUpdateParams,
146
146
  };
147
147
 
148
148
  export {
@@ -150,7 +150,7 @@ export declare namespace Groups {
150
150
  type ProductCollectionProduct as ProductCollectionProduct,
151
151
  type ItemCreateResponse as ItemCreateResponse,
152
152
  type ItemCreateParams as ItemCreateParams,
153
- type ItemUpdateParams as ItemUpdateParams,
154
153
  type ItemDeleteParams as ItemDeleteParams,
154
+ type ItemUpdateParams as ItemUpdateParams,
155
155
  };
156
156
  }
@@ -6,14 +6,14 @@ export {
6
6
  type ProductCollectionGroupDetails,
7
7
  type ProductCollectionGroupResponse,
8
8
  type GroupCreateParams,
9
- type GroupUpdateParams,
10
9
  type GroupDeleteParams,
10
+ type GroupUpdateParams,
11
11
  } from './groups';
12
12
  export {
13
13
  Items,
14
14
  type ProductCollectionProduct,
15
15
  type ItemCreateResponse,
16
16
  type ItemCreateParams,
17
- type ItemUpdateParams,
18
17
  type ItemDeleteParams,
18
+ type ItemUpdateParams,
19
19
  } from './items';
@@ -19,18 +19,18 @@ export class Items extends APIResource {
19
19
  return this._client.post(path`/product-collections/${id}/groups/${groupID}/items`, { body, ...options });
20
20
  }
21
21
 
22
- update(itemID: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<void> {
23
- const { id, group_id, ...body } = params;
24
- return this._client.patch(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
25
- body,
22
+ delete(itemID: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void> {
23
+ const { id, group_id } = params;
24
+ return this._client.delete(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
26
25
  ...options,
27
26
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
28
27
  });
29
28
  }
30
29
 
31
- delete(itemID: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void> {
32
- const { id, group_id } = params;
33
- return this._client.delete(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
30
+ update(itemID: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<void> {
31
+ const { id, group_id, ...body } = params;
32
+ return this._client.patch(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
33
+ body,
34
34
  ...options,
35
35
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
36
  });
@@ -95,33 +95,33 @@ export interface ItemCreateParams {
95
95
  products: Array<GroupsAPI.GroupProduct>;
96
96
  }
97
97
 
98
- export interface ItemUpdateParams {
98
+ export interface ItemDeleteParams {
99
99
  /**
100
- * Path param: Product Collection Id
100
+ * Product Collection Id
101
101
  */
102
102
  id: string;
103
103
 
104
104
  /**
105
- * Path param: Product Collection Group Id
105
+ * Product Collection Group Id
106
106
  */
107
107
  group_id: string;
108
-
109
- /**
110
- * Body param: Status of the product in the group
111
- */
112
- status: boolean;
113
108
  }
114
109
 
115
- export interface ItemDeleteParams {
110
+ export interface ItemUpdateParams {
116
111
  /**
117
- * Product Collection Id
112
+ * Path param: Product Collection Id
118
113
  */
119
114
  id: string;
120
115
 
121
116
  /**
122
- * Product Collection Group Id
117
+ * Path param: Product Collection Group Id
123
118
  */
124
119
  group_id: string;
120
+
121
+ /**
122
+ * Body param: Status of the product in the group
123
+ */
124
+ status: boolean;
125
125
  }
126
126
 
127
127
  export declare namespace Items {
@@ -129,7 +129,7 @@ export declare namespace Items {
129
129
  type ProductCollectionProduct as ProductCollectionProduct,
130
130
  type ItemCreateResponse as ItemCreateResponse,
131
131
  type ItemCreateParams as ItemCreateParams,
132
- type ItemUpdateParams as ItemUpdateParams,
133
132
  type ItemDeleteParams as ItemDeleteParams,
133
+ type ItemUpdateParams as ItemUpdateParams,
134
134
  };
135
135
  }
@@ -6,8 +6,8 @@ export {
6
6
  type ProductCollectionGroupDetails,
7
7
  type ProductCollectionGroupResponse,
8
8
  type GroupCreateParams,
9
- type GroupUpdateParams,
10
9
  type GroupDeleteParams,
10
+ type GroupUpdateParams,
11
11
  } from './groups/index';
12
12
  export {
13
13
  ProductCollections,
@@ -15,9 +15,9 @@ export {
15
15
  type ProductCollectionListResponse,
16
16
  type ProductCollectionUnarchiveResponse,
17
17
  type ProductCollectionUpdateImagesResponse,
18
+ type ProductCollectionListParams,
18
19
  type ProductCollectionCreateParams,
19
20
  type ProductCollectionUpdateParams,
20
- type ProductCollectionListParams,
21
21
  type ProductCollectionUpdateImagesParams,
22
22
  type ProductCollectionListResponsesDefaultPageNumberPagination,
23
23
  } from './product-collections';
@@ -24,22 +24,6 @@ import { path } from '../../internal/utils/path';
24
24
  export class ProductCollections extends APIResource {
25
25
  groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
26
26
 
27
- create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollection> {
28
- return this._client.post('/product-collections', { body, ...options });
29
- }
30
-
31
- retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollection> {
32
- return this._client.get(path`/product-collections/${id}`, options);
33
- }
34
-
35
- update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void> {
36
- return this._client.patch(path`/product-collections/${id}`, {
37
- body,
38
- ...options,
39
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
40
- });
41
- }
42
-
43
27
  list(
44
28
  query: ProductCollectionListParams | null | undefined = {},
45
29
  options?: RequestOptions,
@@ -51,6 +35,14 @@ export class ProductCollections extends APIResource {
51
35
  );
52
36
  }
53
37
 
38
+ create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollection> {
39
+ return this._client.post('/product-collections', { body, ...options });
40
+ }
41
+
42
+ retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollection> {
43
+ return this._client.get(path`/product-collections/${id}`, options);
44
+ }
45
+
54
46
  delete(id: string, options?: RequestOptions): APIPromise<void> {
55
47
  return this._client.delete(path`/product-collections/${id}`, {
56
48
  ...options,
@@ -58,8 +50,12 @@ export class ProductCollections extends APIResource {
58
50
  });
59
51
  }
60
52
 
61
- unarchive(id: string, options?: RequestOptions): APIPromise<ProductCollectionUnarchiveResponse> {
62
- return this._client.post(path`/product-collections/${id}/unarchive`, options);
53
+ update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void> {
54
+ return this._client.patch(path`/product-collections/${id}`, {
55
+ body,
56
+ ...options,
57
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
58
+ });
63
59
  }
64
60
 
65
61
  updateImages(
@@ -70,6 +66,10 @@ export class ProductCollections extends APIResource {
70
66
  const { force_update } = params ?? {};
71
67
  return this._client.put(path`/product-collections/${id}/images`, { query: { force_update }, ...options });
72
68
  }
69
+
70
+ unarchive(id: string, options?: RequestOptions): APIPromise<ProductCollectionUnarchiveResponse> {
71
+ return this._client.post(path`/product-collections/${id}/unarchive`, options);
72
+ }
73
73
  }
74
74
 
75
75
  export type ProductCollectionListResponsesDefaultPageNumberPagination =
@@ -183,6 +183,18 @@ export interface ProductCollectionUpdateImagesResponse {
183
183
  image_id?: string | null;
184
184
  }
185
185
 
186
+ export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
187
+ /**
188
+ * List archived collections
189
+ */
190
+ archived?: boolean;
191
+
192
+ /**
193
+ * Filter by Brand id
194
+ */
195
+ brand_id?: string;
196
+ }
197
+
186
198
  export interface ProductCollectionCreateParams {
187
199
  /**
188
200
  * Groups of products in this collection
@@ -232,18 +244,6 @@ export interface ProductCollectionUpdateParams {
232
244
  name?: string | null;
233
245
  }
234
246
 
235
- export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
236
- /**
237
- * List archived collections
238
- */
239
- archived?: boolean;
240
-
241
- /**
242
- * Filter by Brand id
243
- */
244
- brand_id?: string;
245
- }
246
-
247
247
  export interface ProductCollectionUpdateImagesParams {
248
248
  /**
249
249
  * If true, generates a new image ID to force cache invalidation
@@ -260,9 +260,9 @@ export declare namespace ProductCollections {
260
260
  type ProductCollectionUnarchiveResponse as ProductCollectionUnarchiveResponse,
261
261
  type ProductCollectionUpdateImagesResponse as ProductCollectionUpdateImagesResponse,
262
262
  type ProductCollectionListResponsesDefaultPageNumberPagination as ProductCollectionListResponsesDefaultPageNumberPagination,
263
+ type ProductCollectionListParams as ProductCollectionListParams,
263
264
  type ProductCollectionCreateParams as ProductCollectionCreateParams,
264
265
  type ProductCollectionUpdateParams as ProductCollectionUpdateParams,
265
- type ProductCollectionListParams as ProductCollectionListParams,
266
266
  type ProductCollectionUpdateImagesParams as ProductCollectionUpdateImagesParams,
267
267
  };
268
268
 
@@ -272,7 +272,7 @@ export declare namespace ProductCollections {
272
272
  type ProductCollectionGroupDetails as ProductCollectionGroupDetails,
273
273
  type ProductCollectionGroupResponse as ProductCollectionGroupResponse,
274
274
  type GroupCreateParams as GroupCreateParams,
275
- type GroupUpdateParams as GroupUpdateParams,
276
275
  type GroupDeleteParams as GroupDeleteParams,
276
+ type GroupUpdateParams as GroupUpdateParams,
277
277
  };
278
278
  }