dodopayments 2.32.1 → 2.33.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 (278) 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/balances.d.mts +2 -2
  17. package/resources/balances.d.mts.map +1 -1
  18. package/resources/balances.d.ts +2 -2
  19. package/resources/balances.d.ts.map +1 -1
  20. package/resources/brands.d.mts +1 -1
  21. package/resources/brands.d.mts.map +1 -1
  22. package/resources/brands.d.ts +1 -1
  23. package/resources/brands.d.ts.map +1 -1
  24. package/resources/brands.js +3 -3
  25. package/resources/brands.js.map +1 -1
  26. package/resources/brands.mjs +3 -3
  27. package/resources/brands.mjs.map +1 -1
  28. package/resources/credit-entitlements/balances.d.mts +69 -69
  29. package/resources/credit-entitlements/balances.d.mts.map +1 -1
  30. package/resources/credit-entitlements/balances.d.ts +69 -69
  31. package/resources/credit-entitlements/balances.d.ts.map +1 -1
  32. package/resources/credit-entitlements/balances.js +41 -41
  33. package/resources/credit-entitlements/balances.js.map +1 -1
  34. package/resources/credit-entitlements/balances.mjs +41 -41
  35. package/resources/credit-entitlements/balances.mjs.map +1 -1
  36. package/resources/credit-entitlements/credit-entitlements.d.mts +38 -38
  37. package/resources/credit-entitlements/credit-entitlements.d.mts.map +1 -1
  38. package/resources/credit-entitlements/credit-entitlements.d.ts +38 -38
  39. package/resources/credit-entitlements/credit-entitlements.d.ts.map +1 -1
  40. package/resources/credit-entitlements/credit-entitlements.js +40 -40
  41. package/resources/credit-entitlements/credit-entitlements.js.map +1 -1
  42. package/resources/credit-entitlements/credit-entitlements.mjs +40 -40
  43. package/resources/credit-entitlements/credit-entitlements.mjs.map +1 -1
  44. package/resources/credit-entitlements/index.d.mts +2 -2
  45. package/resources/credit-entitlements/index.d.mts.map +1 -1
  46. package/resources/credit-entitlements/index.d.ts +2 -2
  47. package/resources/credit-entitlements/index.d.ts.map +1 -1
  48. package/resources/customers/customers.d.mts +23 -23
  49. package/resources/customers/customers.d.mts.map +1 -1
  50. package/resources/customers/customers.d.ts +23 -23
  51. package/resources/customers/customers.d.ts.map +1 -1
  52. package/resources/customers/customers.js +16 -16
  53. package/resources/customers/customers.js.map +1 -1
  54. package/resources/customers/customers.mjs +16 -16
  55. package/resources/customers/customers.mjs.map +1 -1
  56. package/resources/customers/index.d.mts +1 -1
  57. package/resources/customers/index.d.mts.map +1 -1
  58. package/resources/customers/index.d.ts +1 -1
  59. package/resources/customers/index.d.ts.map +1 -1
  60. package/resources/customers/wallets/index.d.mts +1 -1
  61. package/resources/customers/wallets/index.d.mts.map +1 -1
  62. package/resources/customers/wallets/index.d.ts +1 -1
  63. package/resources/customers/wallets/index.d.ts.map +1 -1
  64. package/resources/customers/wallets/ledger-entries.d.mts +8 -8
  65. package/resources/customers/wallets/ledger-entries.d.mts.map +1 -1
  66. package/resources/customers/wallets/ledger-entries.d.ts +8 -8
  67. package/resources/customers/wallets/ledger-entries.d.ts.map +1 -1
  68. package/resources/customers/wallets/ledger-entries.js +3 -3
  69. package/resources/customers/wallets/ledger-entries.js.map +1 -1
  70. package/resources/customers/wallets/ledger-entries.mjs +3 -3
  71. package/resources/customers/wallets/ledger-entries.mjs.map +1 -1
  72. package/resources/customers/wallets/wallets.d.mts +1 -1
  73. package/resources/customers/wallets/wallets.d.mts.map +1 -1
  74. package/resources/customers/wallets/wallets.d.ts +1 -1
  75. package/resources/customers/wallets/wallets.d.ts.map +1 -1
  76. package/resources/discounts.d.mts +36 -47
  77. package/resources/discounts.d.mts.map +1 -1
  78. package/resources/discounts.d.ts +36 -47
  79. package/resources/discounts.d.ts.map +1 -1
  80. package/resources/discounts.js +15 -15
  81. package/resources/discounts.js.map +1 -1
  82. package/resources/discounts.mjs +15 -15
  83. package/resources/discounts.mjs.map +1 -1
  84. package/resources/disputes.d.mts +1 -1
  85. package/resources/disputes.d.mts.map +1 -1
  86. package/resources/disputes.d.ts +1 -1
  87. package/resources/disputes.d.ts.map +1 -1
  88. package/resources/disputes.js +3 -3
  89. package/resources/disputes.js.map +1 -1
  90. package/resources/disputes.mjs +3 -3
  91. package/resources/disputes.mjs.map +1 -1
  92. package/resources/entitlements/entitlements.d.mts +15 -15
  93. package/resources/entitlements/entitlements.d.mts.map +1 -1
  94. package/resources/entitlements/entitlements.d.ts +15 -15
  95. package/resources/entitlements/entitlements.d.ts.map +1 -1
  96. package/resources/entitlements/entitlements.js +15 -15
  97. package/resources/entitlements/entitlements.js.map +1 -1
  98. package/resources/entitlements/entitlements.mjs +15 -15
  99. package/resources/entitlements/entitlements.mjs.map +1 -1
  100. package/resources/entitlements/files.d.mts +4 -4
  101. package/resources/entitlements/files.d.mts.map +1 -1
  102. package/resources/entitlements/files.d.ts +4 -4
  103. package/resources/entitlements/files.d.ts.map +1 -1
  104. package/resources/entitlements/files.js +6 -6
  105. package/resources/entitlements/files.js.map +1 -1
  106. package/resources/entitlements/files.mjs +6 -6
  107. package/resources/entitlements/files.mjs.map +1 -1
  108. package/resources/entitlements/index.d.mts +1 -1
  109. package/resources/entitlements/index.d.mts.map +1 -1
  110. package/resources/entitlements/index.d.ts +1 -1
  111. package/resources/entitlements/index.d.ts.map +1 -1
  112. package/resources/index.d.mts +15 -15
  113. package/resources/index.d.mts.map +1 -1
  114. package/resources/index.d.ts +15 -15
  115. package/resources/index.d.ts.map +1 -1
  116. package/resources/invoices/payments.d.mts +1 -1
  117. package/resources/invoices/payments.d.ts +1 -1
  118. package/resources/invoices/payments.js +4 -4
  119. package/resources/invoices/payments.mjs +4 -4
  120. package/resources/license-key-instances.d.mts +14 -14
  121. package/resources/license-key-instances.d.mts.map +1 -1
  122. package/resources/license-key-instances.d.ts +14 -14
  123. package/resources/license-key-instances.d.ts.map +1 -1
  124. package/resources/license-key-instances.js +12 -12
  125. package/resources/license-key-instances.js.map +1 -1
  126. package/resources/license-key-instances.mjs +12 -12
  127. package/resources/license-key-instances.mjs.map +1 -1
  128. package/resources/license-keys.d.mts +38 -38
  129. package/resources/license-keys.d.mts.map +1 -1
  130. package/resources/license-keys.d.ts +38 -38
  131. package/resources/license-keys.d.ts.map +1 -1
  132. package/resources/license-keys.js +16 -16
  133. package/resources/license-keys.js.map +1 -1
  134. package/resources/license-keys.mjs +16 -16
  135. package/resources/license-keys.mjs.map +1 -1
  136. package/resources/meters.d.mts +8 -8
  137. package/resources/meters.d.mts.map +1 -1
  138. package/resources/meters.d.ts +8 -8
  139. package/resources/meters.d.ts.map +1 -1
  140. package/resources/meters.js +3 -3
  141. package/resources/meters.js.map +1 -1
  142. package/resources/meters.mjs +3 -3
  143. package/resources/meters.mjs.map +1 -1
  144. package/resources/payments.d.mts +38 -32
  145. package/resources/payments.d.mts.map +1 -1
  146. package/resources/payments.d.ts +38 -32
  147. package/resources/payments.d.ts.map +1 -1
  148. package/resources/payments.js +6 -6
  149. package/resources/payments.js.map +1 -1
  150. package/resources/payments.mjs +6 -6
  151. package/resources/payments.mjs.map +1 -1
  152. package/resources/product-collections/groups/groups.d.mts +9 -9
  153. package/resources/product-collections/groups/groups.d.mts.map +1 -1
  154. package/resources/product-collections/groups/groups.d.ts +9 -9
  155. package/resources/product-collections/groups/groups.d.ts.map +1 -1
  156. package/resources/product-collections/groups/groups.js +7 -7
  157. package/resources/product-collections/groups/groups.js.map +1 -1
  158. package/resources/product-collections/groups/groups.mjs +7 -7
  159. package/resources/product-collections/groups/groups.mjs.map +1 -1
  160. package/resources/product-collections/groups/index.d.mts +2 -2
  161. package/resources/product-collections/groups/index.d.ts +2 -2
  162. package/resources/product-collections/groups/items.d.mts +12 -12
  163. package/resources/product-collections/groups/items.d.mts.map +1 -1
  164. package/resources/product-collections/groups/items.d.ts +12 -12
  165. package/resources/product-collections/groups/items.d.ts.map +1 -1
  166. package/resources/product-collections/groups/items.js +7 -7
  167. package/resources/product-collections/groups/items.js.map +1 -1
  168. package/resources/product-collections/groups/items.mjs +7 -7
  169. package/resources/product-collections/groups/items.mjs.map +1 -1
  170. package/resources/product-collections/index.d.mts +2 -2
  171. package/resources/product-collections/index.d.mts.map +1 -1
  172. package/resources/product-collections/index.d.ts +2 -2
  173. package/resources/product-collections/index.d.ts.map +1 -1
  174. package/resources/product-collections/product-collections.d.mts +86 -11
  175. package/resources/product-collections/product-collections.d.mts.map +1 -1
  176. package/resources/product-collections/product-collections.d.ts +86 -11
  177. package/resources/product-collections/product-collections.d.ts.map +1 -1
  178. package/resources/product-collections/product-collections.js +11 -11
  179. package/resources/product-collections/product-collections.js.map +1 -1
  180. package/resources/product-collections/product-collections.mjs +11 -11
  181. package/resources/product-collections/product-collections.mjs.map +1 -1
  182. package/resources/products/index.d.mts +2 -2
  183. package/resources/products/index.d.mts.map +1 -1
  184. package/resources/products/index.d.ts +2 -2
  185. package/resources/products/index.d.ts.map +1 -1
  186. package/resources/products/products.d.mts +21 -21
  187. package/resources/products/products.d.mts.map +1 -1
  188. package/resources/products/products.d.ts +21 -21
  189. package/resources/products/products.d.ts.map +1 -1
  190. package/resources/products/products.js +6 -6
  191. package/resources/products/products.js.map +1 -1
  192. package/resources/products/products.mjs +6 -6
  193. package/resources/products/products.mjs.map +1 -1
  194. package/resources/products/short-links.d.mts +11 -11
  195. package/resources/products/short-links.d.mts.map +1 -1
  196. package/resources/products/short-links.d.ts +11 -11
  197. package/resources/products/short-links.d.ts.map +1 -1
  198. package/resources/products/short-links.js +6 -6
  199. package/resources/products/short-links.js.map +1 -1
  200. package/resources/products/short-links.mjs +6 -6
  201. package/resources/products/short-links.mjs.map +1 -1
  202. package/resources/refunds.d.mts +24 -24
  203. package/resources/refunds.d.mts.map +1 -1
  204. package/resources/refunds.d.ts +24 -24
  205. package/resources/refunds.d.ts.map +1 -1
  206. package/resources/refunds.js +6 -6
  207. package/resources/refunds.js.map +1 -1
  208. package/resources/refunds.mjs +6 -6
  209. package/resources/refunds.mjs.map +1 -1
  210. package/resources/subscriptions.d.mts +86 -86
  211. package/resources/subscriptions.d.mts.map +1 -1
  212. package/resources/subscriptions.d.ts +86 -86
  213. package/resources/subscriptions.d.ts.map +1 -1
  214. package/resources/subscriptions.js +23 -23
  215. package/resources/subscriptions.js.map +1 -1
  216. package/resources/subscriptions.mjs +23 -23
  217. package/resources/subscriptions.mjs.map +1 -1
  218. package/resources/usage-events.d.mts +61 -61
  219. package/resources/usage-events.d.mts.map +1 -1
  220. package/resources/usage-events.d.ts +61 -61
  221. package/resources/usage-events.d.ts.map +1 -1
  222. package/resources/usage-events.js +56 -56
  223. package/resources/usage-events.js.map +1 -1
  224. package/resources/usage-events.mjs +56 -56
  225. package/resources/usage-events.mjs.map +1 -1
  226. package/resources/webhooks/index.d.mts +1 -1
  227. package/resources/webhooks/index.d.mts.map +1 -1
  228. package/resources/webhooks/index.d.ts +1 -1
  229. package/resources/webhooks/index.d.ts.map +1 -1
  230. package/resources/webhooks/webhooks.d.mts +12 -12
  231. package/resources/webhooks/webhooks.d.mts.map +1 -1
  232. package/resources/webhooks/webhooks.d.ts +12 -12
  233. package/resources/webhooks/webhooks.d.ts.map +1 -1
  234. package/resources/webhooks/webhooks.js +15 -15
  235. package/resources/webhooks/webhooks.js.map +1 -1
  236. package/resources/webhooks/webhooks.mjs +15 -15
  237. package/resources/webhooks/webhooks.mjs.map +1 -1
  238. package/src/client.ts +18 -18
  239. package/src/resources/addons.ts +13 -13
  240. package/src/resources/balances.ts +4 -2
  241. package/src/resources/brands.ts +4 -4
  242. package/src/resources/credit-entitlements/balances.ts +91 -91
  243. package/src/resources/credit-entitlements/credit-entitlements.ts +55 -55
  244. package/src/resources/credit-entitlements/index.ts +3 -3
  245. package/src/resources/customers/customers.ts +49 -49
  246. package/src/resources/customers/index.ts +1 -1
  247. package/src/resources/customers/wallets/index.ts +1 -1
  248. package/src/resources/customers/wallets/ledger-entries.ts +16 -16
  249. package/src/resources/customers/wallets/wallets.ts +1 -1
  250. package/src/resources/discounts.ts +52 -63
  251. package/src/resources/disputes.ts +4 -4
  252. package/src/resources/entitlements/entitlements.ts +36 -36
  253. package/src/resources/entitlements/files.ts +7 -7
  254. package/src/resources/entitlements/index.ts +1 -1
  255. package/src/resources/index.ts +18 -18
  256. package/src/resources/invoices/payments.ts +4 -4
  257. package/src/resources/license-key-instances.ts +25 -25
  258. package/src/resources/license-keys.ts +48 -48
  259. package/src/resources/meters.ts +15 -15
  260. package/src/resources/payments.ts +66 -59
  261. package/src/resources/product-collections/groups/groups.ts +16 -16
  262. package/src/resources/product-collections/groups/index.ts +2 -2
  263. package/src/resources/product-collections/groups/items.ts +19 -19
  264. package/src/resources/product-collections/index.ts +2 -2
  265. package/src/resources/product-collections/product-collections.ts +146 -26
  266. package/src/resources/products/index.ts +2 -2
  267. package/src/resources/products/products.ts +33 -33
  268. package/src/resources/products/short-links.ts +20 -20
  269. package/src/resources/refunds.ts +36 -36
  270. package/src/resources/subscriptions.ts +130 -130
  271. package/src/resources/usage-events.ts +64 -64
  272. package/src/resources/webhooks/index.ts +1 -1
  273. package/src/resources/webhooks/webhooks.ts +24 -24
  274. package/src/version.ts +1 -1
  275. package/version.d.mts +1 -1
  276. package/version.d.ts +1 -1
  277. package/version.js +1 -1
  278. package/version.mjs +1 -1
