@stigg/typescript 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (317) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +40 -0
  3. package/client.d.mts +6 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +23 -21
  8. package/client.js.map +1 -1
  9. package/client.mjs +24 -22
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +11 -5
  12. package/core/pagination.d.mts.map +1 -1
  13. package/core/pagination.d.ts +11 -5
  14. package/core/pagination.d.ts.map +1 -1
  15. package/core/pagination.js +9 -9
  16. package/core/pagination.js.map +1 -1
  17. package/core/pagination.mjs +9 -9
  18. package/core/pagination.mjs.map +1 -1
  19. package/internal/parse.d.mts.map +1 -1
  20. package/internal/parse.d.ts.map +1 -1
  21. package/internal/parse.js +5 -0
  22. package/internal/parse.js.map +1 -1
  23. package/internal/parse.mjs +5 -0
  24. package/internal/parse.mjs.map +1 -1
  25. package/internal/qs/formats.d.mts +7 -0
  26. package/internal/qs/formats.d.mts.map +1 -0
  27. package/internal/qs/formats.d.ts +7 -0
  28. package/internal/qs/formats.d.ts.map +1 -0
  29. package/internal/qs/formats.js +13 -0
  30. package/internal/qs/formats.js.map +1 -0
  31. package/internal/qs/formats.mjs +9 -0
  32. package/internal/qs/formats.mjs.map +1 -0
  33. package/internal/qs/index.d.mts +10 -0
  34. package/internal/qs/index.d.mts.map +1 -0
  35. package/internal/qs/index.d.ts +10 -0
  36. package/internal/qs/index.d.ts.map +1 -0
  37. package/internal/qs/index.js +14 -0
  38. package/internal/qs/index.js.map +1 -0
  39. package/internal/qs/index.mjs +10 -0
  40. package/internal/qs/index.mjs.map +1 -0
  41. package/internal/qs/stringify.d.mts +3 -0
  42. package/internal/qs/stringify.d.mts.map +1 -0
  43. package/internal/qs/stringify.d.ts +3 -0
  44. package/internal/qs/stringify.d.ts.map +1 -0
  45. package/internal/qs/stringify.js +277 -0
  46. package/internal/qs/stringify.js.map +1 -0
  47. package/internal/qs/stringify.mjs +274 -0
  48. package/internal/qs/stringify.mjs.map +1 -0
  49. package/internal/qs/types.d.mts +57 -0
  50. package/internal/qs/types.d.mts.map +1 -0
  51. package/internal/qs/types.d.ts +57 -0
  52. package/internal/qs/types.d.ts.map +1 -0
  53. package/internal/qs/types.js +3 -0
  54. package/internal/qs/types.js.map +1 -0
  55. package/internal/qs/types.mjs +2 -0
  56. package/internal/qs/types.mjs.map +1 -0
  57. package/internal/qs/utils.d.mts +15 -0
  58. package/internal/qs/utils.d.mts.map +1 -0
  59. package/internal/qs/utils.d.ts +15 -0
  60. package/internal/qs/utils.d.ts.map +1 -0
  61. package/internal/qs/utils.js +230 -0
  62. package/internal/qs/utils.js.map +1 -0
  63. package/internal/qs/utils.mjs +217 -0
  64. package/internal/qs/utils.mjs.map +1 -0
  65. package/package.json +1 -1
  66. package/resources/index.d.mts +1 -1
  67. package/resources/index.d.mts.map +1 -1
  68. package/resources/index.d.ts +1 -1
  69. package/resources/index.d.ts.map +1 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +1 -1
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/v1/addons/addons.d.mts +1298 -0
  74. package/resources/v1/addons/addons.d.mts.map +1 -0
  75. package/resources/v1/addons/addons.d.ts +1298 -0
  76. package/resources/v1/addons/addons.d.ts.map +1 -0
  77. package/resources/v1/addons/addons.js +78 -0
  78. package/resources/v1/addons/addons.js.map +1 -0
  79. package/resources/v1/addons/addons.mjs +73 -0
  80. package/resources/v1/addons/addons.mjs.map +1 -0
  81. package/resources/v1/addons/entitlements.d.mts +747 -0
  82. package/resources/v1/addons/entitlements.d.mts.map +1 -0
  83. package/resources/v1/addons/entitlements.d.ts +747 -0
  84. package/resources/v1/addons/entitlements.d.ts.map +1 -0
  85. package/resources/v1/addons/entitlements.js +36 -0
  86. package/resources/v1/addons/entitlements.js.map +1 -0
  87. package/resources/v1/addons/entitlements.mjs +32 -0
  88. package/resources/v1/addons/entitlements.mjs.map +1 -0
  89. package/resources/v1/addons/index.d.mts +3 -0
  90. package/resources/v1/addons/index.d.mts.map +1 -0
  91. package/resources/v1/addons/index.d.ts +3 -0
  92. package/resources/v1/addons/index.d.ts.map +1 -0
  93. package/resources/v1/addons/index.js +9 -0
  94. package/resources/v1/addons/index.js.map +1 -0
  95. package/resources/v1/addons/index.mjs +4 -0
  96. package/resources/v1/addons/index.mjs.map +1 -0
  97. package/resources/v1/addons.d.mts +2 -0
  98. package/resources/v1/addons.d.mts.map +1 -0
  99. package/resources/v1/addons.d.ts +2 -0
  100. package/resources/v1/addons.d.ts.map +1 -0
  101. package/resources/v1/addons.js +6 -0
  102. package/resources/v1/addons.js.map +1 -0
  103. package/resources/v1/addons.mjs +3 -0
  104. package/resources/v1/addons.mjs.map +1 -0
  105. package/resources/v1/coupons.d.mts +154 -157
  106. package/resources/v1/coupons.d.mts.map +1 -1
  107. package/resources/v1/coupons.d.ts +154 -157
  108. package/resources/v1/coupons.d.ts.map +1 -1
  109. package/resources/v1/coupons.js +21 -4
  110. package/resources/v1/coupons.js.map +1 -1
  111. package/resources/v1/coupons.mjs +21 -4
  112. package/resources/v1/coupons.mjs.map +1 -1
  113. package/resources/v1/customers/customers.d.mts +247 -118
  114. package/resources/v1/customers/customers.d.mts.map +1 -1
  115. package/resources/v1/customers/customers.d.ts +247 -118
  116. package/resources/v1/customers/customers.d.ts.map +1 -1
  117. package/resources/v1/customers/customers.js +37 -16
  118. package/resources/v1/customers/customers.js.map +1 -1
  119. package/resources/v1/customers/customers.mjs +37 -16
  120. package/resources/v1/customers/customers.mjs.map +1 -1
  121. package/resources/v1/customers/index.d.mts +2 -2
  122. package/resources/v1/customers/index.d.mts.map +1 -1
  123. package/resources/v1/customers/index.d.ts +2 -2
  124. package/resources/v1/customers/index.d.ts.map +1 -1
  125. package/resources/v1/customers/index.js +3 -3
  126. package/resources/v1/customers/index.js.map +1 -1
  127. package/resources/v1/customers/index.mjs +1 -1
  128. package/resources/v1/customers/index.mjs.map +1 -1
  129. package/resources/v1/customers/payment-method.d.mts +7 -2
  130. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  131. package/resources/v1/customers/payment-method.d.ts +7 -2
  132. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  133. package/resources/v1/customers/payment-method.js +4 -2
  134. package/resources/v1/customers/payment-method.js.map +1 -1
  135. package/resources/v1/customers/payment-method.mjs +4 -2
  136. package/resources/v1/customers/payment-method.mjs.map +1 -1
  137. package/resources/v1/customers/promotional-entitlements.d.mts +498 -0
  138. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
  139. package/resources/v1/customers/promotional-entitlements.d.ts +498 -0
  140. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
  141. package/resources/v1/customers/promotional-entitlements.js +32 -0
  142. package/resources/v1/customers/promotional-entitlements.js.map +1 -0
  143. package/resources/v1/customers/promotional-entitlements.mjs +28 -0
  144. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
  145. package/resources/v1/events.d.mts +63 -0
  146. package/resources/v1/events.d.mts.map +1 -0
  147. package/resources/v1/events.d.ts +63 -0
  148. package/resources/v1/events.d.ts.map +1 -0
  149. package/resources/v1/events.js +16 -0
  150. package/resources/v1/events.js.map +1 -0
  151. package/resources/v1/events.mjs +12 -0
  152. package/resources/v1/events.mjs.map +1 -0
  153. package/resources/v1/features.d.mts +444 -0
  154. package/resources/v1/features.d.mts.map +1 -0
  155. package/resources/v1/features.d.ts +444 -0
  156. package/resources/v1/features.d.ts.map +1 -0
  157. package/resources/v1/features.js +51 -0
  158. package/resources/v1/features.js.map +1 -0
  159. package/resources/v1/features.mjs +47 -0
  160. package/resources/v1/features.mjs.map +1 -0
  161. package/resources/v1/index.d.mts +10 -4
  162. package/resources/v1/index.d.mts.map +1 -1
  163. package/resources/v1/index.d.ts +10 -4
  164. package/resources/v1/index.d.ts.map +1 -1
  165. package/resources/v1/index.js +17 -5
  166. package/resources/v1/index.js.map +1 -1
  167. package/resources/v1/index.mjs +7 -1
  168. package/resources/v1/index.mjs.map +1 -1
  169. package/resources/v1/plans/entitlements.d.mts +747 -0
  170. package/resources/v1/plans/entitlements.d.mts.map +1 -0
  171. package/resources/v1/plans/entitlements.d.ts +747 -0
  172. package/resources/v1/plans/entitlements.d.ts.map +1 -0
  173. package/resources/v1/plans/entitlements.js +36 -0
  174. package/resources/v1/plans/entitlements.js.map +1 -0
  175. package/resources/v1/plans/entitlements.mjs +32 -0
  176. package/resources/v1/plans/entitlements.mjs.map +1 -0
  177. package/resources/v1/plans/index.d.mts +3 -0
  178. package/resources/v1/plans/index.d.mts.map +1 -0
  179. package/resources/v1/plans/index.d.ts +3 -0
  180. package/resources/v1/plans/index.d.ts.map +1 -0
  181. package/resources/v1/plans/index.js +9 -0
  182. package/resources/v1/plans/index.js.map +1 -0
  183. package/resources/v1/plans/index.mjs +4 -0
  184. package/resources/v1/plans/index.mjs.map +1 -0
  185. package/resources/v1/plans/plans.d.mts +973 -0
  186. package/resources/v1/plans/plans.d.mts.map +1 -0
  187. package/resources/v1/plans/plans.d.ts +973 -0
  188. package/resources/v1/plans/plans.d.ts.map +1 -0
  189. package/resources/v1/plans/plans.js +76 -0
  190. package/resources/v1/plans/plans.js.map +1 -0
  191. package/resources/v1/plans/plans.mjs +71 -0
  192. package/resources/v1/plans/plans.mjs.map +1 -0
  193. package/resources/v1/plans.d.mts +2 -0
  194. package/resources/v1/plans.d.mts.map +1 -0
  195. package/resources/v1/plans.d.ts +2 -0
  196. package/resources/v1/plans.d.ts.map +1 -0
  197. package/resources/v1/plans.js +6 -0
  198. package/resources/v1/plans.js.map +1 -0
  199. package/resources/v1/plans.mjs +3 -0
  200. package/resources/v1/plans.mjs.map +1 -0
  201. package/resources/v1/products.d.mts +332 -0
  202. package/resources/v1/products.d.mts.map +1 -0
  203. package/resources/v1/products.d.ts +332 -0
  204. package/resources/v1/products.d.ts.map +1 -0
  205. package/resources/v1/products.js +52 -0
  206. package/resources/v1/products.js.map +1 -0
  207. package/resources/v1/products.mjs +48 -0
  208. package/resources/v1/products.mjs.map +1 -0
  209. package/resources/v1/subscriptions/future-update.d.mts +12 -19
  210. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  211. package/resources/v1/subscriptions/future-update.d.ts +12 -19
  212. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  213. package/resources/v1/subscriptions/future-update.js +3 -2
  214. package/resources/v1/subscriptions/future-update.js.map +1 -1
  215. package/resources/v1/subscriptions/future-update.mjs +3 -2
  216. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  217. package/resources/v1/subscriptions/index.d.mts +4 -2
  218. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  219. package/resources/v1/subscriptions/index.d.ts +4 -2
  220. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  221. package/resources/v1/subscriptions/index.js +5 -1
  222. package/resources/v1/subscriptions/index.js.map +1 -1
  223. package/resources/v1/subscriptions/index.mjs +3 -1
  224. package/resources/v1/subscriptions/index.mjs.map +1 -1
  225. package/resources/v1/subscriptions/invoice.d.mts +34 -0
  226. package/resources/v1/subscriptions/invoice.d.mts.map +1 -0
  227. package/resources/v1/subscriptions/invoice.d.ts +34 -0
  228. package/resources/v1/subscriptions/invoice.d.ts.map +1 -0
  229. package/resources/v1/subscriptions/invoice.js +17 -0
  230. package/resources/v1/subscriptions/invoice.js.map +1 -0
  231. package/resources/v1/subscriptions/invoice.mjs +13 -0
  232. package/resources/v1/subscriptions/invoice.mjs.map +1 -0
  233. package/resources/v1/subscriptions/subscriptions.d.mts +1565 -518
  234. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  235. package/resources/v1/subscriptions/subscriptions.d.ts +1565 -518
  236. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  237. package/resources/v1/subscriptions/subscriptions.js +52 -12
  238. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  239. package/resources/v1/subscriptions/subscriptions.mjs +53 -13
  240. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  241. package/resources/v1/subscriptions/usage.d.mts +98 -0
  242. package/resources/v1/subscriptions/usage.d.mts.map +1 -0
  243. package/resources/v1/subscriptions/usage.d.ts +98 -0
  244. package/resources/v1/subscriptions/usage.d.ts.map +1 -0
  245. package/resources/v1/subscriptions/usage.js +24 -0
  246. package/resources/v1/subscriptions/usage.js.map +1 -0
  247. package/resources/v1/subscriptions/usage.mjs +20 -0
  248. package/resources/v1/subscriptions/usage.mjs.map +1 -0
  249. package/resources/v1/usage.d.mts +230 -0
  250. package/resources/v1/usage.d.mts.map +1 -0
  251. package/resources/v1/usage.d.ts +230 -0
  252. package/resources/v1/usage.d.ts.map +1 -0
  253. package/resources/v1/usage.js +24 -0
  254. package/resources/v1/usage.js.map +1 -0
  255. package/resources/v1/usage.mjs +20 -0
  256. package/resources/v1/usage.mjs.map +1 -0
  257. package/resources/v1/v1.d.mts +30 -149
  258. package/resources/v1/v1.d.mts.map +1 -1
  259. package/resources/v1/v1.d.ts +30 -149
  260. package/resources/v1/v1.d.ts.map +1 -1
  261. package/resources/v1/v1.js +24 -12
  262. package/resources/v1/v1.js.map +1 -1
  263. package/resources/v1/v1.mjs +24 -12
  264. package/resources/v1/v1.mjs.map +1 -1
  265. package/src/client.ts +33 -40
  266. package/src/core/pagination.ts +24 -18
  267. package/src/internal/parse.ts +6 -0
  268. package/src/internal/qs/LICENSE.md +13 -0
  269. package/src/internal/qs/README.md +3 -0
  270. package/src/internal/qs/formats.ts +10 -0
  271. package/src/internal/qs/index.ts +13 -0
  272. package/src/internal/qs/stringify.ts +385 -0
  273. package/src/internal/qs/types.ts +71 -0
  274. package/src/internal/qs/utils.ts +265 -0
  275. package/src/resources/index.ts +1 -7
  276. package/src/resources/v1/addons/addons.ts +3245 -0
  277. package/src/resources/v1/addons/entitlements.ts +976 -0
  278. package/src/resources/v1/addons/index.ts +26 -0
  279. package/src/resources/v1/addons.ts +3 -0
  280. package/src/resources/v1/coupons.ts +311 -436
  281. package/src/resources/v1/customers/customers.ts +334 -153
  282. package/src/resources/v1/customers/index.ts +17 -2
  283. package/src/resources/v1/customers/payment-method.ts +7 -2
  284. package/src/resources/v1/customers/promotional-entitlements.ts +669 -0
  285. package/src/resources/v1/events.ts +74 -0
  286. package/src/resources/v1/features.ts +571 -0
  287. package/src/resources/v1/index.ts +73 -15
  288. package/src/resources/v1/plans/entitlements.ts +968 -0
  289. package/src/resources/v1/plans/index.ts +24 -0
  290. package/src/resources/v1/plans/plans.ts +2032 -0
  291. package/src/resources/v1/plans.ts +3 -0
  292. package/src/resources/v1/products.ts +423 -0
  293. package/src/resources/v1/subscriptions/future-update.ts +12 -27
  294. package/src/resources/v1/subscriptions/index.ts +16 -11
  295. package/src/resources/v1/subscriptions/invoice.ts +42 -0
  296. package/src/resources/v1/subscriptions/subscriptions.ts +3341 -832
  297. package/src/resources/v1/subscriptions/usage.ts +126 -0
  298. package/src/resources/v1/usage.ts +284 -0
  299. package/src/resources/v1/v1.ts +174 -197
  300. package/src/version.ts +1 -1
  301. package/version.d.mts +1 -1
  302. package/version.d.mts.map +1 -1
  303. package/version.d.ts +1 -1
  304. package/version.d.ts.map +1 -1
  305. package/version.js +1 -1
  306. package/version.js.map +1 -1
  307. package/version.mjs +1 -1
  308. package/version.mjs.map +1 -1
  309. package/resources/v1/customers/usage.d.mts +0 -98
  310. package/resources/v1/customers/usage.d.mts.map +0 -1
  311. package/resources/v1/customers/usage.d.ts +0 -98
  312. package/resources/v1/customers/usage.d.ts.map +0 -1
  313. package/resources/v1/customers/usage.js +0 -20
  314. package/resources/v1/customers/usage.js.map +0 -1
  315. package/resources/v1/customers/usage.mjs +0 -16
  316. package/resources/v1/customers/usage.mjs.map +0 -1
  317. package/src/resources/v1/customers/usage.ts +0 -132
@@ -2,66 +2,86 @@
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as FutureUpdateAPI from './future-update';
5
- import {
6
- FutureUpdate,
7
- FutureUpdateCancelPendingPaymentResponse,
8
- FutureUpdateCancelScheduleResponse,
9
- } from './future-update';
5
+ import { CancelSubscription, FutureUpdate } from './future-update';
6
+ import * as InvoiceAPI from './invoice';
7
+ import { Invoice, InvoiceMarkAsPaidResponse } from './invoice';
8
+ import * as UsageAPI from './usage';
9
+ import { Usage, UsageChargeUsageParams, UsageChargeUsageResponse, UsageSyncResponse } from './usage';
10
10
  import { APIPromise } from '../../../core/api-promise';
11
+ import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
11
12
  import { RequestOptions } from '../../../internal/request-options';
12
13
  import { path } from '../../../internal/utils/path';
13
14
 
14
15
  export class Subscriptions extends APIResource {
15
16
  futureUpdate: FutureUpdateAPI.FutureUpdate = new FutureUpdateAPI.FutureUpdate(this._client);
17
+ usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
18
+ invoice: InvoiceAPI.Invoice = new InvoiceAPI.Invoice(this._client);
16
19
 
17
20
  /**
18
- * Create a new Subscription
21
+ * Retrieves a subscription by its unique identifier, including plan details,
22
+ * billing period, status, and add-ons.
19
23
  */
20
- create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<SubscriptionCreateResponse> {
21
- return this._client.post('/api/v1/subscriptions', { body, ...options });
24
+ retrieve(id: string, options?: RequestOptions): APIPromise<Subscription> {
25
+ return this._client.get(path`/api/v1/subscriptions/${id}`, options);
22
26
  }
23
27
 
24
28
  /**
25
- * Get a single Subscription by id
29
+ * Updates an active subscription's properties including billing period, add-ons,
30
+ * unit quantities, and discounts.
26
31
  */
27
- retrieve(id: string, options?: RequestOptions): APIPromise<SubscriptionRetrieveResponse> {
28
- return this._client.get(path`/api/v1/subscriptions/${id}`, options);
32
+ update(id: string, body: SubscriptionUpdateParams, options?: RequestOptions): APIPromise<Subscription> {
33
+ return this._client.patch(path`/api/v1/subscriptions/${id}`, { body, ...options });
29
34
  }
30
35
 
31
36
  /**
32
- * Get a list of Subscriptions
37
+ * Retrieves a paginated list of subscriptions, with optional filters for customer,
38
+ * status, and plan.
33
39
  */
34
40
  list(
35
41
  query: SubscriptionListParams | null | undefined = {},
36
42
  options?: RequestOptions,
37
- ): APIPromise<SubscriptionListResponse> {
38
- return this._client.get('/api/v1/subscriptions', { query, ...options });
43
+ ): PagePromise<SubscriptionListResponsesMyCursorIDPage, SubscriptionListResponse> {
44
+ return this._client.getAPIList('/api/v1/subscriptions', MyCursorIDPage<SubscriptionListResponse>, {
45
+ query,
46
+ ...options,
47
+ });
39
48
  }
40
49
 
41
50
  /**
42
- * Perform delegate on a Subscription
51
+ * Cancels an active subscription, either immediately or at a specified time such
52
+ * as end of billing period.
43
53
  */
44
- delegate(
45
- id: string,
46
- body: SubscriptionDelegateParams,
47
- options?: RequestOptions,
48
- ): APIPromise<SubscriptionDelegateResponse> {
54
+ cancel(id: string, body: SubscriptionCancelParams, options?: RequestOptions): APIPromise<Subscription> {
55
+ return this._client.post(path`/api/v1/subscriptions/${id}/cancel`, { body, ...options });
56
+ }
57
+
58
+ /**
59
+ * Delegates the payment responsibility of a subscription to a different customer.
60
+ * The delegated customer will be billed for this subscription.
61
+ */
62
+ delegate(id: string, body: SubscriptionDelegateParams, options?: RequestOptions): APIPromise<Subscription> {
49
63
  return this._client.post(path`/api/v1/subscriptions/${id}/delegate`, { body, ...options });
50
64
  }
51
65
 
52
66
  /**
53
- * Perform migrate to latest plan version on a Subscription
67
+ * Imports multiple subscriptions in bulk. Used for migrating subscription data
68
+ * from external systems.
54
69
  */
55
- migrate(
56
- id: string,
57
- body: SubscriptionMigrateParams,
58
- options?: RequestOptions,
59
- ): APIPromise<SubscriptionMigrateResponse> {
70
+ import(body: SubscriptionImportParams, options?: RequestOptions): APIPromise<SubscriptionImportResponse> {
71
+ return this._client.post('/api/v1/subscriptions/import', { body, ...options });
72
+ }
73
+
74
+ /**
75
+ * Migrates a subscription to the latest published version of its plan or add-ons.
76
+ * Handles prorated charges or credits automatically.
77
+ */
78
+ migrate(id: string, body: SubscriptionMigrateParams, options?: RequestOptions): APIPromise<Subscription> {
60
79
  return this._client.post(path`/api/v1/subscriptions/${id}/migrate`, { body, ...options });
61
80
  }
62
81
 
63
82
  /**
64
- * Create a new Subscription Preview
83
+ * Previews the pricing impact of creating or updating a subscription without
84
+ * making changes. Returns estimated costs, taxes, and proration details.
65
85
  */
66
86
  preview(
67
87
  body: SubscriptionPreviewParams,
@@ -71,173 +91,41 @@ export class Subscriptions extends APIResource {
71
91
  }
72
92
 
73
93
  /**
74
- * Perform transfer to resource on a Subscription
94
+ * Creates a new subscription for an existing customer. When payment is required
95
+ * and no payment method exists, returns a checkout URL.
75
96
  */
76
- transfer(
77
- id: string,
78
- body: SubscriptionTransferParams,
97
+ provision(
98
+ body: SubscriptionProvisionParams,
79
99
  options?: RequestOptions,
80
- ): APIPromise<SubscriptionTransferResponse> {
81
- return this._client.post(path`/api/v1/subscriptions/${id}/transfer`, { body, ...options });
82
- }
83
- }
84
-
85
- export interface SubscriptionCreateResponse {
86
- data: SubscriptionCreateResponse.Data;
87
- }
88
-
89
- export namespace SubscriptionCreateResponse {
90
- export interface Data {
91
- /**
92
- * Unique identifier for the provisioned subscription
93
- */
94
- id: string;
95
-
96
- /**
97
- * Provision status: SUCCESS or PAYMENT_REQUIRED
98
- */
99
- status: 'SUCCESS' | 'PAYMENT_REQUIRED';
100
-
101
- /**
102
- * Checkout billing ID when payment is required
103
- */
104
- checkoutBillingId?: string | null;
105
-
106
- /**
107
- * URL to complete payment when PAYMENT_REQUIRED
108
- */
109
- checkoutUrl?: string | null;
110
-
111
- /**
112
- * Whether the subscription is scheduled for future activation
113
- */
114
- isScheduled?: boolean;
115
-
116
- subscription?: Data.Subscription;
100
+ ): APIPromise<SubscriptionProvisionResponse> {
101
+ return this._client.post('/api/v1/subscriptions', { body, ...options });
117
102
  }
118
103
 
119
- export namespace Data {
120
- export interface Subscription {
121
- /**
122
- * Subscription ID
123
- */
124
- id: string;
125
-
126
- /**
127
- * Billing ID
128
- */
129
- billingId: string | null;
130
-
131
- /**
132
- * Created at
133
- */
134
- createdAt: string;
135
-
136
- /**
137
- * Customer ID
138
- */
139
- customerId: string;
140
-
141
- /**
142
- * Payment collection
143
- */
144
- paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
145
-
146
- /**
147
- * Plan ID
148
- */
149
- planId: string;
150
-
151
- /**
152
- * Pricing type
153
- */
154
- pricingType: 'FREE' | 'PAID' | 'CUSTOM';
155
-
156
- /**
157
- * Subscription start date
158
- */
159
- startDate: string;
160
-
161
- /**
162
- * Subscription status
163
- */
164
- status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
165
-
166
- /**
167
- * Subscription cancellation date
168
- */
169
- cancellationDate?: string | null;
170
-
171
- /**
172
- * Subscription cancel reason
173
- */
174
- cancelReason?:
175
- | 'UPGRADE_OR_DOWNGRADE'
176
- | 'CANCELLED_BY_BILLING'
177
- | 'EXPIRED'
178
- | 'DETACH_BILLING'
179
- | 'TRIAL_ENDED'
180
- | 'Immediate'
181
- | 'TRIAL_CONVERTED'
182
- | 'PENDING_PAYMENT_EXPIRED'
183
- | 'ScheduledCancellation'
184
- | 'CustomerArchived'
185
- | 'AutoCancellationRule'
186
- | null;
187
-
188
- /**
189
- * End of the current billing period
190
- */
191
- currentBillingPeriodEnd?: string | null;
192
-
193
- /**
194
- * Start of the current billing period
195
- */
196
- currentBillingPeriodStart?: string | null;
197
-
198
- /**
199
- * Subscription effective end date
200
- */
201
- effectiveEndDate?: string | null;
202
-
203
- /**
204
- * Subscription end date
205
- */
206
- endDate?: string | null;
207
-
208
- /**
209
- * Additional metadata for the subscription
210
- */
211
- metadata?: { [key: string]: string };
212
-
213
- /**
214
- * Paying customer ID for delegated billing
215
- */
216
- payingCustomerId?: string | null;
217
-
218
- /**
219
- * The method used to collect payments for a subscription
220
- */
221
- paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
222
-
223
- /**
224
- * Resource ID
225
- */
226
- resourceId?: string | null;
227
-
228
- /**
229
- * Subscription trial end date
230
- */
231
- trialEndDate?: string | null;
232
- }
104
+ /**
105
+ * Transfers a subscription to a different resource ID. Used for multi-resource
106
+ * products where subscriptions apply to specific entities like websites or apps.
107
+ */
108
+ transfer(id: string, body: SubscriptionTransferParams, options?: RequestOptions): APIPromise<Subscription> {
109
+ return this._client.post(path`/api/v1/subscriptions/${id}/transfer`, { body, ...options });
233
110
  }
234
111
  }
235
112
 
236
- export interface SubscriptionRetrieveResponse {
237
- data: SubscriptionRetrieveResponse.Data;
113
+ export type SubscriptionListResponsesMyCursorIDPage = MyCursorIDPage<SubscriptionListResponse>;
114
+
115
+ /**
116
+ * Response object
117
+ */
118
+ export interface Subscription {
119
+ /**
120
+ * Customer subscription to a plan
121
+ */
122
+ data: Subscription.Data;
238
123
  }
239
124
 
240
- export namespace SubscriptionRetrieveResponse {
125
+ export namespace Subscription {
126
+ /**
127
+ * Customer subscription to a plan
128
+ */
241
129
  export interface Data {
242
130
  /**
243
131
  * Subscription ID
@@ -341,6 +229,8 @@ export namespace SubscriptionRetrieveResponse {
341
229
  */
342
230
  paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
343
231
 
232
+ prices?: Array<Data.Price>;
233
+
344
234
  /**
345
235
  * Resource ID
346
236
  */
@@ -351,455 +241,372 @@ export namespace SubscriptionRetrieveResponse {
351
241
  */
352
242
  trialEndDate?: string | null;
353
243
  }
244
+
245
+ export namespace Data {
246
+ export interface Price {
247
+ /**
248
+ * Price ID
249
+ */
250
+ id: string;
251
+
252
+ /**
253
+ * Creation timestamp
254
+ */
255
+ createdAt: string;
256
+
257
+ /**
258
+ * Last update timestamp
259
+ */
260
+ updatedAt: string;
261
+
262
+ [k: string]: unknown;
263
+ }
264
+ }
354
265
  }
355
266
 
267
+ /**
268
+ * Customer subscription to a plan
269
+ */
356
270
  export interface SubscriptionListResponse {
357
- data: Array<SubscriptionListResponse.Data>;
358
- }
271
+ /**
272
+ * Subscription ID
273
+ */
274
+ id: string;
359
275
 
360
- export namespace SubscriptionListResponse {
361
- export interface Data {
362
- /**
363
- * Subscription ID
364
- */
365
- id: string;
276
+ /**
277
+ * Billing ID
278
+ */
279
+ billingId: string | null;
366
280
 
367
- /**
368
- * Billing ID
369
- */
370
- billingId: string | null;
281
+ /**
282
+ * Created at
283
+ */
284
+ createdAt: string;
371
285
 
372
- /**
373
- * Created at
374
- */
375
- createdAt: string;
286
+ /**
287
+ * Customer ID
288
+ */
289
+ customerId: string;
376
290
 
377
- /**
378
- * Cursor ID for query pagination
379
- */
380
- cursorId: string;
291
+ /**
292
+ * Payment collection
293
+ */
294
+ paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
381
295
 
382
- /**
383
- * Customer ID
384
- */
385
- customerId: string;
296
+ /**
297
+ * Plan ID
298
+ */
299
+ planId: string;
386
300
 
387
- /**
388
- * Payment collection
389
- */
390
- paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
301
+ /**
302
+ * Pricing type
303
+ */
304
+ pricingType: 'FREE' | 'PAID' | 'CUSTOM';
391
305
 
392
- /**
393
- * Plan ID
394
- */
395
- planId: string;
306
+ /**
307
+ * Subscription start date
308
+ */
309
+ startDate: string;
396
310
 
397
- /**
398
- * Pricing type
399
- */
400
- pricingType: 'FREE' | 'PAID' | 'CUSTOM';
311
+ /**
312
+ * Subscription status
313
+ */
314
+ status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
401
315
 
402
- /**
403
- * Subscription start date
404
- */
405
- startDate: string;
316
+ /**
317
+ * Subscription cancellation date
318
+ */
319
+ cancellationDate?: string | null;
406
320
 
407
- /**
408
- * Subscription status
409
- */
410
- status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
321
+ /**
322
+ * Subscription cancel reason
323
+ */
324
+ cancelReason?:
325
+ | 'UPGRADE_OR_DOWNGRADE'
326
+ | 'CANCELLED_BY_BILLING'
327
+ | 'EXPIRED'
328
+ | 'DETACH_BILLING'
329
+ | 'TRIAL_ENDED'
330
+ | 'Immediate'
331
+ | 'TRIAL_CONVERTED'
332
+ | 'PENDING_PAYMENT_EXPIRED'
333
+ | 'ScheduledCancellation'
334
+ | 'CustomerArchived'
335
+ | 'AutoCancellationRule'
336
+ | null;
411
337
 
412
- /**
413
- * Subscription cancellation date
414
- */
415
- cancellationDate?: string | null;
338
+ /**
339
+ * End of the current billing period
340
+ */
341
+ currentBillingPeriodEnd?: string | null;
416
342
 
417
- /**
418
- * Subscription cancel reason
419
- */
420
- cancelReason?:
421
- | 'UPGRADE_OR_DOWNGRADE'
422
- | 'CANCELLED_BY_BILLING'
423
- | 'EXPIRED'
424
- | 'DETACH_BILLING'
425
- | 'TRIAL_ENDED'
426
- | 'Immediate'
427
- | 'TRIAL_CONVERTED'
428
- | 'PENDING_PAYMENT_EXPIRED'
429
- | 'ScheduledCancellation'
430
- | 'CustomerArchived'
431
- | 'AutoCancellationRule'
432
- | null;
343
+ /**
344
+ * Start of the current billing period
345
+ */
346
+ currentBillingPeriodStart?: string | null;
433
347
 
434
- /**
435
- * End of the current billing period
436
- */
437
- currentBillingPeriodEnd?: string | null;
348
+ /**
349
+ * Subscription effective end date
350
+ */
351
+ effectiveEndDate?: string | null;
438
352
 
439
- /**
440
- * Start of the current billing period
441
- */
442
- currentBillingPeriodStart?: string | null;
353
+ /**
354
+ * Subscription end date
355
+ */
356
+ endDate?: string | null;
443
357
 
444
- /**
445
- * Subscription effective end date
446
- */
447
- effectiveEndDate?: string | null;
358
+ /**
359
+ * Additional metadata for the subscription
360
+ */
361
+ metadata?: { [key: string]: string };
448
362
 
449
- /**
450
- * Subscription end date
451
- */
452
- endDate?: string | null;
363
+ /**
364
+ * Paying customer ID for delegated billing
365
+ */
366
+ payingCustomerId?: string | null;
453
367
 
454
- /**
455
- * Additional metadata for the subscription
456
- */
457
- metadata?: { [key: string]: string };
368
+ /**
369
+ * The method used to collect payments for a subscription
370
+ */
371
+ paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
458
372
 
459
- /**
460
- * Paying customer ID for delegated billing
461
- */
462
- payingCustomerId?: string | null;
373
+ prices?: Array<SubscriptionListResponse.Price>;
374
+
375
+ /**
376
+ * Resource ID
377
+ */
378
+ resourceId?: string | null;
379
+
380
+ /**
381
+ * Subscription trial end date
382
+ */
383
+ trialEndDate?: string | null;
384
+ }
463
385
 
386
+ export namespace SubscriptionListResponse {
387
+ export interface Price {
464
388
  /**
465
- * The method used to collect payments for a subscription
389
+ * Price ID
466
390
  */
467
- paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
391
+ id: string;
468
392
 
469
393
  /**
470
- * Resource ID
394
+ * Creation timestamp
471
395
  */
472
- resourceId?: string | null;
396
+ createdAt: string;
473
397
 
474
398
  /**
475
- * Subscription trial end date
399
+ * Last update timestamp
476
400
  */
477
- trialEndDate?: string | null;
401
+ updatedAt: string;
402
+
403
+ [k: string]: unknown;
478
404
  }
479
405
  }
480
406
 
481
- export interface SubscriptionDelegateResponse {
482
- data: SubscriptionDelegateResponse.Data;
407
+ /**
408
+ * Response object
409
+ */
410
+ export interface SubscriptionImportResponse {
411
+ data: SubscriptionImportResponse.Data;
483
412
  }
484
413
 
485
- export namespace SubscriptionDelegateResponse {
414
+ export namespace SubscriptionImportResponse {
486
415
  export interface Data {
487
416
  /**
488
- * Subscription ID
417
+ * Unique identifier for the import task
489
418
  */
490
- id: string;
419
+ taskId: string;
420
+ }
421
+ }
491
422
 
492
- /**
493
- * Billing ID
494
- */
495
- billingId: string | null;
423
+ /**
424
+ * Response object
425
+ */
426
+ export interface SubscriptionPreviewResponse {
427
+ /**
428
+ * Pricing preview with invoices
429
+ */
430
+ data: SubscriptionPreviewResponse.Data;
431
+ }
496
432
 
433
+ export namespace SubscriptionPreviewResponse {
434
+ /**
435
+ * Pricing preview with invoices
436
+ */
437
+ export interface Data {
497
438
  /**
498
- * Created at
439
+ * Invoice due immediately
499
440
  */
500
- createdAt: string;
441
+ immediateInvoice: Data.ImmediateInvoice;
501
442
 
502
443
  /**
503
- * Customer ID
444
+ * Billing period range
504
445
  */
505
- customerId: string;
446
+ billingPeriodRange?: Data.BillingPeriodRange;
506
447
 
507
448
  /**
508
- * Payment collection
449
+ * Free items included
509
450
  */
510
- paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
451
+ freeItems?: Array<Data.FreeItem>;
511
452
 
512
453
  /**
513
- * Plan ID
454
+ * Whether updates are scheduled
514
455
  */
515
- planId: string;
456
+ hasScheduledUpdates?: boolean;
516
457
 
517
458
  /**
518
- * Pricing type
459
+ * Whether this is a downgrade
519
460
  */
520
- pricingType: 'FREE' | 'PAID' | 'CUSTOM';
461
+ isPlanDowngrade?: boolean;
521
462
 
522
463
  /**
523
- * Subscription start date
464
+ * Recurring invoice preview
524
465
  */
525
- startDate: string;
466
+ recurringInvoice?: Data.RecurringInvoice;
467
+ }
526
468
 
469
+ export namespace Data {
527
470
  /**
528
- * Subscription status
471
+ * Invoice due immediately
529
472
  */
530
- status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
473
+ export interface ImmediateInvoice {
474
+ /**
475
+ * Subtotal before discounts
476
+ */
477
+ subTotal: number;
531
478
 
532
- /**
533
- * Subscription cancellation date
534
- */
535
- cancellationDate?: string | null;
479
+ /**
480
+ * Invoice total
481
+ */
482
+ total: number;
536
483
 
537
- /**
538
- * Subscription cancel reason
539
- */
540
- cancelReason?:
541
- | 'UPGRADE_OR_DOWNGRADE'
542
- | 'CANCELLED_BY_BILLING'
543
- | 'EXPIRED'
544
- | 'DETACH_BILLING'
545
- | 'TRIAL_ENDED'
546
- | 'Immediate'
547
- | 'TRIAL_CONVERTED'
548
- | 'PENDING_PAYMENT_EXPIRED'
549
- | 'ScheduledCancellation'
550
- | 'CustomerArchived'
551
- | 'AutoCancellationRule'
552
- | null;
484
+ /**
485
+ * Billing period covered
486
+ */
487
+ billingPeriodRange?: ImmediateInvoice.BillingPeriodRange;
553
488
 
554
- /**
555
- * End of the current billing period
556
- */
557
- currentBillingPeriodEnd?: string | null;
489
+ /**
490
+ * Currency code
491
+ */
492
+ currency?: string | null;
558
493
 
559
- /**
560
- * Start of the current billing period
561
- */
562
- currentBillingPeriodStart?: string | null;
494
+ /**
495
+ * Total discount amount
496
+ */
497
+ discount?: number;
563
498
 
564
- /**
565
- * Subscription effective end date
566
- */
567
- effectiveEndDate?: string | null;
499
+ /**
500
+ * Discount breakdown
501
+ */
502
+ discountDetails?: ImmediateInvoice.DiscountDetails;
568
503
 
569
- /**
570
- * Subscription end date
571
- */
572
- endDate?: string | null;
504
+ /**
505
+ * Applied discounts
506
+ */
507
+ discounts?: Array<ImmediateInvoice.Discount>;
573
508
 
574
- /**
575
- * Additional metadata for the subscription
576
- */
577
- metadata?: { [key: string]: string };
509
+ /**
510
+ * Line items
511
+ */
512
+ lines?: Array<ImmediateInvoice.Line>;
578
513
 
579
- /**
580
- * Paying customer ID for delegated billing
581
- */
582
- payingCustomerId?: string | null;
514
+ /**
515
+ * Tax amount
516
+ */
517
+ tax?: number;
518
+ }
583
519
 
584
- /**
585
- * The method used to collect payments for a subscription
586
- */
587
- paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
520
+ export namespace ImmediateInvoice {
521
+ /**
522
+ * Billing period covered
523
+ */
524
+ export interface BillingPeriodRange {
525
+ /**
526
+ * Billing period end date
527
+ */
528
+ end: string;
588
529
 
589
- /**
590
- * Resource ID
591
- */
592
- resourceId?: string | null;
530
+ /**
531
+ * Billing period start date
532
+ */
533
+ start: string;
534
+ }
593
535
 
594
- /**
595
- * Subscription trial end date
596
- */
597
- trialEndDate?: string | null;
598
- }
599
- }
536
+ /**
537
+ * Discount breakdown
538
+ */
539
+ export interface DiscountDetails {
540
+ /**
541
+ * Promo code used
542
+ */
543
+ code?: string;
600
544
 
601
- export interface SubscriptionMigrateResponse {
602
- data: SubscriptionMigrateResponse.Data;
603
- }
545
+ /**
546
+ * Fixed discount amount
547
+ */
548
+ fixedAmount?: number;
604
549
 
605
- export namespace SubscriptionMigrateResponse {
606
- export interface Data {
607
- /**
608
- * Subscription ID
609
- */
610
- id: string;
550
+ /**
551
+ * Percentage discount
552
+ */
553
+ percentage?: number;
554
+ }
611
555
 
612
- /**
613
- * Billing ID
614
- */
615
- billingId: string | null;
556
+ /**
557
+ * Applied discount amount
558
+ */
559
+ export interface Discount {
560
+ /**
561
+ * Discount amount
562
+ */
563
+ amount: number;
616
564
 
617
- /**
618
- * Created at
619
- */
620
- createdAt: string;
565
+ /**
566
+ * Currency code
567
+ */
568
+ currency: string;
621
569
 
622
- /**
623
- * Customer ID
624
- */
625
- customerId: string;
570
+ /**
571
+ * Discount description
572
+ */
573
+ description: string;
574
+ }
626
575
 
627
- /**
628
- * Payment collection
629
- */
630
- paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
631
-
632
- /**
633
- * Plan ID
634
- */
635
- planId: string;
636
-
637
- /**
638
- * Pricing type
639
- */
640
- pricingType: 'FREE' | 'PAID' | 'CUSTOM';
641
-
642
- /**
643
- * Subscription start date
644
- */
645
- startDate: string;
646
-
647
- /**
648
- * Subscription status
649
- */
650
- status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
651
-
652
- /**
653
- * Subscription cancellation date
654
- */
655
- cancellationDate?: string | null;
656
-
657
- /**
658
- * Subscription cancel reason
659
- */
660
- cancelReason?:
661
- | 'UPGRADE_OR_DOWNGRADE'
662
- | 'CANCELLED_BY_BILLING'
663
- | 'EXPIRED'
664
- | 'DETACH_BILLING'
665
- | 'TRIAL_ENDED'
666
- | 'Immediate'
667
- | 'TRIAL_CONVERTED'
668
- | 'PENDING_PAYMENT_EXPIRED'
669
- | 'ScheduledCancellation'
670
- | 'CustomerArchived'
671
- | 'AutoCancellationRule'
672
- | null;
673
-
674
- /**
675
- * End of the current billing period
676
- */
677
- currentBillingPeriodEnd?: string | null;
678
-
679
- /**
680
- * Start of the current billing period
681
- */
682
- currentBillingPeriodStart?: string | null;
683
-
684
- /**
685
- * Subscription effective end date
686
- */
687
- effectiveEndDate?: string | null;
688
-
689
- /**
690
- * Subscription end date
691
- */
692
- endDate?: string | null;
693
-
694
- /**
695
- * Additional metadata for the subscription
696
- */
697
- metadata?: { [key: string]: string };
698
-
699
- /**
700
- * Paying customer ID for delegated billing
701
- */
702
- payingCustomerId?: string | null;
703
-
704
- /**
705
- * The method used to collect payments for a subscription
706
- */
707
- paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
708
-
709
- /**
710
- * Resource ID
711
- */
712
- resourceId?: string | null;
713
-
714
- /**
715
- * Subscription trial end date
716
- */
717
- trialEndDate?: string | null;
718
- }
719
- }
720
-
721
- export interface SubscriptionPreviewResponse {
722
- data: SubscriptionPreviewResponse.Data;
723
- }
724
-
725
- export namespace SubscriptionPreviewResponse {
726
- export interface Data {
727
- immediateInvoice: Data.ImmediateInvoice;
728
-
729
- billingPeriodRange?: Data.BillingPeriodRange;
730
-
731
- freeItems?: Array<Data.FreeItem>;
732
-
733
- hasScheduledUpdates?: boolean;
734
-
735
- isPlanDowngrade?: boolean;
736
-
737
- recurringInvoice?: Data.RecurringInvoice;
738
- }
739
-
740
- export namespace Data {
741
- export interface ImmediateInvoice {
742
- subTotal: number;
743
-
744
- total: number;
745
-
746
- billingPeriodRange?: ImmediateInvoice.BillingPeriodRange;
747
-
748
- currency?: string | null;
749
-
750
- discount?: number;
751
-
752
- discountDetails?: ImmediateInvoice.DiscountDetails;
753
-
754
- discounts?: Array<ImmediateInvoice.Discount>;
755
-
756
- lines?: Array<ImmediateInvoice.Line>;
757
-
758
- tax?: number;
759
- }
760
-
761
- export namespace ImmediateInvoice {
762
- export interface BillingPeriodRange {
576
+ /**
577
+ * Invoice line item
578
+ */
579
+ export interface Line {
763
580
  /**
764
- * Billing period end date
581
+ * Currency code
765
582
  */
766
- end: string;
583
+ currency: string;
767
584
 
768
585
  /**
769
- * Billing period start date
586
+ * Line item description
770
587
  */
771
- start: string;
772
- }
773
-
774
- export interface DiscountDetails {
775
- code?: string;
776
-
777
- fixedAmount?: number;
778
-
779
- percentage?: number;
780
- }
781
-
782
- export interface Discount {
783
- amount: number;
784
-
785
- currency: string;
786
-
787
- description: string;
788
- }
789
-
790
- export interface Line {
791
- currency: string;
792
-
793
588
  description: string;
794
589
 
590
+ /**
591
+ * Line subtotal
592
+ */
795
593
  subTotal: number;
796
594
 
595
+ /**
596
+ * Price per unit
597
+ */
797
598
  unitPrice: number;
798
599
 
600
+ /**
601
+ * Quantity
602
+ */
799
603
  quantity?: number;
800
604
  }
801
605
  }
802
606
 
607
+ /**
608
+ * Billing period range
609
+ */
803
610
  export interface BillingPeriodRange {
804
611
  /**
805
612
  * Billing period end date
@@ -812,33 +619,75 @@ export namespace SubscriptionPreviewResponse {
812
619
  start?: string;
813
620
  }
814
621
 
622
+ /**
623
+ * Free item in subscription
624
+ */
815
625
  export interface FreeItem {
626
+ /**
627
+ * Addon ID
628
+ */
816
629
  addonId: string;
817
630
 
631
+ /**
632
+ * Quantity
633
+ */
818
634
  quantity: number;
819
635
  }
820
636
 
637
+ /**
638
+ * Recurring invoice preview
639
+ */
821
640
  export interface RecurringInvoice {
641
+ /**
642
+ * Subtotal before discounts
643
+ */
822
644
  subTotal: number;
823
645
 
646
+ /**
647
+ * Invoice total
648
+ */
824
649
  total: number;
825
650
 
651
+ /**
652
+ * Billing period covered
653
+ */
826
654
  billingPeriodRange?: RecurringInvoice.BillingPeriodRange;
827
655
 
656
+ /**
657
+ * Currency code
658
+ */
828
659
  currency?: string | null;
829
660
 
661
+ /**
662
+ * Total discount amount
663
+ */
830
664
  discount?: number;
831
665
 
666
+ /**
667
+ * Discount breakdown
668
+ */
832
669
  discountDetails?: RecurringInvoice.DiscountDetails;
833
670
 
671
+ /**
672
+ * Applied discounts
673
+ */
834
674
  discounts?: Array<RecurringInvoice.Discount>;
835
675
 
676
+ /**
677
+ * Line items
678
+ */
836
679
  lines?: Array<RecurringInvoice.Line>;
837
680
 
681
+ /**
682
+ * Tax amount
683
+ */
838
684
  tax?: number;
839
685
  }
840
686
 
841
687
  export namespace RecurringInvoice {
688
+ /**
689
+ * Billing period covered
690
+ */
842
691
  export interface BillingPeriodRange {
843
692
  /**
844
693
  * Billing period end date
@@ -851,201 +700,2540 @@ export namespace SubscriptionPreviewResponse {
851
700
  start: string;
852
701
  }
853
702
 
703
+ /**
704
+ * Discount breakdown
705
+ */
854
706
  export interface DiscountDetails {
707
+ /**
708
+ * Promo code used
709
+ */
855
710
  code?: string;
856
711
 
712
+ /**
713
+ * Fixed discount amount
714
+ */
857
715
  fixedAmount?: number;
858
716
 
717
+ /**
718
+ * Percentage discount
719
+ */
859
720
  percentage?: number;
860
721
  }
861
722
 
723
+ /**
724
+ * Applied discount amount
725
+ */
862
726
  export interface Discount {
727
+ /**
728
+ * Discount amount
729
+ */
863
730
  amount: number;
864
731
 
732
+ /**
733
+ * Currency code
734
+ */
865
735
  currency: string;
866
736
 
737
+ /**
738
+ * Discount description
739
+ */
867
740
  description: string;
868
741
  }
869
742
 
743
+ /**
744
+ * Invoice line item
745
+ */
870
746
  export interface Line {
747
+ /**
748
+ * Currency code
749
+ */
871
750
  currency: string;
872
751
 
752
+ /**
753
+ * Line item description
754
+ */
873
755
  description: string;
874
756
 
757
+ /**
758
+ * Line subtotal
759
+ */
875
760
  subTotal: number;
876
761
 
762
+ /**
763
+ * Price per unit
764
+ */
877
765
  unitPrice: number;
878
766
 
767
+ /**
768
+ * Quantity
769
+ */
879
770
  quantity?: number;
880
771
  }
881
772
  }
882
773
  }
883
- }
884
-
885
- export interface SubscriptionTransferResponse {
886
- data: SubscriptionTransferResponse.Data;
887
- }
774
+ }
775
+
776
+ /**
777
+ * Response object
778
+ */
779
+ export interface SubscriptionProvisionResponse {
780
+ /**
781
+ * Provisioning result with status and subscription or checkout URL.
782
+ */
783
+ data: SubscriptionProvisionResponse.Data;
784
+ }
785
+
786
+ export namespace SubscriptionProvisionResponse {
787
+ /**
788
+ * Provisioning result with status and subscription or checkout URL.
789
+ */
790
+ export interface Data {
791
+ /**
792
+ * Unique identifier for the provisioned subscription
793
+ */
794
+ id: string;
795
+
796
+ entitlements: Array<Data.UnionObjectVariant0 | Data.UnionObjectVariant1> | null;
797
+
798
+ /**
799
+ * Provision status: SUCCESS or PAYMENT_REQUIRED
800
+ */
801
+ status: 'SUCCESS' | 'PAYMENT_REQUIRED';
802
+
803
+ /**
804
+ * Created subscription (when status is SUCCESS)
805
+ */
806
+ subscription: Data.Subscription | null;
807
+
808
+ /**
809
+ * Checkout billing ID when payment is required
810
+ */
811
+ checkoutBillingId?: string;
812
+
813
+ /**
814
+ * URL to complete payment when PAYMENT_REQUIRED
815
+ */
816
+ checkoutUrl?: string;
817
+
818
+ /**
819
+ * Whether the subscription is scheduled for future activation
820
+ */
821
+ isScheduled?: boolean;
822
+ }
823
+
824
+ export namespace Data {
825
+ export interface UnionObjectVariant0 {
826
+ accessDeniedReason:
827
+ | 'FeatureNotFound'
828
+ | 'CustomerNotFound'
829
+ | 'CustomerIsArchived'
830
+ | 'CustomerResourceNotFound'
831
+ | 'NoActiveSubscription'
832
+ | 'NoFeatureEntitlementInSubscription'
833
+ | 'RequestedUsageExceedingLimit'
834
+ | 'RequestedValuesMismatch'
835
+ | 'BudgetExceeded'
836
+ | 'Unknown'
837
+ | 'FeatureTypeMismatch'
838
+ | 'Revoked'
839
+ | 'InsufficientCredits'
840
+ | 'EntitlementNotFound'
841
+ | null;
842
+
843
+ isGranted: boolean;
844
+
845
+ type: 'FEATURE';
846
+
847
+ currentUsage?: number;
848
+
849
+ /**
850
+ * Timestamp of the last update to the entitlement grant or configuration.
851
+ */
852
+ entitlementUpdatedAt?: string;
853
+
854
+ feature?: UnionObjectVariant0.Feature;
855
+
856
+ hasUnlimitedUsage?: boolean;
857
+
858
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
859
+
860
+ usageLimit?: number | null;
861
+
862
+ /**
863
+ * The anchor for calculating the usage period for metered entitlements with a
864
+ * reset period configured
865
+ */
866
+ usagePeriodAnchor?: string;
867
+
868
+ /**
869
+ * The end date of the usage period for metered entitlements with a reset period
870
+ * configured
871
+ */
872
+ usagePeriodEnd?: string;
873
+
874
+ /**
875
+ * The start date of the usage period for metered entitlements with a reset period
876
+ * configured
877
+ */
878
+ usagePeriodStart?: string;
879
+
880
+ /**
881
+ * The next time the entitlement should be recalculated
882
+ */
883
+ validUntil?: string;
884
+ }
885
+
886
+ export namespace UnionObjectVariant0 {
887
+ export interface Feature {
888
+ /**
889
+ * The human-readable name of the entitlement, shown in UI elements.
890
+ */
891
+ displayName: string;
892
+
893
+ /**
894
+ * The current status of the feature.
895
+ */
896
+ featureStatus: 'NEW' | 'SUSPENDED' | 'ACTIVE';
897
+
898
+ /**
899
+ * The type of feature associated with the entitlement.
900
+ */
901
+ featureType: 'BOOLEAN' | 'NUMBER' | 'ENUM';
902
+
903
+ /**
904
+ * The unique reference ID of the entitlement.
905
+ */
906
+ refId: string;
907
+ }
908
+ }
909
+
910
+ export interface UnionObjectVariant1 {
911
+ accessDeniedReason:
912
+ | 'FeatureNotFound'
913
+ | 'CustomerNotFound'
914
+ | 'CustomerIsArchived'
915
+ | 'CustomerResourceNotFound'
916
+ | 'NoActiveSubscription'
917
+ | 'NoFeatureEntitlementInSubscription'
918
+ | 'RequestedUsageExceedingLimit'
919
+ | 'RequestedValuesMismatch'
920
+ | 'BudgetExceeded'
921
+ | 'Unknown'
922
+ | 'FeatureTypeMismatch'
923
+ | 'Revoked'
924
+ | 'InsufficientCredits'
925
+ | 'EntitlementNotFound'
926
+ | null;
927
+
928
+ /**
929
+ * The currency associated with a credit entitlement.
930
+ */
931
+ currency: UnionObjectVariant1.Currency;
932
+
933
+ currentUsage: number;
934
+
935
+ isGranted: boolean;
936
+
937
+ type: 'CREDIT';
938
+
939
+ usageLimit: number;
940
+
941
+ /**
942
+ * Timestamp of the last update to the credit usage.
943
+ */
944
+ usageUpdatedAt: string;
945
+
946
+ /**
947
+ * Timestamp of the last update to the entitlement grant or configuration.
948
+ */
949
+ entitlementUpdatedAt?: string;
950
+
951
+ /**
952
+ * The end date of the current billing period for recurring credit grants.
953
+ */
954
+ usagePeriodEnd?: string;
955
+
956
+ /**
957
+ * The next time the entitlement should be recalculated
958
+ */
959
+ validUntil?: string;
960
+ }
961
+
962
+ export namespace UnionObjectVariant1 {
963
+ /**
964
+ * The currency associated with a credit entitlement.
965
+ */
966
+ export interface Currency {
967
+ /**
968
+ * The unique identifier of the custom currency.
969
+ */
970
+ currencyId: string;
971
+
972
+ /**
973
+ * The display name of the currency.
974
+ */
975
+ displayName: string;
976
+
977
+ /**
978
+ * Additional metadata associated with the currency.
979
+ */
980
+ additionalMetaData?: unknown;
981
+
982
+ /**
983
+ * A description of the currency.
984
+ */
985
+ description?: string | null;
986
+
987
+ /**
988
+ * The plural form of the currency unit.
989
+ */
990
+ unitPlural?: string | null;
991
+
992
+ /**
993
+ * The singular form of the currency unit.
994
+ */
995
+ unitSingular?: string | null;
996
+ }
997
+ }
998
+
999
+ /**
1000
+ * Created subscription (when status is SUCCESS)
1001
+ */
1002
+ export interface Subscription {
1003
+ /**
1004
+ * Subscription ID
1005
+ */
1006
+ id: string;
1007
+
1008
+ /**
1009
+ * Billing ID
1010
+ */
1011
+ billingId: string | null;
1012
+
1013
+ /**
1014
+ * Created at
1015
+ */
1016
+ createdAt: string;
1017
+
1018
+ /**
1019
+ * Customer ID
1020
+ */
1021
+ customerId: string;
1022
+
1023
+ /**
1024
+ * Payment collection
1025
+ */
1026
+ paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
1027
+
1028
+ /**
1029
+ * Plan ID
1030
+ */
1031
+ planId: string;
1032
+
1033
+ /**
1034
+ * Pricing type
1035
+ */
1036
+ pricingType: 'FREE' | 'PAID' | 'CUSTOM';
1037
+
1038
+ /**
1039
+ * Subscription start date
1040
+ */
1041
+ startDate: string;
1042
+
1043
+ /**
1044
+ * Subscription status
1045
+ */
1046
+ status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
1047
+
1048
+ /**
1049
+ * Subscription cancellation date
1050
+ */
1051
+ cancellationDate?: string | null;
1052
+
1053
+ /**
1054
+ * Subscription cancel reason
1055
+ */
1056
+ cancelReason?:
1057
+ | 'UPGRADE_OR_DOWNGRADE'
1058
+ | 'CANCELLED_BY_BILLING'
1059
+ | 'EXPIRED'
1060
+ | 'DETACH_BILLING'
1061
+ | 'TRIAL_ENDED'
1062
+ | 'Immediate'
1063
+ | 'TRIAL_CONVERTED'
1064
+ | 'PENDING_PAYMENT_EXPIRED'
1065
+ | 'ScheduledCancellation'
1066
+ | 'CustomerArchived'
1067
+ | 'AutoCancellationRule'
1068
+ | null;
1069
+
1070
+ /**
1071
+ * End of the current billing period
1072
+ */
1073
+ currentBillingPeriodEnd?: string | null;
1074
+
1075
+ /**
1076
+ * Start of the current billing period
1077
+ */
1078
+ currentBillingPeriodStart?: string | null;
1079
+
1080
+ /**
1081
+ * Subscription effective end date
1082
+ */
1083
+ effectiveEndDate?: string | null;
1084
+
1085
+ /**
1086
+ * Subscription end date
1087
+ */
1088
+ endDate?: string | null;
1089
+
1090
+ /**
1091
+ * Additional metadata for the subscription
1092
+ */
1093
+ metadata?: { [key: string]: string };
1094
+
1095
+ /**
1096
+ * Paying customer ID for delegated billing
1097
+ */
1098
+ payingCustomerId?: string | null;
1099
+
1100
+ /**
1101
+ * The method used to collect payments for a subscription
1102
+ */
1103
+ paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
1104
+
1105
+ prices?: Array<Subscription.Price>;
1106
+
1107
+ /**
1108
+ * Resource ID
1109
+ */
1110
+ resourceId?: string | null;
1111
+
1112
+ /**
1113
+ * Subscription trial end date
1114
+ */
1115
+ trialEndDate?: string | null;
1116
+ }
1117
+
1118
+ export namespace Subscription {
1119
+ export interface Price {
1120
+ /**
1121
+ * Addon identifier for the price override
1122
+ */
1123
+ addonId?: string | null;
1124
+
1125
+ /**
1126
+ * Whether this is a base charge override
1127
+ */
1128
+ baseCharge?: boolean;
1129
+
1130
+ /**
1131
+ * Block size for pricing
1132
+ */
1133
+ blockSize?: number;
1134
+
1135
+ /**
1136
+ * Feature identifier for the price override
1137
+ */
1138
+ featureId?: string | null;
1139
+
1140
+ /**
1141
+ * Override price amount
1142
+ */
1143
+ price?: Price.Price;
1144
+
1145
+ /**
1146
+ * Pricing tiers configuration
1147
+ */
1148
+ tiers?: Array<Price.Tier>;
1149
+ }
1150
+
1151
+ export namespace Price {
1152
+ /**
1153
+ * Override price amount
1154
+ */
1155
+ export interface Price {
1156
+ /**
1157
+ * The price amount
1158
+ */
1159
+ amount?: number;
1160
+
1161
+ /**
1162
+ * The billing country code of the price
1163
+ */
1164
+ billingCountryCode?: string | null;
1165
+
1166
+ /**
1167
+ * The price currency
1168
+ */
1169
+ currency?:
1170
+ | 'usd'
1171
+ | 'aed'
1172
+ | 'all'
1173
+ | 'amd'
1174
+ | 'ang'
1175
+ | 'aud'
1176
+ | 'awg'
1177
+ | 'azn'
1178
+ | 'bam'
1179
+ | 'bbd'
1180
+ | 'bdt'
1181
+ | 'bgn'
1182
+ | 'bif'
1183
+ | 'bmd'
1184
+ | 'bnd'
1185
+ | 'bsd'
1186
+ | 'bwp'
1187
+ | 'byn'
1188
+ | 'bzd'
1189
+ | 'brl'
1190
+ | 'cad'
1191
+ | 'cdf'
1192
+ | 'chf'
1193
+ | 'cny'
1194
+ | 'czk'
1195
+ | 'dkk'
1196
+ | 'dop'
1197
+ | 'dzd'
1198
+ | 'egp'
1199
+ | 'etb'
1200
+ | 'eur'
1201
+ | 'fjd'
1202
+ | 'gbp'
1203
+ | 'gel'
1204
+ | 'gip'
1205
+ | 'gmd'
1206
+ | 'gyd'
1207
+ | 'hkd'
1208
+ | 'hrk'
1209
+ | 'htg'
1210
+ | 'idr'
1211
+ | 'ils'
1212
+ | 'inr'
1213
+ | 'isk'
1214
+ | 'jmd'
1215
+ | 'jpy'
1216
+ | 'kes'
1217
+ | 'kgs'
1218
+ | 'khr'
1219
+ | 'kmf'
1220
+ | 'krw'
1221
+ | 'kyd'
1222
+ | 'kzt'
1223
+ | 'lbp'
1224
+ | 'lkr'
1225
+ | 'lrd'
1226
+ | 'lsl'
1227
+ | 'mad'
1228
+ | 'mdl'
1229
+ | 'mga'
1230
+ | 'mkd'
1231
+ | 'mmk'
1232
+ | 'mnt'
1233
+ | 'mop'
1234
+ | 'mro'
1235
+ | 'mvr'
1236
+ | 'mwk'
1237
+ | 'mxn'
1238
+ | 'myr'
1239
+ | 'mzn'
1240
+ | 'nad'
1241
+ | 'ngn'
1242
+ | 'nok'
1243
+ | 'npr'
1244
+ | 'nzd'
1245
+ | 'pgk'
1246
+ | 'php'
1247
+ | 'pkr'
1248
+ | 'pln'
1249
+ | 'qar'
1250
+ | 'ron'
1251
+ | 'rsd'
1252
+ | 'rub'
1253
+ | 'rwf'
1254
+ | 'sar'
1255
+ | 'sbd'
1256
+ | 'scr'
1257
+ | 'sek'
1258
+ | 'sgd'
1259
+ | 'sle'
1260
+ | 'sll'
1261
+ | 'sos'
1262
+ | 'szl'
1263
+ | 'thb'
1264
+ | 'tjs'
1265
+ | 'top'
1266
+ | 'try'
1267
+ | 'ttd'
1268
+ | 'tzs'
1269
+ | 'uah'
1270
+ | 'uzs'
1271
+ | 'vnd'
1272
+ | 'vuv'
1273
+ | 'wst'
1274
+ | 'xaf'
1275
+ | 'xcd'
1276
+ | 'yer'
1277
+ | 'zar'
1278
+ | 'zmw'
1279
+ | 'clp'
1280
+ | 'djf'
1281
+ | 'gnf'
1282
+ | 'ugx'
1283
+ | 'pyg'
1284
+ | 'xof'
1285
+ | 'xpf';
1286
+ }
1287
+
1288
+ export interface Tier {
1289
+ /**
1290
+ * The flat fee price of the price tier
1291
+ */
1292
+ flatPrice?: Tier.FlatPrice;
1293
+
1294
+ /**
1295
+ * The unit price of the price tier
1296
+ */
1297
+ unitPrice?: Tier.UnitPrice;
1298
+
1299
+ /**
1300
+ * The up to quantity of the price tier
1301
+ */
1302
+ upTo?: number;
1303
+ }
1304
+
1305
+ export namespace Tier {
1306
+ /**
1307
+ * The flat fee price of the price tier
1308
+ */
1309
+ export interface FlatPrice {
1310
+ /**
1311
+ * The price amount
1312
+ */
1313
+ amount?: number;
1314
+
1315
+ /**
1316
+ * The billing country code of the price
1317
+ */
1318
+ billingCountryCode?: string | null;
1319
+
1320
+ /**
1321
+ * The price currency
1322
+ */
1323
+ currency?:
1324
+ | 'usd'
1325
+ | 'aed'
1326
+ | 'all'
1327
+ | 'amd'
1328
+ | 'ang'
1329
+ | 'aud'
1330
+ | 'awg'
1331
+ | 'azn'
1332
+ | 'bam'
1333
+ | 'bbd'
1334
+ | 'bdt'
1335
+ | 'bgn'
1336
+ | 'bif'
1337
+ | 'bmd'
1338
+ | 'bnd'
1339
+ | 'bsd'
1340
+ | 'bwp'
1341
+ | 'byn'
1342
+ | 'bzd'
1343
+ | 'brl'
1344
+ | 'cad'
1345
+ | 'cdf'
1346
+ | 'chf'
1347
+ | 'cny'
1348
+ | 'czk'
1349
+ | 'dkk'
1350
+ | 'dop'
1351
+ | 'dzd'
1352
+ | 'egp'
1353
+ | 'etb'
1354
+ | 'eur'
1355
+ | 'fjd'
1356
+ | 'gbp'
1357
+ | 'gel'
1358
+ | 'gip'
1359
+ | 'gmd'
1360
+ | 'gyd'
1361
+ | 'hkd'
1362
+ | 'hrk'
1363
+ | 'htg'
1364
+ | 'idr'
1365
+ | 'ils'
1366
+ | 'inr'
1367
+ | 'isk'
1368
+ | 'jmd'
1369
+ | 'jpy'
1370
+ | 'kes'
1371
+ | 'kgs'
1372
+ | 'khr'
1373
+ | 'kmf'
1374
+ | 'krw'
1375
+ | 'kyd'
1376
+ | 'kzt'
1377
+ | 'lbp'
1378
+ | 'lkr'
1379
+ | 'lrd'
1380
+ | 'lsl'
1381
+ | 'mad'
1382
+ | 'mdl'
1383
+ | 'mga'
1384
+ | 'mkd'
1385
+ | 'mmk'
1386
+ | 'mnt'
1387
+ | 'mop'
1388
+ | 'mro'
1389
+ | 'mvr'
1390
+ | 'mwk'
1391
+ | 'mxn'
1392
+ | 'myr'
1393
+ | 'mzn'
1394
+ | 'nad'
1395
+ | 'ngn'
1396
+ | 'nok'
1397
+ | 'npr'
1398
+ | 'nzd'
1399
+ | 'pgk'
1400
+ | 'php'
1401
+ | 'pkr'
1402
+ | 'pln'
1403
+ | 'qar'
1404
+ | 'ron'
1405
+ | 'rsd'
1406
+ | 'rub'
1407
+ | 'rwf'
1408
+ | 'sar'
1409
+ | 'sbd'
1410
+ | 'scr'
1411
+ | 'sek'
1412
+ | 'sgd'
1413
+ | 'sle'
1414
+ | 'sll'
1415
+ | 'sos'
1416
+ | 'szl'
1417
+ | 'thb'
1418
+ | 'tjs'
1419
+ | 'top'
1420
+ | 'try'
1421
+ | 'ttd'
1422
+ | 'tzs'
1423
+ | 'uah'
1424
+ | 'uzs'
1425
+ | 'vnd'
1426
+ | 'vuv'
1427
+ | 'wst'
1428
+ | 'xaf'
1429
+ | 'xcd'
1430
+ | 'yer'
1431
+ | 'zar'
1432
+ | 'zmw'
1433
+ | 'clp'
1434
+ | 'djf'
1435
+ | 'gnf'
1436
+ | 'ugx'
1437
+ | 'pyg'
1438
+ | 'xof'
1439
+ | 'xpf';
1440
+ }
1441
+
1442
+ /**
1443
+ * The unit price of the price tier
1444
+ */
1445
+ export interface UnitPrice {
1446
+ /**
1447
+ * The price amount
1448
+ */
1449
+ amount?: number;
1450
+
1451
+ /**
1452
+ * The billing country code of the price
1453
+ */
1454
+ billingCountryCode?: string | null;
1455
+
1456
+ /**
1457
+ * The price currency
1458
+ */
1459
+ currency?:
1460
+ | 'usd'
1461
+ | 'aed'
1462
+ | 'all'
1463
+ | 'amd'
1464
+ | 'ang'
1465
+ | 'aud'
1466
+ | 'awg'
1467
+ | 'azn'
1468
+ | 'bam'
1469
+ | 'bbd'
1470
+ | 'bdt'
1471
+ | 'bgn'
1472
+ | 'bif'
1473
+ | 'bmd'
1474
+ | 'bnd'
1475
+ | 'bsd'
1476
+ | 'bwp'
1477
+ | 'byn'
1478
+ | 'bzd'
1479
+ | 'brl'
1480
+ | 'cad'
1481
+ | 'cdf'
1482
+ | 'chf'
1483
+ | 'cny'
1484
+ | 'czk'
1485
+ | 'dkk'
1486
+ | 'dop'
1487
+ | 'dzd'
1488
+ | 'egp'
1489
+ | 'etb'
1490
+ | 'eur'
1491
+ | 'fjd'
1492
+ | 'gbp'
1493
+ | 'gel'
1494
+ | 'gip'
1495
+ | 'gmd'
1496
+ | 'gyd'
1497
+ | 'hkd'
1498
+ | 'hrk'
1499
+ | 'htg'
1500
+ | 'idr'
1501
+ | 'ils'
1502
+ | 'inr'
1503
+ | 'isk'
1504
+ | 'jmd'
1505
+ | 'jpy'
1506
+ | 'kes'
1507
+ | 'kgs'
1508
+ | 'khr'
1509
+ | 'kmf'
1510
+ | 'krw'
1511
+ | 'kyd'
1512
+ | 'kzt'
1513
+ | 'lbp'
1514
+ | 'lkr'
1515
+ | 'lrd'
1516
+ | 'lsl'
1517
+ | 'mad'
1518
+ | 'mdl'
1519
+ | 'mga'
1520
+ | 'mkd'
1521
+ | 'mmk'
1522
+ | 'mnt'
1523
+ | 'mop'
1524
+ | 'mro'
1525
+ | 'mvr'
1526
+ | 'mwk'
1527
+ | 'mxn'
1528
+ | 'myr'
1529
+ | 'mzn'
1530
+ | 'nad'
1531
+ | 'ngn'
1532
+ | 'nok'
1533
+ | 'npr'
1534
+ | 'nzd'
1535
+ | 'pgk'
1536
+ | 'php'
1537
+ | 'pkr'
1538
+ | 'pln'
1539
+ | 'qar'
1540
+ | 'ron'
1541
+ | 'rsd'
1542
+ | 'rub'
1543
+ | 'rwf'
1544
+ | 'sar'
1545
+ | 'sbd'
1546
+ | 'scr'
1547
+ | 'sek'
1548
+ | 'sgd'
1549
+ | 'sle'
1550
+ | 'sll'
1551
+ | 'sos'
1552
+ | 'szl'
1553
+ | 'thb'
1554
+ | 'tjs'
1555
+ | 'top'
1556
+ | 'try'
1557
+ | 'ttd'
1558
+ | 'tzs'
1559
+ | 'uah'
1560
+ | 'uzs'
1561
+ | 'vnd'
1562
+ | 'vuv'
1563
+ | 'wst'
1564
+ | 'xaf'
1565
+ | 'xcd'
1566
+ | 'yer'
1567
+ | 'zar'
1568
+ | 'zmw'
1569
+ | 'clp'
1570
+ | 'djf'
1571
+ | 'gnf'
1572
+ | 'ugx'
1573
+ | 'pyg'
1574
+ | 'xof'
1575
+ | 'xpf';
1576
+ }
1577
+ }
1578
+ }
1579
+ }
1580
+ }
1581
+ }
1582
+
1583
+ export interface SubscriptionUpdateParams {
1584
+ addons?: Array<SubscriptionUpdateParams.Addon>;
1585
+
1586
+ appliedCoupon?: SubscriptionUpdateParams.AppliedCoupon;
1587
+
1588
+ awaitPaymentConfirmation?: boolean;
1589
+
1590
+ billingInformation?: SubscriptionUpdateParams.BillingInformation;
1591
+
1592
+ billingPeriod?: 'MONTHLY' | 'ANNUALLY';
1593
+
1594
+ budget?: SubscriptionUpdateParams.Budget | null;
1595
+
1596
+ charges?: Array<SubscriptionUpdateParams.Charge>;
1597
+
1598
+ /**
1599
+ * Additional metadata for the subscription
1600
+ */
1601
+ metadata?: { [key: string]: string };
1602
+
1603
+ minimumSpend?: SubscriptionUpdateParams.MinimumSpend | null;
1604
+
1605
+ priceOverrides?: Array<SubscriptionUpdateParams.PriceOverride>;
1606
+
1607
+ promotionCode?: string;
1608
+
1609
+ scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
1610
+
1611
+ subscriptionEntitlements?: Array<SubscriptionUpdateParams.SubscriptionEntitlement>;
1612
+
1613
+ /**
1614
+ * Subscription trial end date
1615
+ */
1616
+ trialEndDate?: string;
1617
+ }
1618
+
1619
+ export namespace SubscriptionUpdateParams {
1620
+ export interface Addon {
1621
+ /**
1622
+ * Addon ID
1623
+ */
1624
+ addonId: string;
1625
+
1626
+ quantity: number;
1627
+ }
1628
+
1629
+ export interface AppliedCoupon {
1630
+ billingCouponId?: string;
1631
+
1632
+ configuration?: AppliedCoupon.Configuration;
1633
+
1634
+ couponId?: string;
1635
+
1636
+ discount?: AppliedCoupon.Discount;
1637
+
1638
+ promotionCode?: string | null;
1639
+ }
1640
+
1641
+ export namespace AppliedCoupon {
1642
+ export interface Configuration {
1643
+ /**
1644
+ * Coupon start date
1645
+ */
1646
+ startDate?: string;
1647
+ }
1648
+
1649
+ export interface Discount {
1650
+ amountsOff?: Array<Discount.AmountsOff> | null;
1651
+
1652
+ description?: string;
1653
+
1654
+ durationInMonths?: number;
1655
+
1656
+ name?: string;
1657
+
1658
+ percentOff?: number;
1659
+ }
1660
+
1661
+ export namespace Discount {
1662
+ export interface AmountsOff {
1663
+ amount: number;
1664
+
1665
+ currency?:
1666
+ | 'usd'
1667
+ | 'aed'
1668
+ | 'all'
1669
+ | 'amd'
1670
+ | 'ang'
1671
+ | 'aud'
1672
+ | 'awg'
1673
+ | 'azn'
1674
+ | 'bam'
1675
+ | 'bbd'
1676
+ | 'bdt'
1677
+ | 'bgn'
1678
+ | 'bif'
1679
+ | 'bmd'
1680
+ | 'bnd'
1681
+ | 'bsd'
1682
+ | 'bwp'
1683
+ | 'byn'
1684
+ | 'bzd'
1685
+ | 'brl'
1686
+ | 'cad'
1687
+ | 'cdf'
1688
+ | 'chf'
1689
+ | 'cny'
1690
+ | 'czk'
1691
+ | 'dkk'
1692
+ | 'dop'
1693
+ | 'dzd'
1694
+ | 'egp'
1695
+ | 'etb'
1696
+ | 'eur'
1697
+ | 'fjd'
1698
+ | 'gbp'
1699
+ | 'gel'
1700
+ | 'gip'
1701
+ | 'gmd'
1702
+ | 'gyd'
1703
+ | 'hkd'
1704
+ | 'hrk'
1705
+ | 'htg'
1706
+ | 'idr'
1707
+ | 'ils'
1708
+ | 'inr'
1709
+ | 'isk'
1710
+ | 'jmd'
1711
+ | 'jpy'
1712
+ | 'kes'
1713
+ | 'kgs'
1714
+ | 'khr'
1715
+ | 'kmf'
1716
+ | 'krw'
1717
+ | 'kyd'
1718
+ | 'kzt'
1719
+ | 'lbp'
1720
+ | 'lkr'
1721
+ | 'lrd'
1722
+ | 'lsl'
1723
+ | 'mad'
1724
+ | 'mdl'
1725
+ | 'mga'
1726
+ | 'mkd'
1727
+ | 'mmk'
1728
+ | 'mnt'
1729
+ | 'mop'
1730
+ | 'mro'
1731
+ | 'mvr'
1732
+ | 'mwk'
1733
+ | 'mxn'
1734
+ | 'myr'
1735
+ | 'mzn'
1736
+ | 'nad'
1737
+ | 'ngn'
1738
+ | 'nok'
1739
+ | 'npr'
1740
+ | 'nzd'
1741
+ | 'pgk'
1742
+ | 'php'
1743
+ | 'pkr'
1744
+ | 'pln'
1745
+ | 'qar'
1746
+ | 'ron'
1747
+ | 'rsd'
1748
+ | 'rub'
1749
+ | 'rwf'
1750
+ | 'sar'
1751
+ | 'sbd'
1752
+ | 'scr'
1753
+ | 'sek'
1754
+ | 'sgd'
1755
+ | 'sle'
1756
+ | 'sll'
1757
+ | 'sos'
1758
+ | 'szl'
1759
+ | 'thb'
1760
+ | 'tjs'
1761
+ | 'top'
1762
+ | 'try'
1763
+ | 'ttd'
1764
+ | 'tzs'
1765
+ | 'uah'
1766
+ | 'uzs'
1767
+ | 'vnd'
1768
+ | 'vuv'
1769
+ | 'wst'
1770
+ | 'xaf'
1771
+ | 'xcd'
1772
+ | 'yer'
1773
+ | 'zar'
1774
+ | 'zmw'
1775
+ | 'clp'
1776
+ | 'djf'
1777
+ | 'gnf'
1778
+ | 'ugx'
1779
+ | 'pyg'
1780
+ | 'xof'
1781
+ | 'xpf';
1782
+ }
1783
+ }
1784
+ }
1785
+
1786
+ export interface BillingInformation {
1787
+ /**
1788
+ * Physical address
1789
+ */
1790
+ billingAddress?: BillingInformation.BillingAddress;
1791
+
1792
+ chargeOnBehalfOfAccount?: string;
1793
+
1794
+ couponId?: string;
1795
+
1796
+ integrationId?: string;
1797
+
1798
+ invoiceDaysUntilDue?: number;
1799
+
1800
+ isBackdated?: boolean;
1801
+
1802
+ isInvoicePaid?: boolean;
1803
+
1804
+ /**
1805
+ * Additional metadata for the subscription
1806
+ */
1807
+ metadata?: { [key: string]: unknown };
1808
+
1809
+ prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
1810
+
1811
+ taxIds?: Array<BillingInformation.TaxID>;
1812
+
1813
+ taxPercentage?: number;
1814
+
1815
+ taxRateIds?: Array<string>;
1816
+ }
1817
+
1818
+ export namespace BillingInformation {
1819
+ /**
1820
+ * Physical address
1821
+ */
1822
+ export interface BillingAddress {
1823
+ /**
1824
+ * City name
1825
+ */
1826
+ city?: string;
1827
+
1828
+ /**
1829
+ * Country code or name
1830
+ */
1831
+ country?: string;
1832
+
1833
+ /**
1834
+ * Street address line 1
1835
+ */
1836
+ line1?: string;
1837
+
1838
+ /**
1839
+ * Street address line 2
1840
+ */
1841
+ line2?: string;
1842
+
1843
+ /**
1844
+ * Postal or ZIP code
1845
+ */
1846
+ postalCode?: string;
1847
+
1848
+ /**
1849
+ * State or province
1850
+ */
1851
+ state?: string;
1852
+ }
1853
+
1854
+ export interface TaxID {
1855
+ type: string;
1856
+
1857
+ value: string;
1858
+ }
1859
+ }
1860
+
1861
+ export interface Budget {
1862
+ hasSoftLimit: boolean;
1863
+
1864
+ limit: number;
1865
+ }
1866
+
1867
+ export interface Charge {
1868
+ /**
1869
+ * Charge ID
1870
+ */
1871
+ id: string;
1872
+
1873
+ quantity: number;
1874
+
1875
+ type: 'FEATURE' | 'CREDIT';
1876
+ }
1877
+
1878
+ export interface MinimumSpend {
1879
+ minimum?: MinimumSpend.Minimum | null;
1880
+ }
1881
+
1882
+ export namespace MinimumSpend {
1883
+ export interface Minimum {
1884
+ amount: number;
1885
+
1886
+ currency?:
1887
+ | 'usd'
1888
+ | 'aed'
1889
+ | 'all'
1890
+ | 'amd'
1891
+ | 'ang'
1892
+ | 'aud'
1893
+ | 'awg'
1894
+ | 'azn'
1895
+ | 'bam'
1896
+ | 'bbd'
1897
+ | 'bdt'
1898
+ | 'bgn'
1899
+ | 'bif'
1900
+ | 'bmd'
1901
+ | 'bnd'
1902
+ | 'bsd'
1903
+ | 'bwp'
1904
+ | 'byn'
1905
+ | 'bzd'
1906
+ | 'brl'
1907
+ | 'cad'
1908
+ | 'cdf'
1909
+ | 'chf'
1910
+ | 'cny'
1911
+ | 'czk'
1912
+ | 'dkk'
1913
+ | 'dop'
1914
+ | 'dzd'
1915
+ | 'egp'
1916
+ | 'etb'
1917
+ | 'eur'
1918
+ | 'fjd'
1919
+ | 'gbp'
1920
+ | 'gel'
1921
+ | 'gip'
1922
+ | 'gmd'
1923
+ | 'gyd'
1924
+ | 'hkd'
1925
+ | 'hrk'
1926
+ | 'htg'
1927
+ | 'idr'
1928
+ | 'ils'
1929
+ | 'inr'
1930
+ | 'isk'
1931
+ | 'jmd'
1932
+ | 'jpy'
1933
+ | 'kes'
1934
+ | 'kgs'
1935
+ | 'khr'
1936
+ | 'kmf'
1937
+ | 'krw'
1938
+ | 'kyd'
1939
+ | 'kzt'
1940
+ | 'lbp'
1941
+ | 'lkr'
1942
+ | 'lrd'
1943
+ | 'lsl'
1944
+ | 'mad'
1945
+ | 'mdl'
1946
+ | 'mga'
1947
+ | 'mkd'
1948
+ | 'mmk'
1949
+ | 'mnt'
1950
+ | 'mop'
1951
+ | 'mro'
1952
+ | 'mvr'
1953
+ | 'mwk'
1954
+ | 'mxn'
1955
+ | 'myr'
1956
+ | 'mzn'
1957
+ | 'nad'
1958
+ | 'ngn'
1959
+ | 'nok'
1960
+ | 'npr'
1961
+ | 'nzd'
1962
+ | 'pgk'
1963
+ | 'php'
1964
+ | 'pkr'
1965
+ | 'pln'
1966
+ | 'qar'
1967
+ | 'ron'
1968
+ | 'rsd'
1969
+ | 'rub'
1970
+ | 'rwf'
1971
+ | 'sar'
1972
+ | 'sbd'
1973
+ | 'scr'
1974
+ | 'sek'
1975
+ | 'sgd'
1976
+ | 'sle'
1977
+ | 'sll'
1978
+ | 'sos'
1979
+ | 'szl'
1980
+ | 'thb'
1981
+ | 'tjs'
1982
+ | 'top'
1983
+ | 'try'
1984
+ | 'ttd'
1985
+ | 'tzs'
1986
+ | 'uah'
1987
+ | 'uzs'
1988
+ | 'vnd'
1989
+ | 'vuv'
1990
+ | 'wst'
1991
+ | 'xaf'
1992
+ | 'xcd'
1993
+ | 'yer'
1994
+ | 'zar'
1995
+ | 'zmw'
1996
+ | 'clp'
1997
+ | 'djf'
1998
+ | 'gnf'
1999
+ | 'ugx'
2000
+ | 'pyg'
2001
+ | 'xof'
2002
+ | 'xpf';
2003
+ }
2004
+ }
2005
+
2006
+ export interface PriceOverride {
2007
+ /**
2008
+ * Addon ID
2009
+ */
2010
+ addonId?: string;
2011
+
2012
+ /**
2013
+ * Whether this is a base charge override
2014
+ */
2015
+ baseCharge?: boolean;
2016
+
2017
+ /**
2018
+ * The corresponding custom currency id of the recurring credits price
2019
+ */
2020
+ currencyId?: string;
2021
+
2022
+ /**
2023
+ * Feature ID
2024
+ */
2025
+ featureId?: string;
2026
+
2027
+ price?: PriceOverride.Price;
2028
+ }
2029
+
2030
+ export namespace PriceOverride {
2031
+ export interface Price {
2032
+ amount: number;
2033
+
2034
+ currency?:
2035
+ | 'usd'
2036
+ | 'aed'
2037
+ | 'all'
2038
+ | 'amd'
2039
+ | 'ang'
2040
+ | 'aud'
2041
+ | 'awg'
2042
+ | 'azn'
2043
+ | 'bam'
2044
+ | 'bbd'
2045
+ | 'bdt'
2046
+ | 'bgn'
2047
+ | 'bif'
2048
+ | 'bmd'
2049
+ | 'bnd'
2050
+ | 'bsd'
2051
+ | 'bwp'
2052
+ | 'byn'
2053
+ | 'bzd'
2054
+ | 'brl'
2055
+ | 'cad'
2056
+ | 'cdf'
2057
+ | 'chf'
2058
+ | 'cny'
2059
+ | 'czk'
2060
+ | 'dkk'
2061
+ | 'dop'
2062
+ | 'dzd'
2063
+ | 'egp'
2064
+ | 'etb'
2065
+ | 'eur'
2066
+ | 'fjd'
2067
+ | 'gbp'
2068
+ | 'gel'
2069
+ | 'gip'
2070
+ | 'gmd'
2071
+ | 'gyd'
2072
+ | 'hkd'
2073
+ | 'hrk'
2074
+ | 'htg'
2075
+ | 'idr'
2076
+ | 'ils'
2077
+ | 'inr'
2078
+ | 'isk'
2079
+ | 'jmd'
2080
+ | 'jpy'
2081
+ | 'kes'
2082
+ | 'kgs'
2083
+ | 'khr'
2084
+ | 'kmf'
2085
+ | 'krw'
2086
+ | 'kyd'
2087
+ | 'kzt'
2088
+ | 'lbp'
2089
+ | 'lkr'
2090
+ | 'lrd'
2091
+ | 'lsl'
2092
+ | 'mad'
2093
+ | 'mdl'
2094
+ | 'mga'
2095
+ | 'mkd'
2096
+ | 'mmk'
2097
+ | 'mnt'
2098
+ | 'mop'
2099
+ | 'mro'
2100
+ | 'mvr'
2101
+ | 'mwk'
2102
+ | 'mxn'
2103
+ | 'myr'
2104
+ | 'mzn'
2105
+ | 'nad'
2106
+ | 'ngn'
2107
+ | 'nok'
2108
+ | 'npr'
2109
+ | 'nzd'
2110
+ | 'pgk'
2111
+ | 'php'
2112
+ | 'pkr'
2113
+ | 'pln'
2114
+ | 'qar'
2115
+ | 'ron'
2116
+ | 'rsd'
2117
+ | 'rub'
2118
+ | 'rwf'
2119
+ | 'sar'
2120
+ | 'sbd'
2121
+ | 'scr'
2122
+ | 'sek'
2123
+ | 'sgd'
2124
+ | 'sle'
2125
+ | 'sll'
2126
+ | 'sos'
2127
+ | 'szl'
2128
+ | 'thb'
2129
+ | 'tjs'
2130
+ | 'top'
2131
+ | 'try'
2132
+ | 'ttd'
2133
+ | 'tzs'
2134
+ | 'uah'
2135
+ | 'uzs'
2136
+ | 'vnd'
2137
+ | 'vuv'
2138
+ | 'wst'
2139
+ | 'xaf'
2140
+ | 'xcd'
2141
+ | 'yer'
2142
+ | 'zar'
2143
+ | 'zmw'
2144
+ | 'clp'
2145
+ | 'djf'
2146
+ | 'gnf'
2147
+ | 'ugx'
2148
+ | 'pyg'
2149
+ | 'xof'
2150
+ | 'xpf';
2151
+ }
2152
+ }
2153
+
2154
+ export interface SubscriptionEntitlement {
2155
+ id?: string;
2156
+
2157
+ featureId?: string;
2158
+
2159
+ hasSoftLimit?: boolean;
2160
+
2161
+ hasUnlimitedUsage?: boolean;
2162
+
2163
+ monthlyResetPeriodConfiguration?: SubscriptionEntitlement.MonthlyResetPeriodConfiguration;
2164
+
2165
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
2166
+
2167
+ usageLimit?: number;
2168
+
2169
+ weeklyResetPeriodConfiguration?: SubscriptionEntitlement.WeeklyResetPeriodConfiguration;
2170
+
2171
+ yearlyResetPeriodConfiguration?: SubscriptionEntitlement.YearlyResetPeriodConfiguration;
2172
+ }
2173
+
2174
+ export namespace SubscriptionEntitlement {
2175
+ export interface MonthlyResetPeriodConfiguration {
2176
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
2177
+ }
2178
+
2179
+ export interface WeeklyResetPeriodConfiguration {
2180
+ accordingTo:
2181
+ | 'SubscriptionStart'
2182
+ | 'EverySunday'
2183
+ | 'EveryMonday'
2184
+ | 'EveryTuesday'
2185
+ | 'EveryWednesday'
2186
+ | 'EveryThursday'
2187
+ | 'EveryFriday'
2188
+ | 'EverySaturday';
2189
+ }
2190
+
2191
+ export interface YearlyResetPeriodConfiguration {
2192
+ accordingTo: 'SubscriptionStart';
2193
+ }
2194
+ }
2195
+ }
2196
+
2197
+ export interface SubscriptionListParams extends MyCursorIDPageParams {
2198
+ /**
2199
+ * Filter by creation date using range operators: gt, gte, lt, lte
2200
+ */
2201
+ createdAt?: SubscriptionListParams.CreatedAt;
2202
+
2203
+ /**
2204
+ * Filter by customer ID
2205
+ */
2206
+ customerId?: string;
2207
+
2208
+ /**
2209
+ * Filter by plan ID
2210
+ */
2211
+ planId?: string;
2212
+
2213
+ /**
2214
+ * Filter by pricing type. Supports comma-separated values for multiple types
2215
+ */
2216
+ pricingType?: string;
2217
+
2218
+ /**
2219
+ * Filter by resource ID
2220
+ */
2221
+ resourceId?: string;
2222
+
2223
+ /**
2224
+ * Filter by subscription status. Supports comma-separated values for multiple
2225
+ * statuses
2226
+ */
2227
+ status?: string;
2228
+ }
2229
+
2230
+ export namespace SubscriptionListParams {
2231
+ /**
2232
+ * Filter by creation date using range operators: gt, gte, lt, lte
2233
+ */
2234
+ export interface CreatedAt {
2235
+ /**
2236
+ * Greater than the specified createdAt value
2237
+ */
2238
+ gt?: string;
2239
+
2240
+ /**
2241
+ * Greater than or equal to the specified createdAt value
2242
+ */
2243
+ gte?: string;
2244
+
2245
+ /**
2246
+ * Less than the specified createdAt value
2247
+ */
2248
+ lt?: string;
2249
+
2250
+ /**
2251
+ * Less than or equal to the specified createdAt value
2252
+ */
2253
+ lte?: string;
2254
+ }
2255
+ }
2256
+
2257
+ export interface SubscriptionCancelParams {
2258
+ /**
2259
+ * Action on cancellation (downgrade or revoke)
2260
+ */
2261
+ cancellationAction?: 'DEFAULT' | 'REVOKE_ENTITLEMENTS';
2262
+
2263
+ /**
2264
+ * When to cancel (immediate, period end, or date)
2265
+ */
2266
+ cancellationTime?: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE' | 'SPECIFIC_DATE';
2267
+
2268
+ /**
2269
+ * Subscription end date
2270
+ */
2271
+ endDate?: string;
2272
+
2273
+ /**
2274
+ * If set, enables or disables prorating of credits on subscription cancellation.
2275
+ */
2276
+ prorate?: boolean;
2277
+ }
2278
+
2279
+ export interface SubscriptionDelegateParams {
2280
+ /**
2281
+ * The unique identifier of the customer who will assume payment responsibility for
2282
+ * this subscription. This customer must already exist in your Stigg account and
2283
+ * have a valid payment method if the subscription requires payment.
2284
+ */
2285
+ targetCustomerId: string;
2286
+ }
2287
+
2288
+ export interface SubscriptionImportParams {
2289
+ /**
2290
+ * List of subscription objects to import
2291
+ */
2292
+ subscriptions: Array<SubscriptionImportParams.Subscription>;
2293
+
2294
+ /**
2295
+ * Integration ID to use for importing subscriptions
2296
+ */
2297
+ integrationId?: string | null;
2298
+ }
2299
+
2300
+ export namespace SubscriptionImportParams {
2301
+ export interface Subscription {
2302
+ /**
2303
+ * Subscription ID
2304
+ */
2305
+ id: string;
2306
+
2307
+ /**
2308
+ * Customer ID
2309
+ */
2310
+ customerId: string;
2311
+
2312
+ /**
2313
+ * Plan ID
2314
+ */
2315
+ planId: string;
2316
+
2317
+ /**
2318
+ * Billing ID
2319
+ */
2320
+ billingId?: string | null;
2321
+
2322
+ /**
2323
+ * Subscription end date
2324
+ */
2325
+ endDate?: string | null;
2326
+
2327
+ /**
2328
+ * Additional metadata for the subscription
2329
+ */
2330
+ metadata?: { [key: string]: string };
2331
+
2332
+ /**
2333
+ * Resource ID
2334
+ */
2335
+ resourceId?: string | null;
2336
+
2337
+ /**
2338
+ * Subscription start date
2339
+ */
2340
+ startDate?: string;
2341
+ }
2342
+ }
2343
+
2344
+ export interface SubscriptionMigrateParams {
2345
+ /**
2346
+ * When to migrate (immediate or period end)
2347
+ */
2348
+ subscriptionMigrationTime?: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE';
2349
+ }
2350
+
2351
+ export interface SubscriptionPreviewParams {
2352
+ /**
2353
+ * Customer ID
2354
+ */
2355
+ customerId: string;
2356
+
2357
+ /**
2358
+ * Plan ID
2359
+ */
2360
+ planId: string;
2361
+
2362
+ /**
2363
+ * Addons to include
2364
+ */
2365
+ addons?: Array<SubscriptionPreviewParams.Addon>;
2366
+
2367
+ /**
2368
+ * Coupon or discount to apply
2369
+ */
2370
+ appliedCoupon?: SubscriptionPreviewParams.AppliedCoupon;
2371
+
2372
+ /**
2373
+ * Billable features with quantities
2374
+ */
2375
+ billableFeatures?: Array<SubscriptionPreviewParams.BillableFeature>;
2376
+
2377
+ /**
2378
+ * ISO 3166-1 country code for localization
2379
+ */
2380
+ billingCountryCode?: string;
2381
+
2382
+ /**
2383
+ * Billing and tax configuration
2384
+ */
2385
+ billingInformation?: SubscriptionPreviewParams.BillingInformation;
2386
+
2387
+ /**
2388
+ * Billing period (MONTHLY or ANNUALLY)
2389
+ */
2390
+ billingPeriod?: 'MONTHLY' | 'ANNUALLY';
2391
+
2392
+ /**
2393
+ * One-time or recurring charges
2394
+ */
2395
+ charges?: Array<SubscriptionPreviewParams.Charge>;
2396
+
2397
+ /**
2398
+ * Paying customer ID for delegated billing
2399
+ */
2400
+ payingCustomerId?: string;
2401
+
2402
+ /**
2403
+ * Resource ID for multi-instance subscriptions
2404
+ */
2405
+ resourceId?: string;
2406
+
2407
+ /**
2408
+ * When to apply subscription changes
2409
+ */
2410
+ scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
2411
+
2412
+ /**
2413
+ * Subscription start date
2414
+ */
2415
+ startDate?: string;
2416
+
2417
+ /**
2418
+ * Trial period override settings
2419
+ */
2420
+ trialOverrideConfiguration?: SubscriptionPreviewParams.TrialOverrideConfiguration;
2421
+
2422
+ /**
2423
+ * Unit quantity for per-unit pricing
2424
+ */
2425
+ unitQuantity?: number;
2426
+ }
2427
+
2428
+ export namespace SubscriptionPreviewParams {
2429
+ /**
2430
+ * Addon configuration
2431
+ */
2432
+ export interface Addon {
2433
+ /**
2434
+ * Addon ID
2435
+ */
2436
+ addonId: string;
2437
+
2438
+ /**
2439
+ * Number of addon instances
2440
+ */
2441
+ quantity?: number;
2442
+ }
2443
+
2444
+ /**
2445
+ * Coupon or discount to apply
2446
+ */
2447
+ export interface AppliedCoupon {
2448
+ /**
2449
+ * Billing provider coupon ID
2450
+ */
2451
+ billingCouponId?: string;
2452
+
2453
+ /**
2454
+ * Coupon timing configuration
2455
+ */
2456
+ configuration?: AppliedCoupon.Configuration;
2457
+
2458
+ /**
2459
+ * Stigg coupon ID
2460
+ */
2461
+ couponId?: string;
2462
+
2463
+ /**
2464
+ * Ad-hoc discount configuration
2465
+ */
2466
+ discount?: AppliedCoupon.Discount;
2467
+
2468
+ /**
2469
+ * Promotion code to apply
2470
+ */
2471
+ promotionCode?: string;
2472
+ }
2473
+
2474
+ export namespace AppliedCoupon {
2475
+ /**
2476
+ * Coupon timing configuration
2477
+ */
2478
+ export interface Configuration {
2479
+ /**
2480
+ * Coupon start date
2481
+ */
2482
+ startDate?: string;
2483
+ }
2484
+
2485
+ /**
2486
+ * Ad-hoc discount configuration
2487
+ */
2488
+ export interface Discount {
2489
+ /**
2490
+ * Fixed amounts off by currency
2491
+ */
2492
+ amountsOff?: Array<Discount.AmountsOff> | null;
2493
+
2494
+ /**
2495
+ * Ad-hoc discount
2496
+ */
2497
+ description?: string;
2498
+
2499
+ /**
2500
+ * Duration in months
2501
+ */
2502
+ durationInMonths?: number;
2503
+
2504
+ /**
2505
+ * Discount name
2506
+ */
2507
+ name?: string;
2508
+
2509
+ /**
2510
+ * Percentage discount
2511
+ */
2512
+ percentOff?: number;
2513
+ }
2514
+
2515
+ export namespace Discount {
2516
+ export interface AmountsOff {
2517
+ /**
2518
+ * The price amount
2519
+ */
2520
+ amount: number;
2521
+
2522
+ /**
2523
+ * The price currency
2524
+ */
2525
+ currency:
2526
+ | 'usd'
2527
+ | 'aed'
2528
+ | 'all'
2529
+ | 'amd'
2530
+ | 'ang'
2531
+ | 'aud'
2532
+ | 'awg'
2533
+ | 'azn'
2534
+ | 'bam'
2535
+ | 'bbd'
2536
+ | 'bdt'
2537
+ | 'bgn'
2538
+ | 'bif'
2539
+ | 'bmd'
2540
+ | 'bnd'
2541
+ | 'bsd'
2542
+ | 'bwp'
2543
+ | 'byn'
2544
+ | 'bzd'
2545
+ | 'brl'
2546
+ | 'cad'
2547
+ | 'cdf'
2548
+ | 'chf'
2549
+ | 'cny'
2550
+ | 'czk'
2551
+ | 'dkk'
2552
+ | 'dop'
2553
+ | 'dzd'
2554
+ | 'egp'
2555
+ | 'etb'
2556
+ | 'eur'
2557
+ | 'fjd'
2558
+ | 'gbp'
2559
+ | 'gel'
2560
+ | 'gip'
2561
+ | 'gmd'
2562
+ | 'gyd'
2563
+ | 'hkd'
2564
+ | 'hrk'
2565
+ | 'htg'
2566
+ | 'idr'
2567
+ | 'ils'
2568
+ | 'inr'
2569
+ | 'isk'
2570
+ | 'jmd'
2571
+ | 'jpy'
2572
+ | 'kes'
2573
+ | 'kgs'
2574
+ | 'khr'
2575
+ | 'kmf'
2576
+ | 'krw'
2577
+ | 'kyd'
2578
+ | 'kzt'
2579
+ | 'lbp'
2580
+ | 'lkr'
2581
+ | 'lrd'
2582
+ | 'lsl'
2583
+ | 'mad'
2584
+ | 'mdl'
2585
+ | 'mga'
2586
+ | 'mkd'
2587
+ | 'mmk'
2588
+ | 'mnt'
2589
+ | 'mop'
2590
+ | 'mro'
2591
+ | 'mvr'
2592
+ | 'mwk'
2593
+ | 'mxn'
2594
+ | 'myr'
2595
+ | 'mzn'
2596
+ | 'nad'
2597
+ | 'ngn'
2598
+ | 'nok'
2599
+ | 'npr'
2600
+ | 'nzd'
2601
+ | 'pgk'
2602
+ | 'php'
2603
+ | 'pkr'
2604
+ | 'pln'
2605
+ | 'qar'
2606
+ | 'ron'
2607
+ | 'rsd'
2608
+ | 'rub'
2609
+ | 'rwf'
2610
+ | 'sar'
2611
+ | 'sbd'
2612
+ | 'scr'
2613
+ | 'sek'
2614
+ | 'sgd'
2615
+ | 'sle'
2616
+ | 'sll'
2617
+ | 'sos'
2618
+ | 'szl'
2619
+ | 'thb'
2620
+ | 'tjs'
2621
+ | 'top'
2622
+ | 'try'
2623
+ | 'ttd'
2624
+ | 'tzs'
2625
+ | 'uah'
2626
+ | 'uzs'
2627
+ | 'vnd'
2628
+ | 'vuv'
2629
+ | 'wst'
2630
+ | 'xaf'
2631
+ | 'xcd'
2632
+ | 'yer'
2633
+ | 'zar'
2634
+ | 'zmw'
2635
+ | 'clp'
2636
+ | 'djf'
2637
+ | 'gnf'
2638
+ | 'ugx'
2639
+ | 'pyg'
2640
+ | 'xof'
2641
+ | 'xpf';
2642
+ }
2643
+ }
2644
+ }
2645
+
2646
+ /**
2647
+ * Feature with quantity
2648
+ */
2649
+ export interface BillableFeature {
2650
+ /**
2651
+ * Feature ID
2652
+ */
2653
+ featureId: string;
2654
+
2655
+ /**
2656
+ * Quantity of feature units
2657
+ */
2658
+ quantity: number;
2659
+ }
2660
+
2661
+ /**
2662
+ * Billing and tax configuration
2663
+ */
2664
+ export interface BillingInformation {
2665
+ /**
2666
+ * Billing address
2667
+ */
2668
+ billingAddress?: BillingInformation.BillingAddress;
2669
+
2670
+ /**
2671
+ * Connected account ID for platform billing
2672
+ */
2673
+ chargeOnBehalfOfAccount?: string;
2674
+
2675
+ /**
2676
+ * Billing integration ID
2677
+ */
2678
+ integrationId?: string;
2679
+
2680
+ /**
2681
+ * Days until invoice is due
2682
+ */
2683
+ invoiceDaysUntilDue?: number;
2684
+
2685
+ /**
2686
+ * Whether subscription is backdated
2687
+ */
2688
+ isBackdated?: boolean;
2689
+
2690
+ /**
2691
+ * Whether invoice is already paid
2692
+ */
2693
+ isInvoicePaid?: boolean;
2694
+
2695
+ /**
2696
+ * Additional billing metadata
2697
+ */
2698
+ metadata?: unknown;
2699
+
2700
+ /**
2701
+ * Proration behavior
2702
+ */
2703
+ prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
2704
+
2705
+ /**
2706
+ * Customer tax IDs
2707
+ */
2708
+ taxIds?: Array<BillingInformation.TaxID>;
2709
+
2710
+ /**
2711
+ * Tax percentage to apply
2712
+ */
2713
+ taxPercentage?: number;
2714
+
2715
+ /**
2716
+ * Tax rate IDs from billing provider
2717
+ */
2718
+ taxRateIds?: Array<string>;
2719
+ }
2720
+
2721
+ export namespace BillingInformation {
2722
+ /**
2723
+ * Billing address
2724
+ */
2725
+ export interface BillingAddress {
2726
+ city?: string;
2727
+
2728
+ country?: string;
2729
+
2730
+ line1?: string;
2731
+
2732
+ line2?: string;
2733
+
2734
+ postalCode?: string;
2735
+
2736
+ state?: string;
2737
+ }
2738
+
2739
+ /**
2740
+ * Tax exemption identifier
2741
+ */
2742
+ export interface TaxID {
2743
+ /**
2744
+ * Tax exemption type (e.g., vat, gst)
2745
+ */
2746
+ type: string;
2747
+
2748
+ /**
2749
+ * Tax exemption identifier value
2750
+ */
2751
+ value: string;
2752
+ }
2753
+ }
2754
+
2755
+ /**
2756
+ * Charge item
2757
+ */
2758
+ export interface Charge {
2759
+ /**
2760
+ * Charge ID
2761
+ */
2762
+ id: string;
2763
+
2764
+ /**
2765
+ * Charge quantity
2766
+ */
2767
+ quantity: number;
2768
+
2769
+ /**
2770
+ * Charge type
2771
+ */
2772
+ type: 'FEATURE' | 'CREDIT';
2773
+ }
2774
+
2775
+ /**
2776
+ * Trial period override settings
2777
+ */
2778
+ export interface TrialOverrideConfiguration {
2779
+ /**
2780
+ * Whether to start as trial
2781
+ */
2782
+ isTrial: boolean;
2783
+
2784
+ /**
2785
+ * Behavior when trial ends
2786
+ */
2787
+ trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
2788
+
2789
+ /**
2790
+ * Trial end date
2791
+ */
2792
+ trialEndDate?: string;
2793
+ }
2794
+ }
2795
+
2796
+ export interface SubscriptionProvisionParams {
2797
+ /**
2798
+ * Customer ID to provision the subscription for
2799
+ */
2800
+ customerId: string;
2801
+
2802
+ /**
2803
+ * Plan ID to provision
2804
+ */
2805
+ planId: string;
2806
+
2807
+ /**
2808
+ * Unique identifier for the subscription
2809
+ */
2810
+ id?: string;
2811
+
2812
+ addons?: Array<SubscriptionProvisionParams.Addon>;
2813
+
2814
+ /**
2815
+ * Coupon configuration
2816
+ */
2817
+ appliedCoupon?: SubscriptionProvisionParams.AppliedCoupon;
2818
+
2819
+ /**
2820
+ * Whether to wait for payment confirmation before returning the subscription
2821
+ */
2822
+ awaitPaymentConfirmation?: boolean;
2823
+
2824
+ /**
2825
+ * The ISO 3166-1 alpha-2 country code for billing
2826
+ */
2827
+ billingCountryCode?: string | null;
2828
+
2829
+ /**
2830
+ * External billing system identifier
2831
+ */
2832
+ billingId?: string | null;
2833
+
2834
+ billingInformation?: SubscriptionProvisionParams.BillingInformation;
2835
+
2836
+ /**
2837
+ * Billing period (MONTHLY or ANNUALLY)
2838
+ */
2839
+ billingPeriod?: 'MONTHLY' | 'ANNUALLY';
2840
+
2841
+ budget?: SubscriptionProvisionParams.Budget | null;
2842
+
2843
+ charges?: Array<SubscriptionProvisionParams.Charge>;
2844
+
2845
+ /**
2846
+ * Checkout page configuration for payment collection
2847
+ */
2848
+ checkoutOptions?: SubscriptionProvisionParams.CheckoutOptions;
2849
+
2850
+ /**
2851
+ * Additional metadata for the subscription
2852
+ */
2853
+ metadata?: { [key: string]: string };
2854
+
2855
+ minimumSpend?: SubscriptionProvisionParams.MinimumSpend | null;
2856
+
2857
+ /**
2858
+ * Optional paying customer ID for split billing scenarios
2859
+ */
2860
+ payingCustomerId?: string | null;
2861
+
2862
+ /**
2863
+ * How payments should be collected for this subscription
2864
+ */
2865
+ paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE';
2866
+
2867
+ priceOverrides?: Array<SubscriptionProvisionParams.PriceOverride>;
2868
+
2869
+ /**
2870
+ * Optional resource ID for multi-instance subscriptions
2871
+ */
2872
+ resourceId?: string | null;
2873
+
2874
+ /**
2875
+ * Salesforce ID
2876
+ */
2877
+ salesforceId?: string | null;
2878
+
2879
+ /**
2880
+ * Strategy for scheduling subscription changes
2881
+ */
2882
+ scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
2883
+
2884
+ /**
2885
+ * Subscription start date
2886
+ */
2887
+ startDate?: string;
2888
+
2889
+ subscriptionEntitlements?: Array<SubscriptionProvisionParams.SubscriptionEntitlement>;
2890
+
2891
+ /**
2892
+ * Trial period override settings
2893
+ */
2894
+ trialOverrideConfiguration?: SubscriptionProvisionParams.TrialOverrideConfiguration;
2895
+
2896
+ unitQuantity?: number;
2897
+ }
2898
+
2899
+ export namespace SubscriptionProvisionParams {
2900
+ export interface Addon {
2901
+ /**
2902
+ * Addon identifier
2903
+ */
2904
+ addonId: string;
2905
+
2906
+ /**
2907
+ * Number of addon units
2908
+ */
2909
+ quantity?: number;
2910
+ }
2911
+
2912
+ /**
2913
+ * Coupon configuration
2914
+ */
2915
+ export interface AppliedCoupon {
2916
+ /**
2917
+ * Billing provider coupon ID
2918
+ */
2919
+ billingCouponId?: string;
2920
+
2921
+ /**
2922
+ * Coupon timing configuration
2923
+ */
2924
+ configuration?: AppliedCoupon.Configuration;
2925
+
2926
+ /**
2927
+ * Stigg coupon ID
2928
+ */
2929
+ couponId?: string;
2930
+
2931
+ /**
2932
+ * Ad-hoc discount configuration
2933
+ */
2934
+ discount?: AppliedCoupon.Discount;
2935
+
2936
+ /**
2937
+ * Promotion code to apply
2938
+ */
2939
+ promotionCode?: string;
2940
+ }
2941
+
2942
+ export namespace AppliedCoupon {
2943
+ /**
2944
+ * Coupon timing configuration
2945
+ */
2946
+ export interface Configuration {
2947
+ /**
2948
+ * Coupon start date
2949
+ */
2950
+ startDate?: string;
2951
+ }
2952
+
2953
+ /**
2954
+ * Ad-hoc discount configuration
2955
+ */
2956
+ export interface Discount {
2957
+ /**
2958
+ * Fixed amounts off by currency
2959
+ */
2960
+ amountsOff?: Array<Discount.AmountsOff> | null;
2961
+
2962
+ /**
2963
+ * Ad-hoc discount
2964
+ */
2965
+ description?: string;
2966
+
2967
+ /**
2968
+ * Duration in months
2969
+ */
2970
+ durationInMonths?: number;
2971
+
2972
+ /**
2973
+ * Discount name
2974
+ */
2975
+ name?: string;
2976
+
2977
+ /**
2978
+ * Percentage discount
2979
+ */
2980
+ percentOff?: number;
2981
+ }
2982
+
2983
+ export namespace Discount {
2984
+ export interface AmountsOff {
2985
+ /**
2986
+ * The price amount
2987
+ */
2988
+ amount: number;
2989
+
2990
+ /**
2991
+ * The price currency
2992
+ */
2993
+ currency:
2994
+ | 'usd'
2995
+ | 'aed'
2996
+ | 'all'
2997
+ | 'amd'
2998
+ | 'ang'
2999
+ | 'aud'
3000
+ | 'awg'
3001
+ | 'azn'
3002
+ | 'bam'
3003
+ | 'bbd'
3004
+ | 'bdt'
3005
+ | 'bgn'
3006
+ | 'bif'
3007
+ | 'bmd'
3008
+ | 'bnd'
3009
+ | 'bsd'
3010
+ | 'bwp'
3011
+ | 'byn'
3012
+ | 'bzd'
3013
+ | 'brl'
3014
+ | 'cad'
3015
+ | 'cdf'
3016
+ | 'chf'
3017
+ | 'cny'
3018
+ | 'czk'
3019
+ | 'dkk'
3020
+ | 'dop'
3021
+ | 'dzd'
3022
+ | 'egp'
3023
+ | 'etb'
3024
+ | 'eur'
3025
+ | 'fjd'
3026
+ | 'gbp'
3027
+ | 'gel'
3028
+ | 'gip'
3029
+ | 'gmd'
3030
+ | 'gyd'
3031
+ | 'hkd'
3032
+ | 'hrk'
3033
+ | 'htg'
3034
+ | 'idr'
3035
+ | 'ils'
3036
+ | 'inr'
3037
+ | 'isk'
3038
+ | 'jmd'
3039
+ | 'jpy'
3040
+ | 'kes'
3041
+ | 'kgs'
3042
+ | 'khr'
3043
+ | 'kmf'
3044
+ | 'krw'
3045
+ | 'kyd'
3046
+ | 'kzt'
3047
+ | 'lbp'
3048
+ | 'lkr'
3049
+ | 'lrd'
3050
+ | 'lsl'
3051
+ | 'mad'
3052
+ | 'mdl'
3053
+ | 'mga'
3054
+ | 'mkd'
3055
+ | 'mmk'
3056
+ | 'mnt'
3057
+ | 'mop'
3058
+ | 'mro'
3059
+ | 'mvr'
3060
+ | 'mwk'
3061
+ | 'mxn'
3062
+ | 'myr'
3063
+ | 'mzn'
3064
+ | 'nad'
3065
+ | 'ngn'
3066
+ | 'nok'
3067
+ | 'npr'
3068
+ | 'nzd'
3069
+ | 'pgk'
3070
+ | 'php'
3071
+ | 'pkr'
3072
+ | 'pln'
3073
+ | 'qar'
3074
+ | 'ron'
3075
+ | 'rsd'
3076
+ | 'rub'
3077
+ | 'rwf'
3078
+ | 'sar'
3079
+ | 'sbd'
3080
+ | 'scr'
3081
+ | 'sek'
3082
+ | 'sgd'
3083
+ | 'sle'
3084
+ | 'sll'
3085
+ | 'sos'
3086
+ | 'szl'
3087
+ | 'thb'
3088
+ | 'tjs'
3089
+ | 'top'
3090
+ | 'try'
3091
+ | 'ttd'
3092
+ | 'tzs'
3093
+ | 'uah'
3094
+ | 'uzs'
3095
+ | 'vnd'
3096
+ | 'vuv'
3097
+ | 'wst'
3098
+ | 'xaf'
3099
+ | 'xcd'
3100
+ | 'yer'
3101
+ | 'zar'
3102
+ | 'zmw'
3103
+ | 'clp'
3104
+ | 'djf'
3105
+ | 'gnf'
3106
+ | 'ugx'
3107
+ | 'pyg'
3108
+ | 'xof'
3109
+ | 'xpf';
3110
+ }
3111
+ }
3112
+ }
888
3113
 
889
- export namespace SubscriptionTransferResponse {
890
- export interface Data {
3114
+ export interface BillingInformation {
891
3115
  /**
892
- * Subscription ID
3116
+ * Billing address for the subscription
893
3117
  */
894
- id: string;
3118
+ billingAddress?: BillingInformation.BillingAddress;
895
3119
 
896
3120
  /**
897
- * Billing ID
3121
+ * Stripe Connect account to charge on behalf of
898
3122
  */
899
- billingId: string | null;
3123
+ chargeOnBehalfOfAccount?: string | null;
900
3124
 
901
3125
  /**
902
- * Created at
3126
+ * Billing integration identifier
903
3127
  */
904
- createdAt: string;
3128
+ integrationId?: string | null;
905
3129
 
906
3130
  /**
907
- * Customer ID
3131
+ * Number of days until invoice is due
908
3132
  */
909
- customerId: string;
3133
+ invoiceDaysUntilDue?: number;
910
3134
 
911
3135
  /**
912
- * Payment collection
3136
+ * Whether the subscription is backdated
913
3137
  */
914
- paymentCollection: 'NOT_REQUIRED' | 'PROCESSING' | 'FAILED' | 'ACTION_REQUIRED';
3138
+ isBackdated?: boolean;
915
3139
 
916
3140
  /**
917
- * Plan ID
3141
+ * Whether the invoice is marked as paid
918
3142
  */
919
- planId: string;
3143
+ isInvoicePaid?: boolean;
920
3144
 
921
3145
  /**
922
- * Pricing type
3146
+ * Additional metadata for the subscription
923
3147
  */
924
- pricingType: 'FREE' | 'PAID' | 'CUSTOM';
3148
+ metadata?: { [key: string]: string };
925
3149
 
926
3150
  /**
927
- * Subscription start date
3151
+ * How to handle proration for billing changes
928
3152
  */
929
- startDate: string;
3153
+ prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
930
3154
 
931
3155
  /**
932
- * Subscription status
3156
+ * Customer tax identification numbers
933
3157
  */
934
- status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'IN_TRIAL' | 'CANCELED' | 'NOT_STARTED';
3158
+ taxIds?: Array<BillingInformation.TaxID>;
935
3159
 
936
3160
  /**
937
- * Subscription cancellation date
3161
+ * Tax percentage (0-100)
938
3162
  */
939
- cancellationDate?: string | null;
3163
+ taxPercentage?: number;
940
3164
 
941
3165
  /**
942
- * Subscription cancel reason
3166
+ * Tax rate identifiers to apply
943
3167
  */
944
- cancelReason?:
945
- | 'UPGRADE_OR_DOWNGRADE'
946
- | 'CANCELLED_BY_BILLING'
947
- | 'EXPIRED'
948
- | 'DETACH_BILLING'
949
- | 'TRIAL_ENDED'
950
- | 'Immediate'
951
- | 'TRIAL_CONVERTED'
952
- | 'PENDING_PAYMENT_EXPIRED'
953
- | 'ScheduledCancellation'
954
- | 'CustomerArchived'
955
- | 'AutoCancellationRule'
956
- | null;
3168
+ taxRateIds?: Array<string>;
3169
+ }
957
3170
 
3171
+ export namespace BillingInformation {
958
3172
  /**
959
- * End of the current billing period
3173
+ * Billing address for the subscription
960
3174
  */
961
- currentBillingPeriodEnd?: string | null;
3175
+ export interface BillingAddress {
3176
+ city?: string;
962
3177
 
963
- /**
964
- * Start of the current billing period
965
- */
966
- currentBillingPeriodStart?: string | null;
3178
+ country?: string;
967
3179
 
968
- /**
969
- * Subscription effective end date
970
- */
971
- effectiveEndDate?: string | null;
3180
+ line1?: string;
972
3181
 
973
- /**
974
- * Subscription end date
975
- */
976
- endDate?: string | null;
3182
+ line2?: string;
3183
+
3184
+ postalCode?: string;
3185
+
3186
+ state?: string;
3187
+ }
3188
+
3189
+ export interface TaxID {
3190
+ /**
3191
+ * The type of tax exemption identifier, such as VAT.
3192
+ */
3193
+ type: string;
3194
+
3195
+ /**
3196
+ * The actual tax identifier value
3197
+ */
3198
+ value: string;
3199
+ }
3200
+ }
977
3201
 
3202
+ export interface Budget {
978
3203
  /**
979
- * Additional metadata for the subscription
3204
+ * Whether the budget is a soft limit
980
3205
  */
981
- metadata?: { [key: string]: string };
3206
+ hasSoftLimit: boolean;
982
3207
 
983
3208
  /**
984
- * Paying customer ID for delegated billing
3209
+ * Maximum spending limit
985
3210
  */
986
- payingCustomerId?: string | null;
3211
+ limit: number;
3212
+ }
987
3213
 
3214
+ /**
3215
+ * Charge item
3216
+ */
3217
+ export interface Charge {
988
3218
  /**
989
- * The method used to collect payments for a subscription
3219
+ * Charge ID
990
3220
  */
991
- paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE' | null;
3221
+ id: string;
992
3222
 
993
3223
  /**
994
- * Resource ID
3224
+ * Charge quantity
995
3225
  */
996
- resourceId?: string | null;
3226
+ quantity: number;
997
3227
 
998
3228
  /**
999
- * Subscription trial end date
3229
+ * Charge type
1000
3230
  */
1001
- trialEndDate?: string | null;
3231
+ type: 'FEATURE' | 'CREDIT';
1002
3232
  }
1003
- }
1004
-
1005
- export interface SubscriptionCreateParams {
1006
- /**
1007
- * Customer ID to provision the subscription for
1008
- */
1009
- customerId: string;
1010
-
1011
- /**
1012
- * Plan ID to provision
1013
- */
1014
- planId: string;
1015
-
1016
- /**
1017
- * Unique identifier for the subscription
1018
- */
1019
- id?: string | null;
1020
-
1021
- /**
1022
- * Whether to wait for payment confirmation before returning the subscription
1023
- */
1024
- awaitPaymentConfirmation?: boolean;
1025
-
1026
- billingPeriod?: 'MONTHLY' | 'ANNUALLY';
1027
-
1028
- checkoutOptions?: SubscriptionCreateParams.CheckoutOptions;
1029
-
1030
- /**
1031
- * Additional metadata for the subscription
1032
- */
1033
- metadata?: { [key: string]: string };
1034
-
1035
- /**
1036
- * Optional paying customer ID for split billing scenarios
1037
- */
1038
- payingCustomerId?: string | null;
1039
3233
 
1040
3234
  /**
1041
- * Optional resource ID for multi-instance subscriptions
3235
+ * Checkout page configuration for payment collection
1042
3236
  */
1043
- resourceId?: string | null;
1044
-
1045
- trialOverrideConfiguration?: SubscriptionCreateParams.TrialOverrideConfiguration;
1046
- }
1047
-
1048
- export namespace SubscriptionCreateParams {
1049
3237
  export interface CheckoutOptions {
1050
3238
  /**
1051
3239
  * URL to redirect to if checkout is canceled
@@ -1083,153 +3271,512 @@ export namespace SubscriptionCreateParams {
1083
3271
  referenceId?: string | null;
1084
3272
  }
1085
3273
 
1086
- export interface TrialOverrideConfiguration {
1087
- /**
1088
- * Whether the subscription should start with a trial period
1089
- */
1090
- isTrial: boolean;
1091
-
3274
+ export interface MinimumSpend {
1092
3275
  /**
1093
- * Behavior when trial ends: CONVERT_TO_PAID or CANCEL_SUBSCRIPTION
3276
+ * Minimum spend amount
1094
3277
  */
1095
- trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
3278
+ minimum?: MinimumSpend.Minimum | null;
3279
+ }
1096
3280
 
3281
+ export namespace MinimumSpend {
1097
3282
  /**
1098
- * Custom trial end date
3283
+ * Minimum spend amount
1099
3284
  */
1100
- trialEndDate?: string;
1101
- }
1102
- }
1103
-
1104
- export interface SubscriptionListParams {
1105
- /**
1106
- * Filter by customer ID
1107
- */
1108
- customerId?: string;
1109
-
1110
- /**
1111
- * Ending before this UUID for pagination
1112
- */
1113
- endingBefore?: string;
1114
-
1115
- /**
1116
- * Items per page
1117
- */
1118
- limit?: number;
1119
-
1120
- /**
1121
- * Starting after this UUID for pagination
1122
- */
1123
- startingAfter?: string;
1124
-
1125
- /**
1126
- * Filter by subscription status (comma-separated for multiple statuses, e.g.,
1127
- * ACTIVE,IN_TRIAL)
1128
- */
1129
- status?: string;
1130
- }
1131
-
1132
- export interface SubscriptionDelegateParams {
1133
- /**
1134
- * The customer ID to delegate the subscription to
1135
- */
1136
- targetCustomerId: string;
1137
- }
1138
-
1139
- export interface SubscriptionMigrateParams {
1140
- /**
1141
- * When to migrate the subscription: IMMEDIATE or END_OF_BILLING_PERIOD
1142
- */
1143
- subscriptionMigrationTime?: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE';
1144
- }
1145
-
1146
- export interface SubscriptionPreviewParams {
1147
- /**
1148
- * Customer ID
1149
- */
1150
- customerId: string;
1151
-
1152
- /**
1153
- * Plan ID
1154
- */
1155
- planId: string;
1156
-
1157
- addons?: Array<SubscriptionPreviewParams.Addon>;
1158
-
1159
- appliedCoupon?: SubscriptionPreviewParams.AppliedCoupon;
1160
-
1161
- billableFeatures?: Array<SubscriptionPreviewParams.BillableFeature>;
1162
-
1163
- billingCountryCode?: string;
1164
-
1165
- billingInformation?: SubscriptionPreviewParams.BillingInformation;
3285
+ export interface Minimum {
3286
+ /**
3287
+ * The price amount
3288
+ */
3289
+ amount?: number;
1166
3290
 
1167
- billingPeriod?: 'MONTHLY' | 'ANNUALLY';
3291
+ /**
3292
+ * The billing country code of the price
3293
+ */
3294
+ billingCountryCode?: string | null;
1168
3295
 
1169
- charges?: Array<SubscriptionPreviewParams.Charge>;
3296
+ /**
3297
+ * The price currency
3298
+ */
3299
+ currency?:
3300
+ | 'usd'
3301
+ | 'aed'
3302
+ | 'all'
3303
+ | 'amd'
3304
+ | 'ang'
3305
+ | 'aud'
3306
+ | 'awg'
3307
+ | 'azn'
3308
+ | 'bam'
3309
+ | 'bbd'
3310
+ | 'bdt'
3311
+ | 'bgn'
3312
+ | 'bif'
3313
+ | 'bmd'
3314
+ | 'bnd'
3315
+ | 'bsd'
3316
+ | 'bwp'
3317
+ | 'byn'
3318
+ | 'bzd'
3319
+ | 'brl'
3320
+ | 'cad'
3321
+ | 'cdf'
3322
+ | 'chf'
3323
+ | 'cny'
3324
+ | 'czk'
3325
+ | 'dkk'
3326
+ | 'dop'
3327
+ | 'dzd'
3328
+ | 'egp'
3329
+ | 'etb'
3330
+ | 'eur'
3331
+ | 'fjd'
3332
+ | 'gbp'
3333
+ | 'gel'
3334
+ | 'gip'
3335
+ | 'gmd'
3336
+ | 'gyd'
3337
+ | 'hkd'
3338
+ | 'hrk'
3339
+ | 'htg'
3340
+ | 'idr'
3341
+ | 'ils'
3342
+ | 'inr'
3343
+ | 'isk'
3344
+ | 'jmd'
3345
+ | 'jpy'
3346
+ | 'kes'
3347
+ | 'kgs'
3348
+ | 'khr'
3349
+ | 'kmf'
3350
+ | 'krw'
3351
+ | 'kyd'
3352
+ | 'kzt'
3353
+ | 'lbp'
3354
+ | 'lkr'
3355
+ | 'lrd'
3356
+ | 'lsl'
3357
+ | 'mad'
3358
+ | 'mdl'
3359
+ | 'mga'
3360
+ | 'mkd'
3361
+ | 'mmk'
3362
+ | 'mnt'
3363
+ | 'mop'
3364
+ | 'mro'
3365
+ | 'mvr'
3366
+ | 'mwk'
3367
+ | 'mxn'
3368
+ | 'myr'
3369
+ | 'mzn'
3370
+ | 'nad'
3371
+ | 'ngn'
3372
+ | 'nok'
3373
+ | 'npr'
3374
+ | 'nzd'
3375
+ | 'pgk'
3376
+ | 'php'
3377
+ | 'pkr'
3378
+ | 'pln'
3379
+ | 'qar'
3380
+ | 'ron'
3381
+ | 'rsd'
3382
+ | 'rub'
3383
+ | 'rwf'
3384
+ | 'sar'
3385
+ | 'sbd'
3386
+ | 'scr'
3387
+ | 'sek'
3388
+ | 'sgd'
3389
+ | 'sle'
3390
+ | 'sll'
3391
+ | 'sos'
3392
+ | 'szl'
3393
+ | 'thb'
3394
+ | 'tjs'
3395
+ | 'top'
3396
+ | 'try'
3397
+ | 'ttd'
3398
+ | 'tzs'
3399
+ | 'uah'
3400
+ | 'uzs'
3401
+ | 'vnd'
3402
+ | 'vuv'
3403
+ | 'wst'
3404
+ | 'xaf'
3405
+ | 'xcd'
3406
+ | 'yer'
3407
+ | 'zar'
3408
+ | 'zmw'
3409
+ | 'clp'
3410
+ | 'djf'
3411
+ | 'gnf'
3412
+ | 'ugx'
3413
+ | 'pyg'
3414
+ | 'xof'
3415
+ | 'xpf';
3416
+ }
3417
+ }
1170
3418
 
1171
- payingCustomerId?: string;
3419
+ export interface PriceOverride {
3420
+ /**
3421
+ * Addon identifier for the price override
3422
+ */
3423
+ addonId?: string | null;
1172
3424
 
1173
- resourceId?: string;
3425
+ /**
3426
+ * Whether this is a base charge override
3427
+ */
3428
+ baseCharge?: boolean;
1174
3429
 
1175
- scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
3430
+ /**
3431
+ * Block size for pricing
3432
+ */
3433
+ blockSize?: number;
1176
3434
 
1177
- /**
1178
- * Subscription start date
1179
- */
1180
- startDate?: string;
3435
+ creditGrantCadence?: 'BEGINNING_OF_BILLING_PERIOD' | 'MONTHLY';
1181
3436
 
1182
- trialOverrideConfiguration?: SubscriptionPreviewParams.TrialOverrideConfiguration;
3437
+ creditRate?: PriceOverride.CreditRate;
1183
3438
 
1184
- unitQuantity?: number;
1185
- }
3439
+ /**
3440
+ * Feature identifier for the price override
3441
+ */
3442
+ featureId?: string | null;
1186
3443
 
1187
- export namespace SubscriptionPreviewParams {
1188
- export interface Addon {
1189
3444
  /**
1190
- * Addon ID
3445
+ * Override price amount
1191
3446
  */
1192
- addonId: string;
3447
+ price?: PriceOverride.Price;
1193
3448
 
1194
- quantity?: number;
3449
+ /**
3450
+ * Pricing tiers configuration
3451
+ */
3452
+ tiers?: Array<PriceOverride.Tier>;
1195
3453
  }
1196
3454
 
1197
- export interface AppliedCoupon {
1198
- billingCouponId?: string;
3455
+ export namespace PriceOverride {
3456
+ export interface CreditRate {
3457
+ /**
3458
+ * The credit rate amount
3459
+ */
3460
+ amount: number;
1199
3461
 
1200
- configuration?: AppliedCoupon.Configuration;
3462
+ /**
3463
+ * The custom currency refId for the credit rate
3464
+ */
3465
+ currencyId: string;
1201
3466
 
1202
- couponId?: string;
3467
+ /**
3468
+ * A custom formula for calculating cost based on single event dimensions
3469
+ */
3470
+ costFormula?: string | null;
3471
+ }
1203
3472
 
1204
- discount?: AppliedCoupon.Discount;
3473
+ /**
3474
+ * Override price amount
3475
+ */
3476
+ export interface Price {
3477
+ /**
3478
+ * The price amount
3479
+ */
3480
+ amount?: number;
1205
3481
 
1206
- promotionCode?: string;
1207
- }
3482
+ /**
3483
+ * The billing country code of the price
3484
+ */
3485
+ billingCountryCode?: string | null;
1208
3486
 
1209
- export namespace AppliedCoupon {
1210
- export interface Configuration {
1211
3487
  /**
1212
- * Coupon start date
3488
+ * The price currency
1213
3489
  */
1214
- startDate?: string;
3490
+ currency?:
3491
+ | 'usd'
3492
+ | 'aed'
3493
+ | 'all'
3494
+ | 'amd'
3495
+ | 'ang'
3496
+ | 'aud'
3497
+ | 'awg'
3498
+ | 'azn'
3499
+ | 'bam'
3500
+ | 'bbd'
3501
+ | 'bdt'
3502
+ | 'bgn'
3503
+ | 'bif'
3504
+ | 'bmd'
3505
+ | 'bnd'
3506
+ | 'bsd'
3507
+ | 'bwp'
3508
+ | 'byn'
3509
+ | 'bzd'
3510
+ | 'brl'
3511
+ | 'cad'
3512
+ | 'cdf'
3513
+ | 'chf'
3514
+ | 'cny'
3515
+ | 'czk'
3516
+ | 'dkk'
3517
+ | 'dop'
3518
+ | 'dzd'
3519
+ | 'egp'
3520
+ | 'etb'
3521
+ | 'eur'
3522
+ | 'fjd'
3523
+ | 'gbp'
3524
+ | 'gel'
3525
+ | 'gip'
3526
+ | 'gmd'
3527
+ | 'gyd'
3528
+ | 'hkd'
3529
+ | 'hrk'
3530
+ | 'htg'
3531
+ | 'idr'
3532
+ | 'ils'
3533
+ | 'inr'
3534
+ | 'isk'
3535
+ | 'jmd'
3536
+ | 'jpy'
3537
+ | 'kes'
3538
+ | 'kgs'
3539
+ | 'khr'
3540
+ | 'kmf'
3541
+ | 'krw'
3542
+ | 'kyd'
3543
+ | 'kzt'
3544
+ | 'lbp'
3545
+ | 'lkr'
3546
+ | 'lrd'
3547
+ | 'lsl'
3548
+ | 'mad'
3549
+ | 'mdl'
3550
+ | 'mga'
3551
+ | 'mkd'
3552
+ | 'mmk'
3553
+ | 'mnt'
3554
+ | 'mop'
3555
+ | 'mro'
3556
+ | 'mvr'
3557
+ | 'mwk'
3558
+ | 'mxn'
3559
+ | 'myr'
3560
+ | 'mzn'
3561
+ | 'nad'
3562
+ | 'ngn'
3563
+ | 'nok'
3564
+ | 'npr'
3565
+ | 'nzd'
3566
+ | 'pgk'
3567
+ | 'php'
3568
+ | 'pkr'
3569
+ | 'pln'
3570
+ | 'qar'
3571
+ | 'ron'
3572
+ | 'rsd'
3573
+ | 'rub'
3574
+ | 'rwf'
3575
+ | 'sar'
3576
+ | 'sbd'
3577
+ | 'scr'
3578
+ | 'sek'
3579
+ | 'sgd'
3580
+ | 'sle'
3581
+ | 'sll'
3582
+ | 'sos'
3583
+ | 'szl'
3584
+ | 'thb'
3585
+ | 'tjs'
3586
+ | 'top'
3587
+ | 'try'
3588
+ | 'ttd'
3589
+ | 'tzs'
3590
+ | 'uah'
3591
+ | 'uzs'
3592
+ | 'vnd'
3593
+ | 'vuv'
3594
+ | 'wst'
3595
+ | 'xaf'
3596
+ | 'xcd'
3597
+ | 'yer'
3598
+ | 'zar'
3599
+ | 'zmw'
3600
+ | 'clp'
3601
+ | 'djf'
3602
+ | 'gnf'
3603
+ | 'ugx'
3604
+ | 'pyg'
3605
+ | 'xof'
3606
+ | 'xpf';
1215
3607
  }
1216
3608
 
1217
- export interface Discount {
1218
- amountsOff?: Array<Discount.AmountsOff> | null;
3609
+ export interface Tier {
3610
+ /**
3611
+ * The flat fee price of the price tier
3612
+ */
3613
+ flatPrice?: Tier.FlatPrice;
1219
3614
 
1220
- description?: string;
3615
+ /**
3616
+ * The unit price of the price tier
3617
+ */
3618
+ unitPrice?: Tier.UnitPrice;
1221
3619
 
1222
- durationInMonths?: number;
3620
+ /**
3621
+ * The up to quantity of the price tier
3622
+ */
3623
+ upTo?: number;
3624
+ }
1223
3625
 
1224
- name?: string;
3626
+ export namespace Tier {
3627
+ /**
3628
+ * The flat fee price of the price tier
3629
+ */
3630
+ export interface FlatPrice {
3631
+ /**
3632
+ * The price amount
3633
+ */
3634
+ amount?: number;
1225
3635
 
1226
- percentOff?: number;
1227
- }
3636
+ /**
3637
+ * The billing country code of the price
3638
+ */
3639
+ billingCountryCode?: string | null;
1228
3640
 
1229
- export namespace Discount {
1230
- export interface AmountsOff {
1231
- amount: number;
3641
+ /**
3642
+ * The price currency
3643
+ */
3644
+ currency?:
3645
+ | 'usd'
3646
+ | 'aed'
3647
+ | 'all'
3648
+ | 'amd'
3649
+ | 'ang'
3650
+ | 'aud'
3651
+ | 'awg'
3652
+ | 'azn'
3653
+ | 'bam'
3654
+ | 'bbd'
3655
+ | 'bdt'
3656
+ | 'bgn'
3657
+ | 'bif'
3658
+ | 'bmd'
3659
+ | 'bnd'
3660
+ | 'bsd'
3661
+ | 'bwp'
3662
+ | 'byn'
3663
+ | 'bzd'
3664
+ | 'brl'
3665
+ | 'cad'
3666
+ | 'cdf'
3667
+ | 'chf'
3668
+ | 'cny'
3669
+ | 'czk'
3670
+ | 'dkk'
3671
+ | 'dop'
3672
+ | 'dzd'
3673
+ | 'egp'
3674
+ | 'etb'
3675
+ | 'eur'
3676
+ | 'fjd'
3677
+ | 'gbp'
3678
+ | 'gel'
3679
+ | 'gip'
3680
+ | 'gmd'
3681
+ | 'gyd'
3682
+ | 'hkd'
3683
+ | 'hrk'
3684
+ | 'htg'
3685
+ | 'idr'
3686
+ | 'ils'
3687
+ | 'inr'
3688
+ | 'isk'
3689
+ | 'jmd'
3690
+ | 'jpy'
3691
+ | 'kes'
3692
+ | 'kgs'
3693
+ | 'khr'
3694
+ | 'kmf'
3695
+ | 'krw'
3696
+ | 'kyd'
3697
+ | 'kzt'
3698
+ | 'lbp'
3699
+ | 'lkr'
3700
+ | 'lrd'
3701
+ | 'lsl'
3702
+ | 'mad'
3703
+ | 'mdl'
3704
+ | 'mga'
3705
+ | 'mkd'
3706
+ | 'mmk'
3707
+ | 'mnt'
3708
+ | 'mop'
3709
+ | 'mro'
3710
+ | 'mvr'
3711
+ | 'mwk'
3712
+ | 'mxn'
3713
+ | 'myr'
3714
+ | 'mzn'
3715
+ | 'nad'
3716
+ | 'ngn'
3717
+ | 'nok'
3718
+ | 'npr'
3719
+ | 'nzd'
3720
+ | 'pgk'
3721
+ | 'php'
3722
+ | 'pkr'
3723
+ | 'pln'
3724
+ | 'qar'
3725
+ | 'ron'
3726
+ | 'rsd'
3727
+ | 'rub'
3728
+ | 'rwf'
3729
+ | 'sar'
3730
+ | 'sbd'
3731
+ | 'scr'
3732
+ | 'sek'
3733
+ | 'sgd'
3734
+ | 'sle'
3735
+ | 'sll'
3736
+ | 'sos'
3737
+ | 'szl'
3738
+ | 'thb'
3739
+ | 'tjs'
3740
+ | 'top'
3741
+ | 'try'
3742
+ | 'ttd'
3743
+ | 'tzs'
3744
+ | 'uah'
3745
+ | 'uzs'
3746
+ | 'vnd'
3747
+ | 'vuv'
3748
+ | 'wst'
3749
+ | 'xaf'
3750
+ | 'xcd'
3751
+ | 'yer'
3752
+ | 'zar'
3753
+ | 'zmw'
3754
+ | 'clp'
3755
+ | 'djf'
3756
+ | 'gnf'
3757
+ | 'ugx'
3758
+ | 'pyg'
3759
+ | 'xof'
3760
+ | 'xpf';
3761
+ }
3762
+
3763
+ /**
3764
+ * The unit price of the price tier
3765
+ */
3766
+ export interface UnitPrice {
3767
+ /**
3768
+ * The price amount
3769
+ */
3770
+ amount?: number;
3771
+
3772
+ /**
3773
+ * The billing country code of the price
3774
+ */
3775
+ billingCountryCode?: string | null;
1232
3776
 
3777
+ /**
3778
+ * The price currency
3779
+ */
1233
3780
  currency?:
1234
3781
  | 'usd'
1235
3782
  | 'aed'
@@ -1351,79 +3898,33 @@ export namespace SubscriptionPreviewParams {
1351
3898
  }
1352
3899
  }
1353
3900
 
1354
- export interface BillableFeature {
3901
+ export interface SubscriptionEntitlement {
1355
3902
  /**
1356
3903
  * Feature ID
1357
3904
  */
1358
3905
  featureId: string;
1359
3906
 
1360
- quantity: number;
1361
- }
1362
-
1363
- export interface BillingInformation {
1364
- billingAddress?: BillingInformation.BillingAddress;
1365
-
1366
- chargeOnBehalfOfAccount?: string;
1367
-
1368
- integrationId?: string;
1369
-
1370
- invoiceDaysUntilDue?: number;
1371
-
1372
- isBackdated?: boolean;
1373
-
1374
- isInvoicePaid?: boolean;
1375
-
1376
- metadata?: unknown;
1377
-
1378
- prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
1379
-
1380
- taxIds?: Array<BillingInformation.TaxID>;
1381
-
1382
- taxPercentage?: number;
1383
-
1384
- taxRateIds?: Array<string>;
1385
- }
1386
-
1387
- export namespace BillingInformation {
1388
- export interface BillingAddress {
1389
- city?: string;
1390
-
1391
- country?: string;
1392
-
1393
- line1?: string;
1394
-
1395
- line2?: string;
1396
-
1397
- postalCode?: string;
1398
-
1399
- state?: string;
1400
- }
1401
-
1402
- export interface TaxID {
1403
- type: string;
3907
+ usageLimit: number;
1404
3908
 
1405
- value: string;
1406
- }
3909
+ isGranted?: boolean;
1407
3910
  }
1408
3911
 
1409
- export interface Charge {
3912
+ /**
3913
+ * Trial period override settings
3914
+ */
3915
+ export interface TrialOverrideConfiguration {
1410
3916
  /**
1411
- * Charge ID
3917
+ * Whether the subscription should start with a trial period
1412
3918
  */
1413
- id: string;
1414
-
1415
- quantity: number;
1416
-
1417
- type: 'FEATURE' | 'CREDIT';
1418
- }
1419
-
1420
- export interface TrialOverrideConfiguration {
1421
3919
  isTrial: boolean;
1422
3920
 
3921
+ /**
3922
+ * Behavior when trial ends: CONVERT_TO_PAID or CANCEL_SUBSCRIPTION
3923
+ */
1423
3924
  trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
1424
3925
 
1425
3926
  /**
1426
- * Trial end date
3927
+ * Custom trial end date
1427
3928
  */
1428
3929
  trialEndDate?: string;
1429
3930
  }
@@ -1431,34 +3932,42 @@ export namespace SubscriptionPreviewParams {
1431
3932
 
1432
3933
  export interface SubscriptionTransferParams {
1433
3934
  /**
1434
- * The resource ID to transfer the subscription to. The destination resource must
1435
- * belong to the same customer.
3935
+ * Resource ID to transfer the subscription to
1436
3936
  */
1437
3937
  destinationResourceId: string;
1438
3938
  }
1439
3939
 
1440
3940
  Subscriptions.FutureUpdate = FutureUpdate;
3941
+ Subscriptions.Usage = Usage;
3942
+ Subscriptions.Invoice = Invoice;
1441
3943
 
1442
3944
  export declare namespace Subscriptions {
1443
3945
  export {
1444
- type SubscriptionCreateResponse as SubscriptionCreateResponse,
1445
- type SubscriptionRetrieveResponse as SubscriptionRetrieveResponse,
3946
+ type Subscription as Subscription,
1446
3947
  type SubscriptionListResponse as SubscriptionListResponse,
1447
- type SubscriptionDelegateResponse as SubscriptionDelegateResponse,
1448
- type SubscriptionMigrateResponse as SubscriptionMigrateResponse,
3948
+ type SubscriptionImportResponse as SubscriptionImportResponse,
1449
3949
  type SubscriptionPreviewResponse as SubscriptionPreviewResponse,
1450
- type SubscriptionTransferResponse as SubscriptionTransferResponse,
1451
- type SubscriptionCreateParams as SubscriptionCreateParams,
3950
+ type SubscriptionProvisionResponse as SubscriptionProvisionResponse,
3951
+ type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage,
3952
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
1452
3953
  type SubscriptionListParams as SubscriptionListParams,
3954
+ type SubscriptionCancelParams as SubscriptionCancelParams,
1453
3955
  type SubscriptionDelegateParams as SubscriptionDelegateParams,
3956
+ type SubscriptionImportParams as SubscriptionImportParams,
1454
3957
  type SubscriptionMigrateParams as SubscriptionMigrateParams,
1455
3958
  type SubscriptionPreviewParams as SubscriptionPreviewParams,
3959
+ type SubscriptionProvisionParams as SubscriptionProvisionParams,
1456
3960
  type SubscriptionTransferParams as SubscriptionTransferParams,
1457
3961
  };
1458
3962
 
3963
+ export { FutureUpdate as FutureUpdate, type CancelSubscription as CancelSubscription };
3964
+
1459
3965
  export {
1460
- FutureUpdate as FutureUpdate,
1461
- type FutureUpdateCancelPendingPaymentResponse as FutureUpdateCancelPendingPaymentResponse,
1462
- type FutureUpdateCancelScheduleResponse as FutureUpdateCancelScheduleResponse,
3966
+ Usage as Usage,
3967
+ type UsageChargeUsageResponse as UsageChargeUsageResponse,
3968
+ type UsageSyncResponse as UsageSyncResponse,
3969
+ type UsageChargeUsageParams as UsageChargeUsageParams,
1463
3970
  };
3971
+
3972
+ export { Invoice as Invoice, type InvoiceMarkAsPaidResponse as InvoiceMarkAsPaidResponse };
1464
3973
  }