@@ -13,14 +13,6 @@ import { RequestOptions } from '../../../internal/request-options';
13
13
  import { path } from '../../../internal/utils/path';
14
14
 
15
15
  export class LedgerEntries extends APIResource {
16
- create(
17
- customerID: string,
18
- body: LedgerEntryCreateParams,
19
- options?: RequestOptions,
20
- ): APIPromise<WalletsAPI.CustomerWallet> {
21
- return this._client.post(path`/customers/${customerID}/wallets/ledger-entries`, { body, ...options });
22
- }
23
-
24
16
  list(
25
17
  customerID: string,
26
18
  query: LedgerEntryListParams | null | undefined = {},
@@ -32,6 +24,14 @@ export class LedgerEntries extends APIResource {
32
24
  { query, ...options },
33
25
  );
34
26
  }
27
+
28
+ create(
29
+ customerID: string,
30
+ body: LedgerEntryCreateParams,
31
+ options?: RequestOptions,
32
+ ): APIPromise<WalletsAPI.CustomerWallet> {
33
+ return this._client.post(path`/customers/${customerID}/wallets/ledger-entries`, { body, ...options });
34
+ }
35
35
  }
36
36
 
37
37
  export type CustomerWalletTransactionsDefaultPageNumberPagination =
@@ -70,6 +70,13 @@ export interface CustomerWalletTransaction {
70
70
  reference_object_id?: string | null;
71
71
  }
72
72
 
73
+ export interface LedgerEntryListParams extends DefaultPageNumberPaginationParams {
74
+ /**
75
+ * Optional currency filter
76
+ */
77
+ currency?: MiscAPI.Currency;
78
+ }
79
+
73
80
  export interface LedgerEntryCreateParams {
74
81
  amount: number;
75
82
 
@@ -91,18 +98,11 @@ export interface LedgerEntryCreateParams {
91
98
  reason?: string | null;
92
99
  }
93
100
 
94
- export interface LedgerEntryListParams extends DefaultPageNumberPaginationParams {
95
- /**
96
- * Optional currency filter
97
- */
98
- currency?: MiscAPI.Currency;
99
- }
100
-
101
101
  export declare namespace LedgerEntries {
102
102
  export {
103
103
  type CustomerWalletTransaction as CustomerWalletTransaction,
104
104
  type CustomerWalletTransactionsDefaultPageNumberPagination as CustomerWalletTransactionsDefaultPageNumberPagination,
105
- type LedgerEntryCreateParams as LedgerEntryCreateParams,
106
105
  type LedgerEntryListParams as LedgerEntryListParams,
106
+ type LedgerEntryCreateParams as LedgerEntryCreateParams,
107
107
  };
108
108
  }
@@ -52,7 +52,7 @@ export declare namespace Wallets {
52
52
  LedgerEntries as LedgerEntries,
53
53
  type CustomerWalletTransaction as CustomerWalletTransaction,
54
54
  type CustomerWalletTransactionsDefaultPageNumberPagination as CustomerWalletTransactionsDefaultPageNumberPagination,
55
- type LedgerEntryCreateParams as LedgerEntryCreateParams,
56
55
  type LedgerEntryListParams as LedgerEntryListParams,
56
+ type LedgerEntryCreateParams as LedgerEntryCreateParams,
57
57
  };
58
58
  }
@@ -12,6 +12,19 @@ import { RequestOptions } from '../internal/request-options';
12
12
  import { path } from '../internal/utils/path';
13
13
 
14
14
  export class Discounts extends APIResource {
15
+ /**
16
+ * GET /discounts
17
+ */
18
+ list(
19
+ query: DiscountListParams | null | undefined = {},
20
+ options?: RequestOptions,
21
+ ): PagePromise<DiscountsDefaultPageNumberPagination, Discount> {
22
+ return this._client.getAPIList('/discounts', DefaultPageNumberPagination<Discount>, {
23
+ query,
24
+ ...options,
25
+ });
26
+ }
27
+
15
28
  /**
16
29
  * POST /discounts If `code` is omitted or empty, a random 16-char uppercase code
17
30
  * is generated.
@@ -27,26 +40,6 @@ export class Discounts extends APIResource {
27
40
  return this._client.get(path`/discounts/${discountID}`, options);
28
41
  }
29
42
 
30
- /**
31
- * PATCH /discounts/{discount_id}
32
- */
33
- update(discountID: string, body: DiscountUpdateParams, options?: RequestOptions): APIPromise<Discount> {
34
- return this._client.patch(path`/discounts/${discountID}`, { body, ...options });
35
- }
36
-
37
- /**
38
- * GET /discounts
39
- */
40
- list(
41
- query: DiscountListParams | null | undefined = {},
42
- options?: RequestOptions,
43
- ): PagePromise<DiscountsDefaultPageNumberPagination, Discount> {
44
- return this._client.getAPIList('/discounts', DefaultPageNumberPagination<Discount>, {
45
- query,
46
- ...options,
47
- });
48
- }
49
-
50
43
  /**
51
44
  * DELETE /discounts/{discount_id}
52
45
  */
@@ -57,6 +50,13 @@ export class Discounts extends APIResource {
57
50
  });
58
51
  }
59
52
 
53
+ /**
54
+ * PATCH /discounts/{discount_id}
55
+ */
56
+ update(discountID: string, body: DiscountUpdateParams, options?: RequestOptions): APIPromise<Discount> {
57
+ return this._client.patch(path`/discounts/${discountID}`, { body, ...options });
58
+ }
59
+
60
60
  /**
61
61
  * Validate and fetch a discount by its code name (e.g., "SAVE20"). This allows
62
62
  * real-time validation directly against the API using the human-readable discount
@@ -71,11 +71,7 @@ export type DiscountsDefaultPageNumberPagination = DefaultPageNumberPagination<D
71
71
 
72
72
  export interface Discount {
73
73
  /**
74
- * The discount amount.
75
- *
76
- * - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
77
- * 5.4%).
78
- * - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
74
+ * The discount amount in **basis points** (e.g., 540 => 5.4%).
79
75
  */
80
76
  amount: number;
81
77
 
@@ -118,7 +114,7 @@ export interface Discount {
118
114
  times_used: number;
119
115
 
120
116
  /**
121
- * The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
117
+ * The type of discount. Currently only `percentage` is supported.
122
118
  */
123
119
  type: DiscountType;
124
120
 
@@ -151,7 +147,7 @@ export interface Discount {
151
147
  */
152
148
  export interface DiscountDetail {
153
149
  /**
154
- * The discount amount (basis points for percentage, USD cents for flat)
150
+ * The discount amount in **basis points** (e.g., 540 => 5.4%).
155
151
  */
156
152
  amount: number;
157
153
 
@@ -234,21 +230,39 @@ export interface DiscountDetail {
234
230
 
235
231
  export type DiscountType = 'percentage';
236
232
 
233
+ export interface DiscountListParams extends DefaultPageNumberPaginationParams {
234
+ /**
235
+ * Filter by active status (true = not expired, false = expired)
236
+ */
237
+ active?: boolean;
238
+
239
+ /**
240
+ * Filter by discount code (partial match, case-insensitive)
241
+ */
242
+ code?: string;
243
+
244
+ /**
245
+ * Filter by discount type
246
+ */
247
+ discount_type?: DiscountType;
248
+
249
+ /**
250
+ * Filter by product restriction (only discounts that apply to this product)
251
+ */
252
+ product_id?: string;
253
+ }
254
+
237
255
  export interface DiscountCreateParams {
238
256
  /**
239
- * The discount amount.
240
- *
241
- * - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
242
- * example, `100` means `$1.00`. Only USD is allowed.
243
- * - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
244
- * example, `540` means `5.4%`.
257
+ * The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
258
+ * `100%`).
245
259
  *
246
260
  * Must be at least 1.
247
261
  */
248
262
  amount: number;
249
263
 
250
264
  /**
251
- * The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
265
+ * The discount type. Currently only `percentage` is supported.
252
266
  */
253
267
  type: DiscountType;
254
268
 
@@ -298,11 +312,8 @@ export interface DiscountCreateParams {
298
312
 
299
313
  export interface DiscountUpdateParams {
300
314
  /**
301
- * If present, update the discount amount:
302
- *
303
- * - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
304
- * `540` = `5.4%`).
305
- * - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
315
+ * If present, update the discount amount in **basis points** (e.g., `540` =
316
+ * `5.4%`, `10000` = `100%`).
306
317
  *
307
318
  * Must be at least 1 if provided.
308
319
  */
@@ -342,43 +353,21 @@ export interface DiscountUpdateParams {
342
353
  subscription_cycles?: number | null;
343
354
 
344
355
  /**
345
- * If present, update the discount type.
356
+ * If present, update the discount type. Currently only `percentage` is supported.
346
357
  */
347
358
  type?: DiscountType | null;
348
359
 
349
360
  usage_limit?: number | null;
350
361
  }
351
362
 
352
- export interface DiscountListParams extends DefaultPageNumberPaginationParams {
353
- /**
354
- * Filter by active status (true = not expired, false = expired)
355
- */
356
- active?: boolean;
357
-
358
- /**
359
- * Filter by discount code (partial match, case-insensitive)
360
- */
361
- code?: string;
362
-
363
- /**
364
- * Filter by discount type (percentage)
365
- */
366
- discount_type?: DiscountType;
367
-
368
- /**
369
- * Filter by product restriction (only discounts that apply to this product)
370
- */
371
- product_id?: string;
372
- }
373
-
374
363
  export declare namespace Discounts {
375
364
  export {
376
365
  type Discount as Discount,
377
366
  type DiscountDetail as DiscountDetail,
378
367
  type DiscountType as DiscountType,
379
368
  type DiscountsDefaultPageNumberPagination as DiscountsDefaultPageNumberPagination,
369
+ type DiscountListParams as DiscountListParams,
380
370
  type DiscountCreateParams as DiscountCreateParams,
381
371
  type DiscountUpdateParams as DiscountUpdateParams,
382
- type DiscountListParams as DiscountListParams,
383
372
  };
384
373
  }
@@ -12,10 +12,6 @@ import { RequestOptions } from '../internal/request-options';
12
12
  import { path } from '../internal/utils/path';
13
13
 
14
14
  export class Disputes extends APIResource {
15
- retrieve(disputeID: string, options?: RequestOptions): APIPromise<GetDispute> {
16
- return this._client.get(path`/disputes/${disputeID}`, options);
17
- }
18
-
19
15
  list(
20
16
  query: DisputeListParams | null | undefined = {},
21
17
  options?: RequestOptions,
@@ -25,6 +21,10 @@ export class Disputes extends APIResource {
25
21
  ...options,
26
22
  });
27
23
  }
24
+
25
+ retrieve(disputeID: string, options?: RequestOptions): APIPromise<GetDispute> {
26
+ return this._client.get(path`/disputes/${disputeID}`, options);
27
+ }
28
28
  }
29
29
 
30
30
  export type DisputeListResponsesDefaultPageNumberPagination =
@@ -28,6 +28,19 @@ export class Entitlements extends APIResource {
28
28
  files: FilesAPI.Files = new FilesAPI.Files(this._client);
29
29
  grants: GrantsAPI.Grants = new GrantsAPI.Grants(this._client);
30
30
 
31
+ /**
32
+ * GET /entitlements
33
+ */
34
+ list(
35
+ query: EntitlementListParams | null | undefined = {},
36
+ options?: RequestOptions,
37
+ ): PagePromise<EntitlementsDefaultPageNumberPagination, Entitlement> {
38
+ return this._client.getAPIList('/entitlements', DefaultPageNumberPagination<Entitlement>, {
39
+ query,
40
+ ...options,
41
+ });
42
+ }
43
+
31
44
  /**
32
45
  * POST /entitlements
33
46
  */
@@ -42,26 +55,6 @@ export class Entitlements extends APIResource {
42
55
  return this._client.get(path`/entitlements/${id}`, options);
43
56
  }
44
57
 
45
- /**
46
- * PATCH /entitlements/{id}
47
- */
48
- update(id: string, body: EntitlementUpdateParams, options?: RequestOptions): APIPromise<Entitlement> {
49
- return this._client.patch(path`/entitlements/${id}`, { body, ...options });
50
- }
51
-
52
- /**
53
- * GET /entitlements
54
- */
55
- list(
56
- query: EntitlementListParams | null | undefined = {},
57
- options?: RequestOptions,
58
- ): PagePromise<EntitlementsDefaultPageNumberPagination, Entitlement> {
59
- return this._client.getAPIList('/entitlements', DefaultPageNumberPagination<Entitlement>, {
60
- query,
61
- ...options,
62
- });
63
- }
64
-
65
58
  /**
66
59
  * DELETE /entitlements/{id} (soft-delete)
67
60
  */
@@ -71,6 +64,13 @@ export class Entitlements extends APIResource {
71
64
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
72
65
  });
73
66
  }
67
+
68
+ /**
69
+ * PATCH /entitlements/{id}
70
+ */
71
+ update(id: string, body: EntitlementUpdateParams, options?: RequestOptions): APIPromise<Entitlement> {
72
+ return this._client.patch(path`/entitlements/${id}`, { body, ...options });
73
+ }
74
74
  }
75
75
 
76
76
  export type EntitlementsDefaultPageNumberPagination = DefaultPageNumberPagination<Entitlement>;
@@ -437,6 +437,21 @@ export namespace IntegrationConfigResponse {
437
437
  }
438
438
  }
439
439
 
440
+ export interface EntitlementListParams extends DefaultPageNumberPaginationParams {
441
+ /**
442
+ * Filter by integration type
443
+ */
444
+ integration_type?:
445
+ | 'discord'
446
+ | 'telegram'
447
+ | 'github'
448
+ | 'figma'
449
+ | 'framer'
450
+ | 'notion'
451
+ | 'digital_files'
452
+ | 'license_key';
453
+ }
454
+
440
455
  export interface EntitlementCreateParams {
441
456
  /**
442
457
  * Platform-specific configuration (validated per integration_type)
@@ -478,21 +493,6 @@ export interface EntitlementUpdateParams {
478
493
  name?: string | null;
479
494
  }
480
495
 
481
- export interface EntitlementListParams extends DefaultPageNumberPaginationParams {
482
- /**
483
- * Filter by integration type
484
- */
485
- integration_type?:
486
- | 'discord'
487
- | 'telegram'
488
- | 'github'
489
- | 'figma'
490
- | 'framer'
491
- | 'notion'
492
- | 'digital_files'
493
- | 'license_key';
494
- }
495
-
496
496
  Entitlements.Files = Files;
497
497
  Entitlements.Grants = Grants;
498
498
 
@@ -504,9 +504,9 @@ export declare namespace Entitlements {
504
504
  type IntegrationConfig as IntegrationConfig,
505
505
  type IntegrationConfigResponse as IntegrationConfigResponse,
506
506
  type EntitlementsDefaultPageNumberPagination as EntitlementsDefaultPageNumberPagination,
507
+ type EntitlementListParams as EntitlementListParams,
507
508
  type EntitlementCreateParams as EntitlementCreateParams,
508
509
  type EntitlementUpdateParams as EntitlementUpdateParams,
509
- type EntitlementListParams as EntitlementListParams,
510
510
  };
511
511
 
512
512
  export {
@@ -7,6 +7,13 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class Files extends APIResource {
10
+ /**
11
+ * Attach a file to a `digital_files` entitlement. Per-file size cap: 500 MiB.
12
+ */
13
+ upload(id: string, options?: RequestOptions): APIPromise<FileUploadResponse> {
14
+ return this._client.post(path`/entitlements/${id}/files`, options);
15
+ }
16
+
10
17
  /**
11
18
  * Detach a previously-attached file from a `digital_files` entitlement.
12
19
  */
@@ -17,13 +24,6 @@ export class Files extends APIResource {
17
24
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
18
25
  });
19
26
  }
20
-
21
- /**
22
- * Attach a file to a `digital_files` entitlement. Per-file size cap: 500 MiB.
23
- */
24
- upload(id: string, options?: RequestOptions): APIPromise<FileUploadResponse> {
25
- return this._client.post(path`/entitlements/${id}/files`, options);
26
- }
27
27
  }
28
28
 
29
29
  export interface FileUploadResponse {
@@ -7,9 +7,9 @@ export {
7
7
  type GitHubPermission,
8
8
  type IntegrationConfig,
9
9
  type IntegrationConfigResponse,
10
+ type EntitlementListParams,
10
11
  type EntitlementCreateParams,
11
12
  type EntitlementUpdateParams,
12
- type EntitlementListParams,
13
13
  type EntitlementsDefaultPageNumberPagination,
14
14
  } from './entitlements';
15
15
  export { Files, type FileUploadResponse, type FileDeleteParams } from './files';
@@ -4,9 +4,9 @@ export {
4
4
  Addons,
5
5
  type AddonResponse,
6
6
  type AddonUpdateImagesResponse,
7
+ type AddonListParams,
7
8
  type AddonCreateParams,
8
9
  type AddonUpdateParams,
9
- type AddonListParams,
10
10
  type AddonResponsesDefaultPageNumberPagination,
11
11
  } from './addons';
12
12
  export {
@@ -44,9 +44,9 @@ export {
44
44
  CreditEntitlements,
45
45
  type CbbOverageBehavior,
46
46
  type CreditEntitlement,
47
+ type CreditEntitlementListParams,
47
48
  type CreditEntitlementCreateParams,
48
49
  type CreditEntitlementUpdateParams,
49
- type CreditEntitlementListParams,
50
50
  type CreditEntitlementsDefaultPageNumberPagination,
51
51
  } from './credit-entitlements/credit-entitlements';
52
52
  export {
@@ -56,9 +56,9 @@ export {
56
56
  type CustomerListCreditEntitlementsResponse,
57
57
  type CustomerListEntitlementsResponse,
58
58
  type CustomerRetrievePaymentMethodsResponse,
59
+ type CustomerListParams,
59
60
  type CustomerCreateParams,
60
61
  type CustomerUpdateParams,
61
- type CustomerListParams,
62
62
  type CustomerDeletePaymentMethodParams,
63
63
  type CustomersDefaultPageNumberPagination,
64
64
  } from './customers/customers';
@@ -67,9 +67,9 @@ export {
67
67
  type Discount,
68
68
  type DiscountDetail,
69
69
  type DiscountType,
70
+ type DiscountListParams,
70
71
  type DiscountCreateParams,
71
72
  type DiscountUpdateParams,
72
- type DiscountListParams,
73
73
  type DiscountsDefaultPageNumberPagination,
74
74
  } from './discounts';
75
75
  export {
@@ -89,26 +89,26 @@ export {
89
89
  type GitHubPermission,
90
90
  type IntegrationConfig,
91
91
  type IntegrationConfigResponse,
92
+ type EntitlementListParams,
92
93
  type EntitlementCreateParams,
93
94
  type EntitlementUpdateParams,
94
- type EntitlementListParams,
95
95
  type EntitlementsDefaultPageNumberPagination,
96
96
  } from './entitlements/entitlements';
97
97
  export { Invoices } from './invoices/invoices';
98
98
  export {
99
99
  LicenseKeyInstances,
100
100
  type LicenseKeyInstance,
101
- type LicenseKeyInstanceUpdateParams,
102
101
  type LicenseKeyInstanceListParams,
102
+ type LicenseKeyInstanceUpdateParams,
103
103
  type LicenseKeyInstancesDefaultPageNumberPagination,
104
104
  } from './license-key-instances';
105
105
  export {
106
106
  LicenseKeys,
107
107
  type LicenseKey,
108
108
  type LicenseKeyStatus,
109
- type LicenseKeyCreateParams,
110
- type LicenseKeyUpdateParams,
111
109
  type LicenseKeyListParams,
110
+ type LicenseKeyUpdateParams,
111
+ type LicenseKeyCreateParams,
112
112
  type LicenseKeysDefaultPageNumberPagination,
113
113
  } from './license-keys';
114
114
  export {
@@ -127,8 +127,8 @@ export {
127
127
  type Meter,
128
128
  type MeterAggregation,
129
129
  type MeterFilter,
130
- type MeterCreateParams,
131
130
  type MeterListParams,
131
+ type MeterCreateParams,
132
132
  type MetersDefaultPageNumberPagination,
133
133
  } from './meters';
134
134
  export {
@@ -156,8 +156,8 @@ export {
156
156
  type PaymentCreateResponse,
157
157
  type PaymentListResponse,
158
158
  type PaymentRetrieveLineItemsResponse,
159
- type PaymentCreateParams,
160
159
  type PaymentListParams,
160
+ type PaymentCreateParams,
161
161
  type RefundListItemsDefaultPageNumberPagination,
162
162
  type PaymentListResponsesDefaultPageNumberPagination,
163
163
  } from './payments';
@@ -173,9 +173,9 @@ export {
173
173
  type ProductCollectionListResponse,
174
174
  type ProductCollectionUnarchiveResponse,
175
175
  type ProductCollectionUpdateImagesResponse,
176
+ type ProductCollectionListParams,
176
177
  type ProductCollectionCreateParams,
177
178
  type ProductCollectionUpdateParams,
178
- type ProductCollectionListParams,
179
179
  type ProductCollectionUpdateImagesParams,
180
180
  type ProductCollectionListResponsesDefaultPageNumberPagination,
181
181
  } from './product-collections/product-collections';
@@ -194,9 +194,9 @@ export {
194
194
  type ProductEntitlementSummary,
195
195
  type ProductListResponse,
196
196
  type ProductUpdateFilesResponse,
197
+ type ProductListParams,
197
198
  type ProductCreateParams,
198
199
  type ProductUpdateParams,
199
- type ProductListParams,
200
200
  type ProductUpdateFilesParams,
201
201
  type ProductListResponsesDefaultPageNumberPagination,
202
202
  } from './products/products';
@@ -204,8 +204,8 @@ export {
204
204
  Refunds,
205
205
  type Refund,
206
206
  type RefundStatus,
207
- type RefundCreateParams,
208
207
  type RefundListParams,
208
+ type RefundCreateParams,
209
209
  } from './refunds';
210
210
  export {
211
211
  Subscriptions,
@@ -228,14 +228,14 @@ export {
228
228
  type SubscriptionRetrieveCreditUsageResponse,
229
229
  type SubscriptionRetrieveUsageHistoryResponse,
230
230
  type SubscriptionUpdatePaymentMethodResponse,
231
+ type SubscriptionListParams,
231
232
  type SubscriptionCreateParams,
232
233
  type SubscriptionUpdateParams,
233
- type SubscriptionListParams,
234
- type SubscriptionChangePlanParams,
235
234
  type SubscriptionChargeParams,
236
- type SubscriptionPreviewChangePlanParams,
235
+ type SubscriptionChangePlanParams,
237
236
  type SubscriptionRetrieveUsageHistoryParams,
238
237
  type SubscriptionUpdatePaymentMethodParams,
238
+ type SubscriptionPreviewChangePlanParams,
239
239
  type SubscriptionListResponsesDefaultPageNumberPagination,
240
240
  type SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination,
241
241
  } from './subscriptions';
@@ -244,8 +244,8 @@ export {
244
244
  type Event,
245
245
  type EventInput,
246
246
  type UsageEventIngestResponse,
247
- type UsageEventListParams,
248
247
  type UsageEventIngestParams,
248
+ type UsageEventListParams,
249
249
  type EventsDefaultPageNumberPagination,
250
250
  } from './usage-events';
251
251
  export { WebhookEvents, type WebhookEventType, type WebhookPayload } from './webhook-events';
@@ -294,8 +294,8 @@ export {
294
294
  type SubscriptionUpdatedWebhookEvent,
295
295
  type UnsafeUnwrapWebhookEvent,
296
296
  type UnwrapWebhookEvent,
297
+ type WebhookListParams,
297
298
  type WebhookCreateParams,
298
299
  type WebhookUpdateParams,
299
- type WebhookListParams,
300
300
  type WebhookDetailsCursorPagePagination,
301
301
  } from './webhooks/webhooks';
@@ -15,16 +15,16 @@ export class Payments extends APIResource {
15
15
  });
16
16
  }
17
17
 
18
- retrievePayout(payoutID: string, options?: RequestOptions): APIPromise<Response> {
19
- return this._client.get(path`/invoices/payouts/${payoutID}`, {
18
+ retrieveRefund(refundID: string, options?: RequestOptions): APIPromise<Response> {
19
+ return this._client.get(path`/invoices/refunds/${refundID}`, {
20
20
  ...options,
21
21
  headers: buildHeaders([{ Accept: 'application/pdf' }, options?.headers]),
22
22
  __binaryResponse: true,
23
23
  });
24
24
  }
25
25
 
26
- retrieveRefund(refundID: string, options?: RequestOptions): APIPromise<Response> {
27
- return this._client.get(path`/invoices/refunds/${refundID}`, {
26
+ retrievePayout(payoutID: string, options?: RequestOptions): APIPromise<Response> {
27
+ return this._client.get(path`/invoices/payouts/${payoutID}`, {
28
28
  ...options,
29
29
  headers: buildHeaders([{ Accept: 'application/pdf' }, options?.headers]),
30
30
  __binaryResponse: true,