@metronome/sdk 3.6.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts.map +1 -1
  9. package/client.d.ts.map +1 -1
  10. package/client.js +9 -1
  11. package/client.js.map +1 -1
  12. package/client.mjs +9 -1
  13. package/client.mjs.map +1 -1
  14. package/core/api-promise.d.mts.map +1 -1
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.mjs.map +1 -1
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.d.mts.map +1 -1
  19. package/core/pagination.d.ts.map +1 -1
  20. package/core/pagination.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +4 -4
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +4 -4
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.mjs.map +1 -1
  73. package/internal/utils/path.mjs.map +1 -1
  74. package/internal/utils/query.mjs.map +1 -1
  75. package/internal/utils/values.mjs.map +1 -1
  76. package/internal/utils.d.mts.map +1 -1
  77. package/internal/utils.d.ts.map +1 -1
  78. package/internal/utils.mjs.map +1 -1
  79. package/package.json +1 -1
  80. package/pagination.d.mts +1 -0
  81. package/pagination.d.mts.map +1 -1
  82. package/pagination.d.ts +1 -0
  83. package/pagination.d.ts.map +1 -1
  84. package/pagination.mjs +1 -0
  85. package/pagination.mjs.map +1 -1
  86. package/resource.d.mts +1 -0
  87. package/resource.d.mts.map +1 -1
  88. package/resource.d.ts +1 -0
  89. package/resource.d.ts.map +1 -1
  90. package/resource.mjs +1 -0
  91. package/resource.mjs.map +1 -1
  92. package/resources/index.d.mts.map +1 -1
  93. package/resources/index.d.ts.map +1 -1
  94. package/resources/index.mjs.map +1 -1
  95. package/resources/shared.d.mts +420 -4
  96. package/resources/shared.d.mts.map +1 -1
  97. package/resources/shared.d.ts +420 -4
  98. package/resources/shared.d.ts.map +1 -1
  99. package/resources/v1/alerts.d.mts +39 -0
  100. package/resources/v1/alerts.d.mts.map +1 -1
  101. package/resources/v1/alerts.d.ts +39 -0
  102. package/resources/v1/alerts.d.ts.map +1 -1
  103. package/resources/v1/alerts.mjs.map +1 -1
  104. package/resources/v1/audit-logs.d.mts.map +1 -1
  105. package/resources/v1/audit-logs.d.ts.map +1 -1
  106. package/resources/v1/audit-logs.mjs.map +1 -1
  107. package/resources/v1/billable-metrics.d.mts.map +1 -1
  108. package/resources/v1/billable-metrics.d.ts.map +1 -1
  109. package/resources/v1/billable-metrics.mjs.map +1 -1
  110. package/resources/v1/contracts/contracts.d.mts +674 -10
  111. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  112. package/resources/v1/contracts/contracts.d.ts +674 -10
  113. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  114. package/resources/v1/contracts/contracts.js +43 -0
  115. package/resources/v1/contracts/contracts.js.map +1 -1
  116. package/resources/v1/contracts/contracts.mjs +43 -0
  117. package/resources/v1/contracts/contracts.mjs.map +1 -1
  118. package/resources/v1/contracts/index.d.mts +1 -1
  119. package/resources/v1/contracts/index.d.mts.map +1 -1
  120. package/resources/v1/contracts/index.d.ts +1 -1
  121. package/resources/v1/contracts/index.d.ts.map +1 -1
  122. package/resources/v1/contracts/index.js.map +1 -1
  123. package/resources/v1/contracts/index.mjs.map +1 -1
  124. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  125. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  126. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  127. package/resources/v1/contracts/products.d.mts.map +1 -1
  128. package/resources/v1/contracts/products.d.ts.map +1 -1
  129. package/resources/v1/contracts/products.mjs.map +1 -1
  130. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  131. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  132. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  133. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  134. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  135. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  136. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  137. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  138. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  139. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  140. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  141. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  142. package/resources/v1/contracts/rate-cards/rates.d.mts +4 -0
  143. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  144. package/resources/v1/contracts/rate-cards/rates.d.ts +4 -0
  145. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  146. package/resources/v1/contracts/rate-cards/rates.js +4 -0
  147. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  148. package/resources/v1/contracts/rate-cards/rates.mjs +4 -0
  149. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  150. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  151. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  152. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  153. package/resources/v1/contracts.d.mts.map +1 -1
  154. package/resources/v1/contracts.d.ts.map +1 -1
  155. package/resources/v1/contracts.mjs.map +1 -1
  156. package/resources/v1/credit-grants.d.mts.map +1 -1
  157. package/resources/v1/credit-grants.d.ts.map +1 -1
  158. package/resources/v1/credit-grants.mjs.map +1 -1
  159. package/resources/v1/custom-fields.d.mts.map +1 -1
  160. package/resources/v1/custom-fields.d.ts.map +1 -1
  161. package/resources/v1/custom-fields.mjs.map +1 -1
  162. package/resources/v1/customers/alerts.d.mts +79 -2
  163. package/resources/v1/customers/alerts.d.mts.map +1 -1
  164. package/resources/v1/customers/alerts.d.ts +79 -2
  165. package/resources/v1/customers/alerts.d.ts.map +1 -1
  166. package/resources/v1/customers/alerts.js +1 -1
  167. package/resources/v1/customers/alerts.mjs +1 -1
  168. package/resources/v1/customers/alerts.mjs.map +1 -1
  169. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  170. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  171. package/resources/v1/customers/billing-config.mjs.map +1 -1
  172. package/resources/v1/customers/commits.d.mts.map +1 -1
  173. package/resources/v1/customers/commits.d.ts.map +1 -1
  174. package/resources/v1/customers/commits.mjs.map +1 -1
  175. package/resources/v1/customers/credits.d.mts.map +1 -1
  176. package/resources/v1/customers/credits.d.ts.map +1 -1
  177. package/resources/v1/customers/credits.mjs.map +1 -1
  178. package/resources/v1/customers/customers.d.mts.map +1 -1
  179. package/resources/v1/customers/customers.d.ts.map +1 -1
  180. package/resources/v1/customers/customers.mjs.map +1 -1
  181. package/resources/v1/customers/index.d.mts.map +1 -1
  182. package/resources/v1/customers/index.d.ts.map +1 -1
  183. package/resources/v1/customers/index.mjs.map +1 -1
  184. package/resources/v1/customers/invoices.d.mts +5 -0
  185. package/resources/v1/customers/invoices.d.mts.map +1 -1
  186. package/resources/v1/customers/invoices.d.ts +5 -0
  187. package/resources/v1/customers/invoices.d.ts.map +1 -1
  188. package/resources/v1/customers/invoices.mjs.map +1 -1
  189. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  190. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  191. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  192. package/resources/v1/customers/plans.d.mts.map +1 -1
  193. package/resources/v1/customers/plans.d.ts.map +1 -1
  194. package/resources/v1/customers/plans.mjs.map +1 -1
  195. package/resources/v1/customers.d.mts.map +1 -1
  196. package/resources/v1/customers.d.ts.map +1 -1
  197. package/resources/v1/customers.mjs.map +1 -1
  198. package/resources/v1/dashboards.d.mts +8 -3
  199. package/resources/v1/dashboards.d.mts.map +1 -1
  200. package/resources/v1/dashboards.d.ts +8 -3
  201. package/resources/v1/dashboards.d.ts.map +1 -1
  202. package/resources/v1/dashboards.js +7 -2
  203. package/resources/v1/dashboards.js.map +1 -1
  204. package/resources/v1/dashboards.mjs +7 -2
  205. package/resources/v1/dashboards.mjs.map +1 -1
  206. package/resources/v1/index.d.mts +1 -2
  207. package/resources/v1/index.d.mts.map +1 -1
  208. package/resources/v1/index.d.ts +1 -2
  209. package/resources/v1/index.d.ts.map +1 -1
  210. package/resources/v1/index.js +1 -3
  211. package/resources/v1/index.js.map +1 -1
  212. package/resources/v1/index.mjs +0 -1
  213. package/resources/v1/index.mjs.map +1 -1
  214. package/resources/v1/invoices.d.mts.map +1 -1
  215. package/resources/v1/invoices.d.ts.map +1 -1
  216. package/resources/v1/invoices.mjs.map +1 -1
  217. package/resources/v1/packages.d.mts +297 -13
  218. package/resources/v1/packages.d.mts.map +1 -1
  219. package/resources/v1/packages.d.ts +297 -13
  220. package/resources/v1/packages.d.ts.map +1 -1
  221. package/resources/v1/packages.js +3 -4
  222. package/resources/v1/packages.js.map +1 -1
  223. package/resources/v1/packages.mjs +3 -4
  224. package/resources/v1/packages.mjs.map +1 -1
  225. package/resources/v1/plans.d.mts.map +1 -1
  226. package/resources/v1/plans.d.ts.map +1 -1
  227. package/resources/v1/plans.mjs.map +1 -1
  228. package/resources/v1/pricing-units.d.mts.map +1 -1
  229. package/resources/v1/pricing-units.d.ts.map +1 -1
  230. package/resources/v1/pricing-units.mjs.map +1 -1
  231. package/resources/v1/services.d.mts.map +1 -1
  232. package/resources/v1/services.d.ts.map +1 -1
  233. package/resources/v1/services.mjs.map +1 -1
  234. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  235. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  236. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  237. package/resources/v1/settings/index.d.mts.map +1 -1
  238. package/resources/v1/settings/index.d.ts.map +1 -1
  239. package/resources/v1/settings/index.mjs.map +1 -1
  240. package/resources/v1/settings/settings.d.mts.map +1 -1
  241. package/resources/v1/settings/settings.d.ts.map +1 -1
  242. package/resources/v1/settings/settings.mjs.map +1 -1
  243. package/resources/v1/settings.d.mts.map +1 -1
  244. package/resources/v1/settings.d.ts.map +1 -1
  245. package/resources/v1/settings.mjs.map +1 -1
  246. package/resources/v1/usage.d.mts.map +1 -1
  247. package/resources/v1/usage.d.ts.map +1 -1
  248. package/resources/v1/usage.mjs.map +1 -1
  249. package/resources/v1/v1.d.mts +2 -6
  250. package/resources/v1/v1.d.mts.map +1 -1
  251. package/resources/v1/v1.d.ts +2 -6
  252. package/resources/v1/v1.d.ts.map +1 -1
  253. package/resources/v1/v1.js +0 -4
  254. package/resources/v1/v1.js.map +1 -1
  255. package/resources/v1/v1.mjs +0 -4
  256. package/resources/v1/v1.mjs.map +1 -1
  257. package/resources/v1.d.mts.map +1 -1
  258. package/resources/v1.d.ts.map +1 -1
  259. package/resources/v1.mjs.map +1 -1
  260. package/resources/v2/contracts.d.mts +1762 -5
  261. package/resources/v2/contracts.d.mts.map +1 -1
  262. package/resources/v2/contracts.d.ts +1762 -5
  263. package/resources/v2/contracts.d.ts.map +1 -1
  264. package/resources/v2/contracts.mjs.map +1 -1
  265. package/resources/v2/index.d.mts.map +1 -1
  266. package/resources/v2/index.d.ts.map +1 -1
  267. package/resources/v2/index.mjs.map +1 -1
  268. package/resources/v2/v2.d.mts.map +1 -1
  269. package/resources/v2/v2.d.ts.map +1 -1
  270. package/resources/v2/v2.mjs.map +1 -1
  271. package/resources/v2.d.mts.map +1 -1
  272. package/resources/v2.d.ts.map +1 -1
  273. package/resources/v2.mjs.map +1 -1
  274. package/resources/webhooks.d.mts.map +1 -1
  275. package/resources/webhooks.d.ts.map +1 -1
  276. package/resources/webhooks.mjs.map +1 -1
  277. package/resources.d.mts.map +1 -1
  278. package/resources.d.ts.map +1 -1
  279. package/resources.mjs.map +1 -1
  280. package/src/client.ts +9 -1
  281. package/src/resources/shared.ts +524 -4
  282. package/src/resources/v1/alerts.ts +49 -0
  283. package/src/resources/v1/contracts/contracts.ts +850 -9
  284. package/src/resources/v1/contracts/index.ts +2 -0
  285. package/src/resources/v1/contracts/rate-cards/rates.ts +4 -0
  286. package/src/resources/v1/customers/alerts.ts +99 -2
  287. package/src/resources/v1/customers/invoices.ts +6 -0
  288. package/src/resources/v1/dashboards.ts +10 -3
  289. package/src/resources/v1/index.ts +2 -11
  290. package/src/resources/v1/packages.ts +372 -13
  291. package/src/resources/v1/v1.ts +4 -26
  292. package/src/resources/v2/contracts.ts +2271 -5
  293. package/src/version.ts +1 -1
  294. package/uploads.d.mts +1 -0
  295. package/uploads.d.mts.map +1 -1
  296. package/uploads.d.ts +1 -0
  297. package/uploads.d.ts.map +1 -1
  298. package/uploads.mjs +1 -0
  299. package/uploads.mjs.map +1 -1
  300. package/version.d.mts +1 -1
  301. package/version.d.ts +1 -1
  302. package/version.js +1 -1
  303. package/version.mjs +1 -1
  304. package/resources/v1/payments.d.mts +0 -127
  305. package/resources/v1/payments.d.mts.map +0 -1
  306. package/resources/v1/payments.d.ts +0 -127
  307. package/resources/v1/payments.d.ts.map +0 -1
  308. package/resources/v1/payments.js +0 -71
  309. package/resources/v1/payments.js.map +0 -1
  310. package/resources/v1/payments.mjs +0 -67
  311. package/resources/v1/payments.mjs.map +0 -1
  312. package/src/resources/v1/payments.ts +0 -187
@@ -245,7 +245,1739 @@ export interface ContractListResponse {
245
245
  }
246
246
 
247
247
  export interface ContractEditResponse {
248
- data: Shared.ID;
248
+ data: ContractEditResponse.Data;
249
+ }
250
+
251
+ export namespace ContractEditResponse {
252
+ export interface Data {
253
+ id: string;
254
+
255
+ edit?: Data.Edit;
256
+ }
257
+
258
+ export namespace Data {
259
+ export interface Edit {
260
+ id: string;
261
+
262
+ add_commits?: Array<Edit.AddCommit>;
263
+
264
+ add_credits?: Array<Edit.AddCredit>;
265
+
266
+ add_discounts?: Array<Shared.Discount>;
267
+
268
+ add_overrides?: Array<Edit.AddOverride>;
269
+
270
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
271
+
272
+ add_pro_services?: Array<Shared.ProService>;
273
+
274
+ add_recurring_commits?: Array<Edit.AddRecurringCommit>;
275
+
276
+ add_recurring_credits?: Array<Edit.AddRecurringCredit>;
277
+
278
+ add_reseller_royalties?: Array<Edit.AddResellerRoyalty>;
279
+
280
+ add_scheduled_charges?: Array<Edit.AddScheduledCharge>;
281
+
282
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
283
+
284
+ /**
285
+ * List of subscriptions on the contract.
286
+ */
287
+ add_subscriptions?: Array<Edit.AddSubscription>;
288
+
289
+ add_usage_filters?: Array<Edit.AddUsageFilter>;
290
+
291
+ archive_commits?: Array<Edit.ArchiveCommit>;
292
+
293
+ archive_credits?: Array<Edit.ArchiveCredit>;
294
+
295
+ archive_scheduled_charges?: Array<Edit.ArchiveScheduledCharge>;
296
+
297
+ remove_overrides?: Array<Edit.RemoveOverride>;
298
+
299
+ timestamp?: string;
300
+
301
+ /**
302
+ * Prevents the creation of duplicates. If a request to create a record is made
303
+ * with a previously used uniqueness key, a new record will not be created and the
304
+ * request will fail with a 409 error.
305
+ */
306
+ uniqueness_key?: string;
307
+
308
+ update_commits?: Array<Edit.UpdateCommit>;
309
+
310
+ update_contract_end_date?: string;
311
+
312
+ /**
313
+ * Value to update the contract name to. If not provided, the contract name will
314
+ * remain unchanged.
315
+ */
316
+ update_contract_name?: string | null;
317
+
318
+ update_credits?: Array<Edit.UpdateCredit>;
319
+
320
+ update_discounts?: Array<Edit.UpdateDiscount>;
321
+
322
+ update_prepaid_balance_threshold_configuration?: Edit.UpdatePrepaidBalanceThresholdConfiguration;
323
+
324
+ update_recurring_commits?: Array<Edit.UpdateRecurringCommit>;
325
+
326
+ update_recurring_credits?: Array<Edit.UpdateRecurringCredit>;
327
+
328
+ update_refund_invoices?: Array<Edit.UpdateRefundInvoice>;
329
+
330
+ update_scheduled_charges?: Array<Edit.UpdateScheduledCharge>;
331
+
332
+ update_spend_threshold_configuration?: Edit.UpdateSpendThresholdConfiguration;
333
+
334
+ /**
335
+ * Optional list of subscriptions to update.
336
+ */
337
+ update_subscriptions?: Array<Edit.UpdateSubscription>;
338
+ }
339
+
340
+ export namespace Edit {
341
+ export interface AddCommit {
342
+ id: string;
343
+
344
+ product: AddCommit.Product;
345
+
346
+ type: 'PREPAID' | 'POSTPAID';
347
+
348
+ /**
349
+ * The schedule that the customer will gain access to the credits purposed with
350
+ * this commit.
351
+ */
352
+ access_schedule?: Shared.ScheduleDuration;
353
+
354
+ applicable_product_ids?: Array<string>;
355
+
356
+ applicable_product_tags?: Array<string>;
357
+
358
+ description?: string;
359
+
360
+ /**
361
+ * Optional configuration for commit hierarchy access control
362
+ */
363
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
364
+
365
+ /**
366
+ * The schedule that the customer will be invoiced for this commit.
367
+ */
368
+ invoice_schedule?: AddCommit.InvoiceSchedule;
369
+
370
+ name?: string;
371
+
372
+ /**
373
+ * This field's availability is dependent on your client's configuration.
374
+ */
375
+ netsuite_sales_order_id?: string;
376
+
377
+ /**
378
+ * If multiple credits or commits are applicable, the one with the lower priority
379
+ * will apply first.
380
+ */
381
+ priority?: number;
382
+
383
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
384
+
385
+ rollover_fraction?: number;
386
+
387
+ /**
388
+ * This field's availability is dependent on your client's configuration.
389
+ */
390
+ salesforce_opportunity_id?: string;
391
+
392
+ /**
393
+ * List of filters that determine what kind of customer usage draws down a commit
394
+ * or credit. A customer's usage needs to meet the condition of at least one of the
395
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
396
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
397
+ * Instead, to target usage by product or product tag, pass those values in the
398
+ * body of `specifiers`.
399
+ */
400
+ specifiers?: Array<Shared.CommitSpecifierInput>;
401
+ }
402
+
403
+ export namespace AddCommit {
404
+ export interface Product {
405
+ id: string;
406
+
407
+ name: string;
408
+ }
409
+
410
+ /**
411
+ * The schedule that the customer will be invoiced for this commit.
412
+ */
413
+ export interface InvoiceSchedule {
414
+ credit_type?: Shared.CreditTypeData;
415
+
416
+ /**
417
+ * If true, this schedule will not generate an invoice.
418
+ */
419
+ do_not_invoice?: boolean;
420
+
421
+ schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
422
+ }
423
+
424
+ export namespace InvoiceSchedule {
425
+ export interface ScheduleItem {
426
+ id: string;
427
+
428
+ timestamp: string;
429
+
430
+ amount?: number;
431
+
432
+ invoice_id?: string | null;
433
+
434
+ quantity?: number;
435
+
436
+ unit_price?: number;
437
+ }
438
+ }
439
+ }
440
+
441
+ export interface AddCredit {
442
+ id: string;
443
+
444
+ product: AddCredit.Product;
445
+
446
+ type: 'CREDIT';
447
+
448
+ /**
449
+ * The schedule that the customer will gain access to the credits.
450
+ */
451
+ access_schedule?: Shared.ScheduleDuration;
452
+
453
+ applicable_product_ids?: Array<string>;
454
+
455
+ applicable_product_tags?: Array<string>;
456
+
457
+ description?: string;
458
+
459
+ /**
460
+ * Optional configuration for recurring credit hierarchy access control
461
+ */
462
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
463
+
464
+ name?: string;
465
+
466
+ /**
467
+ * This field's availability is dependent on your client's configuration.
468
+ */
469
+ netsuite_sales_order_id?: string;
470
+
471
+ /**
472
+ * If multiple credits or commits are applicable, the one with the lower priority
473
+ * will apply first.
474
+ */
475
+ priority?: number;
476
+
477
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
478
+
479
+ rollover_fraction?: number;
480
+
481
+ /**
482
+ * This field's availability is dependent on your client's configuration.
483
+ */
484
+ salesforce_opportunity_id?: string;
485
+
486
+ /**
487
+ * List of filters that determine what kind of customer usage draws down a commit
488
+ * or credit. A customer's usage needs to meet the condition of at least one of the
489
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
490
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
491
+ * Instead, to target usage by product or product tag, pass those values in the
492
+ * body of `specifiers`.
493
+ */
494
+ specifiers?: Array<Shared.CommitSpecifierInput>;
495
+ }
496
+
497
+ export namespace AddCredit {
498
+ export interface Product {
499
+ id: string;
500
+
501
+ name: string;
502
+ }
503
+ }
504
+
505
+ export interface AddOverride {
506
+ id: string;
507
+
508
+ created_at: string;
509
+
510
+ starting_at: string;
511
+
512
+ applicable_product_tags?: Array<string>;
513
+
514
+ ending_before?: string;
515
+
516
+ entitled?: boolean;
517
+
518
+ is_commit_specific?: boolean;
519
+
520
+ multiplier?: number;
521
+
522
+ override_specifiers?: Array<AddOverride.OverrideSpecifier>;
523
+
524
+ override_tiers?: Array<Shared.OverrideTier>;
525
+
526
+ overwrite_rate?: AddOverride.OverwriteRate;
527
+
528
+ priority?: number;
529
+
530
+ product?: AddOverride.Product;
531
+
532
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
533
+
534
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
535
+ }
536
+
537
+ export namespace AddOverride {
538
+ export interface OverrideSpecifier {
539
+ any_commit_or_credit_ids?: Array<string>;
540
+
541
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
542
+
543
+ commit_ids?: Array<string>;
544
+
545
+ presentation_group_values?: { [key: string]: string | null };
546
+
547
+ pricing_group_values?: { [key: string]: string };
548
+
549
+ product_id?: string;
550
+
551
+ product_tags?: Array<string>;
552
+
553
+ recurring_commit_ids?: Array<string>;
554
+ }
555
+
556
+ export interface OverwriteRate {
557
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
558
+
559
+ credit_type?: Shared.CreditTypeData;
560
+
561
+ /**
562
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
563
+ * processors.
564
+ */
565
+ custom_rate?: { [key: string]: unknown };
566
+
567
+ /**
568
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
569
+ * set to true.
570
+ */
571
+ is_prorated?: boolean;
572
+
573
+ /**
574
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
575
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
576
+ */
577
+ price?: number;
578
+
579
+ /**
580
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
581
+ */
582
+ quantity?: number;
583
+
584
+ /**
585
+ * Only set for TIERED rate_type.
586
+ */
587
+ tiers?: Array<Shared.Tier>;
588
+ }
589
+
590
+ export interface Product {
591
+ id: string;
592
+
593
+ name: string;
594
+ }
595
+ }
596
+
597
+ export interface AddRecurringCommit {
598
+ id: string;
599
+
600
+ /**
601
+ * The amount of commit to grant.
602
+ */
603
+ access_amount: AddRecurringCommit.AccessAmount;
604
+
605
+ /**
606
+ * The amount of time the created commits will be valid for
607
+ */
608
+ commit_duration: AddRecurringCommit.CommitDuration;
609
+
610
+ /**
611
+ * Will be passed down to the individual commits
612
+ */
613
+ priority: number;
614
+
615
+ product: AddRecurringCommit.Product;
616
+
617
+ /**
618
+ * Whether the created commits will use the commit rate or list rate
619
+ */
620
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
621
+
622
+ /**
623
+ * Determines the start time for the first commit
624
+ */
625
+ starting_at: string;
626
+
627
+ /**
628
+ * Will be passed down to the individual commits
629
+ */
630
+ applicable_product_ids?: Array<string>;
631
+
632
+ /**
633
+ * Will be passed down to the individual commits
634
+ */
635
+ applicable_product_tags?: Array<string>;
636
+
637
+ contract?: AddRecurringCommit.Contract;
638
+
639
+ /**
640
+ * Will be passed down to the individual commits
641
+ */
642
+ description?: string;
643
+
644
+ /**
645
+ * Determines when the contract will stop creating recurring commits. Optional
646
+ */
647
+ ending_before?: string;
648
+
649
+ /**
650
+ * Optional configuration for recurring credit hierarchy access control
651
+ */
652
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
653
+
654
+ /**
655
+ * The amount the customer should be billed for the commit. Not required.
656
+ */
657
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
658
+
659
+ /**
660
+ * Displayed on invoices. Will be passed through to the individual commits
661
+ */
662
+ name?: string;
663
+
664
+ /**
665
+ * Will be passed down to the individual commits
666
+ */
667
+ netsuite_sales_order_id?: string;
668
+
669
+ /**
670
+ * Determines whether the first and last commit will be prorated. If not provided,
671
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
672
+ */
673
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
674
+
675
+ /**
676
+ * Rounding configuration for prorated recurring commit amounts.
677
+ */
678
+ proration_rounding?: AddRecurringCommit.ProrationRounding | null;
679
+
680
+ /**
681
+ * The frequency at which the recurring commits will be created. If not provided: -
682
+ * The commits will be created on the usage invoice frequency. If provided: - The
683
+ * period defined in the duration will correspond to this frequency. - Commits will
684
+ * be created aligned with the recurring commit's starting_at rather than the usage
685
+ * invoice dates.
686
+ */
687
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
688
+
689
+ /**
690
+ * Will be passed down to the individual commits. This controls how much of an
691
+ * individual unexpired commit will roll over upon contract transition. Must be
692
+ * between 0 and 1.
693
+ */
694
+ rollover_fraction?: number;
695
+
696
+ /**
697
+ * List of filters that determine what kind of customer usage draws down a commit
698
+ * or credit. A customer's usage needs to meet the condition of at least one of the
699
+ * specifiers to contribute to a commit's or credit's drawdown.
700
+ */
701
+ specifiers?: Array<Shared.CommitSpecifier>;
702
+
703
+ /**
704
+ * Attach a subscription to the recurring commit/credit.
705
+ */
706
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
707
+ }
708
+
709
+ export namespace AddRecurringCommit {
710
+ /**
711
+ * The amount of commit to grant.
712
+ */
713
+ export interface AccessAmount {
714
+ credit_type_id: string;
715
+
716
+ unit_price: number;
717
+
718
+ quantity?: number;
719
+ }
720
+
721
+ /**
722
+ * The amount of time the created commits will be valid for
723
+ */
724
+ export interface CommitDuration {
725
+ value: number;
726
+
727
+ unit?: 'PERIODS';
728
+ }
729
+
730
+ export interface Product {
731
+ id: string;
732
+
733
+ name: string;
734
+ }
735
+
736
+ export interface Contract {
737
+ id: string;
738
+ }
739
+
740
+ /**
741
+ * The amount the customer should be billed for the commit. Not required.
742
+ */
743
+ export interface InvoiceAmount {
744
+ credit_type_id: string;
745
+
746
+ quantity: number;
747
+
748
+ unit_price: number;
749
+ }
750
+
751
+ /**
752
+ * Rounding configuration for prorated recurring commit amounts.
753
+ */
754
+ export interface ProrationRounding {
755
+ access?: ProrationRounding.Access;
756
+
757
+ invoice?: ProrationRounding.Invoice;
758
+ }
759
+
760
+ export namespace ProrationRounding {
761
+ export interface Access {
762
+ /**
763
+ * Number of decimal places to round to. Applied directly to the stored monetary
764
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
765
+ * nearest 100 in the stored unit).
766
+ */
767
+ decimal_places: number;
768
+
769
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
770
+ }
771
+
772
+ export interface Invoice {
773
+ /**
774
+ * Number of decimal places to round to. Applied directly to the stored monetary
775
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
776
+ * nearest 100 in the stored unit).
777
+ */
778
+ decimal_places: number;
779
+
780
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
781
+ }
782
+ }
783
+ }
784
+
785
+ export interface AddRecurringCredit {
786
+ id: string;
787
+
788
+ /**
789
+ * The amount of commit to grant.
790
+ */
791
+ access_amount: AddRecurringCredit.AccessAmount;
792
+
793
+ /**
794
+ * The amount of time the created commits will be valid for
795
+ */
796
+ commit_duration: AddRecurringCredit.CommitDuration;
797
+
798
+ /**
799
+ * Will be passed down to the individual commits
800
+ */
801
+ priority: number;
802
+
803
+ product: AddRecurringCredit.Product;
804
+
805
+ /**
806
+ * Whether the created commits will use the commit rate or list rate
807
+ */
808
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
809
+
810
+ /**
811
+ * Determines the start time for the first commit
812
+ */
813
+ starting_at: string;
814
+
815
+ /**
816
+ * Will be passed down to the individual commits
817
+ */
818
+ applicable_product_ids?: Array<string>;
819
+
820
+ /**
821
+ * Will be passed down to the individual commits
822
+ */
823
+ applicable_product_tags?: Array<string>;
824
+
825
+ contract?: AddRecurringCredit.Contract;
826
+
827
+ /**
828
+ * Will be passed down to the individual commits
829
+ */
830
+ description?: string;
831
+
832
+ /**
833
+ * Determines when the contract will stop creating recurring commits. Optional
834
+ */
835
+ ending_before?: string;
836
+
837
+ /**
838
+ * Optional configuration for recurring credit hierarchy access control
839
+ */
840
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
841
+
842
+ /**
843
+ * Displayed on invoices. Will be passed through to the individual commits
844
+ */
845
+ name?: string;
846
+
847
+ /**
848
+ * Will be passed down to the individual commits
849
+ */
850
+ netsuite_sales_order_id?: string;
851
+
852
+ /**
853
+ * Determines whether the first and last commit will be prorated. If not provided,
854
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
855
+ */
856
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
857
+
858
+ /**
859
+ * Rounding configuration for prorated recurring credit amounts.
860
+ */
861
+ proration_rounding?: AddRecurringCredit.ProrationRounding | null;
862
+
863
+ /**
864
+ * The frequency at which the recurring commits will be created. If not provided: -
865
+ * The commits will be created on the usage invoice frequency. If provided: - The
866
+ * period defined in the duration will correspond to this frequency. - Commits will
867
+ * be created aligned with the recurring commit's starting_at rather than the usage
868
+ * invoice dates.
869
+ */
870
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
871
+
872
+ /**
873
+ * Will be passed down to the individual commits. This controls how much of an
874
+ * individual unexpired commit will roll over upon contract transition. Must be
875
+ * between 0 and 1.
876
+ */
877
+ rollover_fraction?: number;
878
+
879
+ /**
880
+ * List of filters that determine what kind of customer usage draws down a commit
881
+ * or credit. A customer's usage needs to meet the condition of at least one of the
882
+ * specifiers to contribute to a commit's or credit's drawdown.
883
+ */
884
+ specifiers?: Array<Shared.CommitSpecifier>;
885
+
886
+ /**
887
+ * Attach a subscription to the recurring commit/credit.
888
+ */
889
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
890
+ }
891
+
892
+ export namespace AddRecurringCredit {
893
+ /**
894
+ * The amount of commit to grant.
895
+ */
896
+ export interface AccessAmount {
897
+ credit_type_id: string;
898
+
899
+ unit_price: number;
900
+
901
+ quantity?: number;
902
+ }
903
+
904
+ /**
905
+ * The amount of time the created commits will be valid for
906
+ */
907
+ export interface CommitDuration {
908
+ value: number;
909
+
910
+ unit?: 'PERIODS';
911
+ }
912
+
913
+ export interface Product {
914
+ id: string;
915
+
916
+ name: string;
917
+ }
918
+
919
+ export interface Contract {
920
+ id: string;
921
+ }
922
+
923
+ /**
924
+ * Rounding configuration for prorated recurring credit amounts.
925
+ */
926
+ export interface ProrationRounding {
927
+ access?: ProrationRounding.Access;
928
+ }
929
+
930
+ export namespace ProrationRounding {
931
+ export interface Access {
932
+ /**
933
+ * Number of decimal places to round to. Applied directly to the stored monetary
934
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
935
+ * nearest 100 in the stored unit).
936
+ */
937
+ decimal_places: number;
938
+
939
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
940
+ }
941
+ }
942
+ }
943
+
944
+ export interface AddResellerRoyalty {
945
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
946
+
947
+ applicable_product_ids?: Array<string>;
948
+
949
+ applicable_product_tags?: Array<string>;
950
+
951
+ aws_account_number?: string;
952
+
953
+ aws_offer_id?: string;
954
+
955
+ aws_payer_reference_id?: string;
956
+
957
+ ending_before?: string | null;
958
+
959
+ fraction?: number;
960
+
961
+ gcp_account_id?: string;
962
+
963
+ gcp_offer_id?: string;
964
+
965
+ netsuite_reseller_id?: string;
966
+
967
+ reseller_contract_value?: number;
968
+
969
+ starting_at?: string;
970
+ }
971
+
972
+ export interface AddScheduledCharge {
973
+ id: string;
974
+
975
+ product: AddScheduledCharge.Product;
976
+
977
+ schedule: Shared.SchedulePointInTime;
978
+
979
+ /**
980
+ * displayed on invoices
981
+ */
982
+ name?: string;
983
+
984
+ /**
985
+ * This field's availability is dependent on your client's configuration.
986
+ */
987
+ netsuite_sales_order_id?: string;
988
+ }
989
+
990
+ export namespace AddScheduledCharge {
991
+ export interface Product {
992
+ id: string;
993
+
994
+ name: string;
995
+ }
996
+ }
997
+
998
+ export interface AddSubscription {
999
+ /**
1000
+ * Previous, current, and next billing periods for the subscription.
1001
+ */
1002
+ billing_periods: AddSubscription.BillingPeriods;
1003
+
1004
+ collection_schedule: 'ADVANCE' | 'ARREARS';
1005
+
1006
+ proration: AddSubscription.Proration;
1007
+
1008
+ /**
1009
+ * Determines how the subscription's quantity is controlled. Defaults to
1010
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
1011
+ * directly on the subscription. `initial_quantity` must be provided with this
1012
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
1013
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
1014
+ * user_123) to increment and decrement a subscription quantity, rather than
1015
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
1016
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
1017
+ * provided with this option.
1018
+ */
1019
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
1020
+
1021
+ /**
1022
+ * List of quantity schedule items for the subscription. Only includes the current
1023
+ * quantity and future quantity changes.
1024
+ */
1025
+ quantity_schedule: Array<AddSubscription.QuantitySchedule>;
1026
+
1027
+ starting_at: string;
1028
+
1029
+ subscription_rate: AddSubscription.SubscriptionRate;
1030
+
1031
+ id?: string;
1032
+
1033
+ billing_cycle_config?: AddSubscription.BillingCycleConfig;
1034
+
1035
+ /**
1036
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1037
+ */
1038
+ custom_fields?: { [key: string]: string };
1039
+
1040
+ description?: string;
1041
+
1042
+ ending_before?: string;
1043
+
1044
+ fiat_credit_type_id?: string;
1045
+
1046
+ name?: string;
1047
+
1048
+ seat_config?: AddSubscription.SeatConfig;
1049
+ }
1050
+
1051
+ export namespace AddSubscription {
1052
+ /**
1053
+ * Previous, current, and next billing periods for the subscription.
1054
+ */
1055
+ export interface BillingPeriods {
1056
+ current?: BillingPeriods.Current;
1057
+
1058
+ next?: BillingPeriods.Next;
1059
+
1060
+ previous?: BillingPeriods.Previous;
1061
+ }
1062
+
1063
+ export namespace BillingPeriods {
1064
+ export interface Current {
1065
+ ending_before: string;
1066
+
1067
+ starting_at: string;
1068
+ }
1069
+
1070
+ export interface Next {
1071
+ ending_before: string;
1072
+
1073
+ starting_at: string;
1074
+ }
1075
+
1076
+ export interface Previous {
1077
+ ending_before: string;
1078
+
1079
+ starting_at: string;
1080
+ }
1081
+ }
1082
+
1083
+ export interface Proration {
1084
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1085
+
1086
+ is_prorated: boolean;
1087
+
1088
+ rounding?: Proration.Rounding;
1089
+ }
1090
+
1091
+ export namespace Proration {
1092
+ export interface Rounding {
1093
+ /**
1094
+ * Number of decimal places to round to. Applied directly to the stored monetary
1095
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1096
+ * nearest 100 in the stored unit).
1097
+ */
1098
+ decimal_places: number;
1099
+
1100
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1101
+ }
1102
+ }
1103
+
1104
+ export interface QuantitySchedule {
1105
+ quantity: number;
1106
+
1107
+ starting_at: string;
1108
+
1109
+ ending_before?: string;
1110
+ }
1111
+
1112
+ export interface SubscriptionRate {
1113
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1114
+
1115
+ product: SubscriptionRate.Product;
1116
+ }
1117
+
1118
+ export namespace SubscriptionRate {
1119
+ export interface Product {
1120
+ id: string;
1121
+
1122
+ name: string;
1123
+ }
1124
+ }
1125
+
1126
+ export interface BillingCycleConfig {
1127
+ /**
1128
+ * The date this subscription's billing cycle is anchored to.
1129
+ */
1130
+ anchor_date: string;
1131
+
1132
+ /**
1133
+ * Controls whether this subscription consolidates onto usage invoices or gets its
1134
+ * own scheduled invoice.
1135
+ */
1136
+ invoice_placement: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
1137
+ }
1138
+
1139
+ export interface SeatConfig {
1140
+ /**
1141
+ * The property name, sent on usage events, that identifies the seat ID associated
1142
+ * with the usage event. For example, the property name might be seat_id or
1143
+ * user_id. The property must be set as a group key on billable metrics and a
1144
+ * presentation/pricing group key on contract products. This allows linked
1145
+ * recurring credits with an allocation per seat to be consumed by only one seat's
1146
+ * usage.
1147
+ */
1148
+ seat_group_key: string;
1149
+ }
1150
+ }
1151
+
1152
+ export interface AddUsageFilter {
1153
+ group_key: string;
1154
+
1155
+ group_values: Array<string>;
1156
+
1157
+ /**
1158
+ * This will match contract starting_at value if usage filter is active from the
1159
+ * beginning of the contract.
1160
+ */
1161
+ starting_at: string;
1162
+
1163
+ /**
1164
+ * This will match contract ending_before value if usage filter is active until the
1165
+ * end of the contract. It will be undefined if the contract is open-ended.
1166
+ */
1167
+ ending_before?: string;
1168
+ }
1169
+
1170
+ export interface ArchiveCommit {
1171
+ id: string;
1172
+ }
1173
+
1174
+ export interface ArchiveCredit {
1175
+ id: string;
1176
+ }
1177
+
1178
+ export interface ArchiveScheduledCharge {
1179
+ id: string;
1180
+ }
1181
+
1182
+ export interface RemoveOverride {
1183
+ id: string;
1184
+ }
1185
+
1186
+ export interface UpdateCommit {
1187
+ id: string;
1188
+
1189
+ access_schedule?: UpdateCommit.AccessSchedule;
1190
+
1191
+ /**
1192
+ * Which products the commit applies to. If applicable_product_ids,
1193
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1194
+ * all products.
1195
+ */
1196
+ applicable_product_ids?: Array<string> | null;
1197
+
1198
+ /**
1199
+ * Which tags the commit applies to. If applicable_product_ids,
1200
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1201
+ * all products.
1202
+ */
1203
+ applicable_product_tags?: Array<string> | null;
1204
+
1205
+ description?: string;
1206
+
1207
+ /**
1208
+ * Optional configuration for commit hierarchy access control
1209
+ */
1210
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1211
+
1212
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
1213
+
1214
+ name?: string;
1215
+
1216
+ netsuite_sales_order_id?: string | null;
1217
+
1218
+ /**
1219
+ * If multiple commits are applicable, the one with the lower priority will apply
1220
+ * first.
1221
+ */
1222
+ priority?: number | null;
1223
+
1224
+ product_id?: string;
1225
+
1226
+ /**
1227
+ * If set, the commit's rate type was updated to the specified value.
1228
+ */
1229
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1230
+
1231
+ rollover_fraction?: number | null;
1232
+
1233
+ /**
1234
+ * List of filters that determine what kind of customer usage draws down a commit
1235
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1236
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1237
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1238
+ * Instead, to target usage by product or product tag, pass those values in the
1239
+ * body of `specifiers`.
1240
+ */
1241
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1242
+ }
1243
+
1244
+ export namespace UpdateCommit {
1245
+ export interface AccessSchedule {
1246
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
1247
+
1248
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
1249
+
1250
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
1251
+ }
1252
+
1253
+ export namespace AccessSchedule {
1254
+ export interface AddScheduleItem {
1255
+ amount: number;
1256
+
1257
+ /**
1258
+ * RFC 3339 timestamp (exclusive)
1259
+ */
1260
+ ending_before: string;
1261
+
1262
+ /**
1263
+ * RFC 3339 timestamp (inclusive)
1264
+ */
1265
+ starting_at: string;
1266
+ }
1267
+
1268
+ export interface RemoveScheduleItem {
1269
+ id: string;
1270
+ }
1271
+
1272
+ export interface UpdateScheduleItem {
1273
+ id: string;
1274
+
1275
+ amount?: number;
1276
+
1277
+ /**
1278
+ * RFC 3339 timestamp (exclusive)
1279
+ */
1280
+ ending_before?: string;
1281
+
1282
+ /**
1283
+ * RFC 3339 timestamp (inclusive)
1284
+ */
1285
+ starting_at?: string;
1286
+ }
1287
+ }
1288
+
1289
+ export interface InvoiceSchedule {
1290
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1291
+
1292
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1293
+
1294
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1295
+ }
1296
+
1297
+ export namespace InvoiceSchedule {
1298
+ export interface AddScheduleItem {
1299
+ timestamp: string;
1300
+
1301
+ amount?: number;
1302
+
1303
+ quantity?: number;
1304
+
1305
+ unit_price?: number;
1306
+ }
1307
+
1308
+ export interface RemoveScheduleItem {
1309
+ id: string;
1310
+ }
1311
+
1312
+ export interface UpdateScheduleItem {
1313
+ id: string;
1314
+
1315
+ amount?: number;
1316
+
1317
+ quantity?: number;
1318
+
1319
+ timestamp?: string;
1320
+
1321
+ unit_price?: number;
1322
+ }
1323
+ }
1324
+ }
1325
+
1326
+ export interface UpdateCredit {
1327
+ id: string;
1328
+
1329
+ access_schedule?: UpdateCredit.AccessSchedule;
1330
+
1331
+ /**
1332
+ * Which products the credit applies to. If applicable_product_ids,
1333
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1334
+ * all products.
1335
+ */
1336
+ applicable_product_ids?: Array<string> | null;
1337
+
1338
+ /**
1339
+ * Which tags the credit applies to. If applicable_product_ids,
1340
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1341
+ * all products.
1342
+ */
1343
+ applicable_product_tags?: Array<string> | null;
1344
+
1345
+ description?: string;
1346
+
1347
+ /**
1348
+ * Optional configuration for credit hierarchy access control
1349
+ */
1350
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1351
+
1352
+ name?: string;
1353
+
1354
+ netsuite_sales_order_id?: string | null;
1355
+
1356
+ /**
1357
+ * If multiple credits are applicable, the one with the lower priority will apply
1358
+ * first.
1359
+ */
1360
+ priority?: number | null;
1361
+
1362
+ product_id?: string;
1363
+
1364
+ /**
1365
+ * If set, the credit's rate type was updated to the specified value.
1366
+ */
1367
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1368
+
1369
+ rollover_fraction?: number | null;
1370
+
1371
+ /**
1372
+ * List of filters that determine what kind of customer usage draws down a commit
1373
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1374
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1375
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1376
+ * Instead, to target usage by product or product tag, pass those values in the
1377
+ * body of `specifiers`.
1378
+ */
1379
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1380
+ }
1381
+
1382
+ export namespace UpdateCredit {
1383
+ export interface AccessSchedule {
1384
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
1385
+
1386
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
1387
+
1388
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
1389
+ }
1390
+
1391
+ export namespace AccessSchedule {
1392
+ export interface AddScheduleItem {
1393
+ amount: number;
1394
+
1395
+ /**
1396
+ * RFC 3339 timestamp (exclusive)
1397
+ */
1398
+ ending_before: string;
1399
+
1400
+ /**
1401
+ * RFC 3339 timestamp (inclusive)
1402
+ */
1403
+ starting_at: string;
1404
+ }
1405
+
1406
+ export interface RemoveScheduleItem {
1407
+ id: string;
1408
+ }
1409
+
1410
+ export interface UpdateScheduleItem {
1411
+ id: string;
1412
+
1413
+ amount?: number;
1414
+
1415
+ /**
1416
+ * RFC 3339 timestamp (exclusive)
1417
+ */
1418
+ ending_before?: string;
1419
+
1420
+ /**
1421
+ * RFC 3339 timestamp (inclusive)
1422
+ */
1423
+ starting_at?: string;
1424
+ }
1425
+ }
1426
+ }
1427
+
1428
+ export interface UpdateDiscount {
1429
+ id: string;
1430
+
1431
+ /**
1432
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1433
+ */
1434
+ custom_fields?: { [key: string]: string };
1435
+
1436
+ name?: string;
1437
+
1438
+ netsuite_sales_order_id?: string;
1439
+
1440
+ /**
1441
+ * Must provide either schedule_items or recurring_schedule.
1442
+ */
1443
+ schedule?: UpdateDiscount.Schedule;
1444
+ }
1445
+
1446
+ export namespace UpdateDiscount {
1447
+ /**
1448
+ * Must provide either schedule_items or recurring_schedule.
1449
+ */
1450
+ export interface Schedule {
1451
+ /**
1452
+ * Defaults to USD (cents) if not passed.
1453
+ */
1454
+ credit_type_id?: string;
1455
+
1456
+ /**
1457
+ * This field is only applicable to commit invoice schedules. If true, this
1458
+ * schedule will not generate an invoice.
1459
+ */
1460
+ do_not_invoice?: boolean;
1461
+
1462
+ /**
1463
+ * Enter the unit price and quantity for the charge or instead only send the
1464
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1465
+ * quantity is inferred to be 1.
1466
+ */
1467
+ recurring_schedule?: Schedule.RecurringSchedule;
1468
+
1469
+ /**
1470
+ * Either provide amount or provide both unit_price and quantity.
1471
+ */
1472
+ schedule_items?: Array<Schedule.ScheduleItem>;
1473
+ }
1474
+
1475
+ export namespace Schedule {
1476
+ /**
1477
+ * Enter the unit price and quantity for the charge or instead only send the
1478
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1479
+ * quantity is inferred to be 1.
1480
+ */
1481
+ export interface RecurringSchedule {
1482
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
1483
+
1484
+ /**
1485
+ * RFC 3339 timestamp (exclusive).
1486
+ */
1487
+ ending_before: string;
1488
+
1489
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
1490
+
1491
+ /**
1492
+ * RFC 3339 timestamp (inclusive).
1493
+ */
1494
+ starting_at: string;
1495
+
1496
+ /**
1497
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1498
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1499
+ * inferred to be 1.
1500
+ */
1501
+ amount?: number;
1502
+
1503
+ /**
1504
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1505
+ * amount and must be specified with unit_price. If specified amount cannot be
1506
+ * provided.
1507
+ */
1508
+ quantity?: number;
1509
+
1510
+ /**
1511
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1512
+ * amount and must be specified with quantity. If specified amount cannot be
1513
+ * provided.
1514
+ */
1515
+ unit_price?: number;
1516
+ }
1517
+
1518
+ export interface ScheduleItem {
1519
+ /**
1520
+ * timestamp of the scheduled event
1521
+ */
1522
+ timestamp: string;
1523
+
1524
+ /**
1525
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1526
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1527
+ * inferred to be 1.
1528
+ */
1529
+ amount?: number;
1530
+
1531
+ /**
1532
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1533
+ * amount and must be specified with unit_price. If specified amount cannot be
1534
+ * provided.
1535
+ */
1536
+ quantity?: number;
1537
+
1538
+ /**
1539
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1540
+ * amount and must be specified with quantity. If specified amount cannot be
1541
+ * provided.
1542
+ */
1543
+ unit_price?: number;
1544
+ }
1545
+ }
1546
+ }
1547
+
1548
+ export interface UpdatePrepaidBalanceThresholdConfiguration {
1549
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
1550
+
1551
+ /**
1552
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1553
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1554
+ */
1555
+ custom_credit_type_id?: string | null;
1556
+
1557
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
1558
+
1559
+ /**
1560
+ * When set to false, the contract will not be evaluated against the
1561
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1562
+ * regardless of prior state.
1563
+ */
1564
+ is_enabled?: boolean;
1565
+
1566
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1567
+
1568
+ /**
1569
+ * Specify the amount the balance should be recharged to.
1570
+ */
1571
+ recharge_to_amount?: number;
1572
+
1573
+ /**
1574
+ * Specify the threshold amount for the contract. Each time the contract's balance
1575
+ * lowers to this amount, a threshold charge will be initiated.
1576
+ */
1577
+ threshold_amount?: number;
1578
+
1579
+ /**
1580
+ * Determines which balances are excluded from remaining balance calculation for
1581
+ * threshold billing.
1582
+ */
1583
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1584
+ }
1585
+
1586
+ export namespace UpdatePrepaidBalanceThresholdConfiguration {
1587
+ export interface Commit extends Shared.UpdateBaseThresholdCommit {
1588
+ /**
1589
+ * Which products the threshold commit applies to. If both applicable_product_ids
1590
+ * and applicable_product_tags are not provided, the commit applies to all
1591
+ * products.
1592
+ */
1593
+ applicable_product_ids?: Array<string> | null;
1594
+
1595
+ /**
1596
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
1597
+ * applicable_product_tags are not provided, the commit applies to all products.
1598
+ */
1599
+ applicable_product_tags?: Array<string> | null;
1600
+
1601
+ /**
1602
+ * List of filters that determine what kind of customer usage draws down a commit
1603
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1604
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1605
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1606
+ * Instead, to target usage by product or product tag, pass those values in the
1607
+ * body of `specifiers`.
1608
+ */
1609
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1610
+ }
1611
+
1612
+ export interface DiscountConfiguration {
1613
+ /**
1614
+ * Update the discount cap. Set to null to remove an existing cap.
1615
+ */
1616
+ cap?: DiscountConfiguration.Cap | null;
1617
+
1618
+ /**
1619
+ * The fraction of the original amount that the customer pays after applying the
1620
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1621
+ * the customer pays 85% of the original amount (a 15% discount).
1622
+ */
1623
+ payment_fraction?: number | null;
1624
+ }
1625
+
1626
+ export namespace DiscountConfiguration {
1627
+ /**
1628
+ * Update the discount cap. Set to null to remove an existing cap.
1629
+ */
1630
+ export interface Cap {
1631
+ /**
1632
+ * Accumulated spend ceiling above which the discount stops applying.
1633
+ */
1634
+ amount: number;
1635
+
1636
+ /**
1637
+ * Alias of the spend tracker this cap is measured against.
1638
+ */
1639
+ spend_tracker_alias: string;
1640
+ }
1641
+ }
1642
+
1643
+ export interface ThresholdBalanceSpecifier {
1644
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
1645
+ }
1646
+
1647
+ export namespace ThresholdBalanceSpecifier {
1648
+ export interface Exclude {
1649
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
1650
+ }
1651
+
1652
+ export namespace Exclude {
1653
+ export interface CustomFieldFilter {
1654
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
1655
+
1656
+ key: string;
1657
+
1658
+ value: string;
1659
+ }
1660
+ }
1661
+ }
1662
+ }
1663
+
1664
+ export interface UpdateRecurringCommit {
1665
+ id: string;
1666
+
1667
+ access_amount?: UpdateRecurringCommit.AccessAmount;
1668
+
1669
+ ending_before?: string;
1670
+
1671
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1672
+
1673
+ /**
1674
+ * Rounding configuration for prorated recurring commit amounts.
1675
+ */
1676
+ proration_rounding?: UpdateRecurringCommit.ProrationRounding | null;
1677
+
1678
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1679
+ }
1680
+
1681
+ export namespace UpdateRecurringCommit {
1682
+ export interface AccessAmount {
1683
+ quantity?: number;
1684
+
1685
+ unit_price?: number;
1686
+ }
1687
+
1688
+ export interface InvoiceAmount {
1689
+ quantity?: number;
1690
+
1691
+ unit_price?: number;
1692
+ }
1693
+
1694
+ /**
1695
+ * Rounding configuration for prorated recurring commit amounts.
1696
+ */
1697
+ export interface ProrationRounding {
1698
+ access?: ProrationRounding.Access;
1699
+
1700
+ invoice?: ProrationRounding.Invoice;
1701
+ }
1702
+
1703
+ export namespace ProrationRounding {
1704
+ export interface Access {
1705
+ /**
1706
+ * Number of decimal places to round to. Applied directly to the stored monetary
1707
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1708
+ * nearest 100 in the stored unit).
1709
+ */
1710
+ decimal_places: number;
1711
+
1712
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1713
+ }
1714
+
1715
+ export interface Invoice {
1716
+ /**
1717
+ * Number of decimal places to round to. Applied directly to the stored monetary
1718
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1719
+ * nearest 100 in the stored unit).
1720
+ */
1721
+ decimal_places: number;
1722
+
1723
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1724
+ }
1725
+ }
1726
+ }
1727
+
1728
+ export interface UpdateRecurringCredit {
1729
+ id: string;
1730
+
1731
+ access_amount?: UpdateRecurringCredit.AccessAmount;
1732
+
1733
+ ending_before?: string;
1734
+
1735
+ /**
1736
+ * Rounding configuration for prorated recurring credit amounts.
1737
+ */
1738
+ proration_rounding?: UpdateRecurringCredit.ProrationRounding | null;
1739
+
1740
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1741
+ }
1742
+
1743
+ export namespace UpdateRecurringCredit {
1744
+ export interface AccessAmount {
1745
+ quantity?: number;
1746
+
1747
+ unit_price?: number;
1748
+ }
1749
+
1750
+ /**
1751
+ * Rounding configuration for prorated recurring credit amounts.
1752
+ */
1753
+ export interface ProrationRounding {
1754
+ access?: ProrationRounding.Access;
1755
+ }
1756
+
1757
+ export namespace ProrationRounding {
1758
+ export interface Access {
1759
+ /**
1760
+ * Number of decimal places to round to. Applied directly to the stored monetary
1761
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1762
+ * nearest 100 in the stored unit).
1763
+ */
1764
+ decimal_places: number;
1765
+
1766
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1767
+ }
1768
+ }
1769
+ }
1770
+
1771
+ export interface UpdateRefundInvoice {
1772
+ date: string;
1773
+
1774
+ invoice_id: string;
1775
+ }
1776
+
1777
+ export interface UpdateScheduledCharge {
1778
+ id: string;
1779
+
1780
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
1781
+
1782
+ name?: string;
1783
+
1784
+ netsuite_sales_order_id?: string | null;
1785
+ }
1786
+
1787
+ export namespace UpdateScheduledCharge {
1788
+ export interface InvoiceSchedule {
1789
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1790
+
1791
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1792
+
1793
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1794
+ }
1795
+
1796
+ export namespace InvoiceSchedule {
1797
+ export interface AddScheduleItem {
1798
+ timestamp: string;
1799
+
1800
+ amount?: number;
1801
+
1802
+ quantity?: number;
1803
+
1804
+ unit_price?: number;
1805
+ }
1806
+
1807
+ export interface RemoveScheduleItem {
1808
+ id: string;
1809
+ }
1810
+
1811
+ export interface UpdateScheduleItem {
1812
+ id: string;
1813
+
1814
+ amount?: number;
1815
+
1816
+ quantity?: number;
1817
+
1818
+ timestamp?: string;
1819
+
1820
+ unit_price?: number;
1821
+ }
1822
+ }
1823
+ }
1824
+
1825
+ export interface UpdateSpendThresholdConfiguration {
1826
+ commit?: Shared.UpdateBaseThresholdCommit;
1827
+
1828
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
1829
+
1830
+ /**
1831
+ * When set to false, the contract will not be evaluated against the
1832
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1833
+ * regardless of prior state.
1834
+ */
1835
+ is_enabled?: boolean;
1836
+
1837
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1838
+
1839
+ /**
1840
+ * Specify the threshold amount for the contract. Each time the contract's usage
1841
+ * hits this amount, a threshold charge will be initiated.
1842
+ */
1843
+ threshold_amount?: number;
1844
+ }
1845
+
1846
+ export namespace UpdateSpendThresholdConfiguration {
1847
+ export interface DiscountConfiguration {
1848
+ /**
1849
+ * Update the discount cap. Set to null to remove an existing cap.
1850
+ */
1851
+ cap?: DiscountConfiguration.Cap | null;
1852
+
1853
+ /**
1854
+ * The fraction of the original amount that the customer pays after applying the
1855
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1856
+ * the customer pays 85% of the original amount (a 15% discount).
1857
+ */
1858
+ payment_fraction?: number | null;
1859
+ }
1860
+
1861
+ export namespace DiscountConfiguration {
1862
+ /**
1863
+ * Update the discount cap. Set to null to remove an existing cap.
1864
+ */
1865
+ export interface Cap {
1866
+ /**
1867
+ * Accumulated spend ceiling above which the discount stops applying.
1868
+ */
1869
+ amount: number;
1870
+
1871
+ /**
1872
+ * Alias of the spend tracker this cap is measured against.
1873
+ */
1874
+ spend_tracker_alias: string;
1875
+ }
1876
+ }
1877
+ }
1878
+
1879
+ export interface UpdateSubscription {
1880
+ id: string;
1881
+
1882
+ ending_before?: string;
1883
+
1884
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
1885
+
1886
+ /**
1887
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1888
+ */
1889
+ seat_updates?: UpdateSubscription.SeatUpdates;
1890
+ }
1891
+
1892
+ export namespace UpdateSubscription {
1893
+ export interface QuantityUpdate {
1894
+ starting_at: string;
1895
+
1896
+ quantity?: number;
1897
+
1898
+ quantity_delta?: number;
1899
+ }
1900
+
1901
+ /**
1902
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1903
+ */
1904
+ export interface SeatUpdates {
1905
+ /**
1906
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
1907
+ * IDs will fill these unassigned seats and not increase the total subscription
1908
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
1909
+ * total subscription quantity will increase.
1910
+ */
1911
+ add_seat_ids?: Array<SeatUpdates.AddSeatID>;
1912
+
1913
+ /**
1914
+ * Adds unassigned seats to the subscription. This will increase the total
1915
+ * subscription quantity.
1916
+ */
1917
+ add_unassigned_seats?: Array<SeatUpdates.AddUnassignedSeat>;
1918
+
1919
+ /**
1920
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
1921
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
1922
+ * found on the subscription, this is a no-op.
1923
+ */
1924
+ remove_seat_ids?: Array<SeatUpdates.RemoveSeatID>;
1925
+
1926
+ /**
1927
+ * Removes unassigned seats from the subscription. This will decrease the total
1928
+ * subscription quantity if there are are unassigned seats.
1929
+ */
1930
+ remove_unassigned_seats?: Array<SeatUpdates.RemoveUnassignedSeat>;
1931
+ }
1932
+
1933
+ export namespace SeatUpdates {
1934
+ export interface AddSeatID {
1935
+ seat_ids: Array<string>;
1936
+
1937
+ /**
1938
+ * Assigned seats will be added/removed starting at this date.
1939
+ */
1940
+ starting_at: string;
1941
+ }
1942
+
1943
+ export interface AddUnassignedSeat {
1944
+ /**
1945
+ * The number of unassigned seats on the subscription will increase/decrease by
1946
+ * this delta. Must be greater than 0.
1947
+ */
1948
+ quantity: number;
1949
+
1950
+ /**
1951
+ * Unassigned seats will be updated starting at this date.
1952
+ */
1953
+ starting_at: string;
1954
+ }
1955
+
1956
+ export interface RemoveSeatID {
1957
+ seat_ids: Array<string>;
1958
+
1959
+ /**
1960
+ * Assigned seats will be added/removed starting at this date.
1961
+ */
1962
+ starting_at: string;
1963
+ }
1964
+
1965
+ export interface RemoveUnassignedSeat {
1966
+ /**
1967
+ * The number of unassigned seats on the subscription will increase/decrease by
1968
+ * this delta. Must be greater than 0.
1969
+ */
1970
+ quantity: number;
1971
+
1972
+ /**
1973
+ * Unassigned seats will be updated starting at this date.
1974
+ */
1975
+ starting_at: string;
1976
+ }
1977
+ }
1978
+ }
1979
+ }
1980
+ }
249
1981
  }
250
1982
 
251
1983
  export interface ContractEditCommitResponse {
@@ -541,6 +2273,8 @@ export namespace ContractGetEditHistoryResponse {
541
2273
 
542
2274
  export namespace AddOverride {
543
2275
  export interface OverrideSpecifier {
2276
+ any_commit_or_credit_ids?: Array<string>;
2277
+
544
2278
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
545
2279
 
546
2280
  commit_ids?: Array<string>;
@@ -675,6 +2409,11 @@ export namespace ContractGetEditHistoryResponse {
675
2409
  */
676
2410
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
677
2411
 
2412
+ /**
2413
+ * Rounding configuration for prorated recurring commit amounts.
2414
+ */
2415
+ proration_rounding?: AddRecurringCommit.ProrationRounding | null;
2416
+
678
2417
  /**
679
2418
  * The frequency at which the recurring commits will be created. If not provided: -
680
2419
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -682,7 +2421,7 @@ export namespace ContractGetEditHistoryResponse {
682
2421
  * be created aligned with the recurring commit's starting_at rather than the usage
683
2422
  * invoice dates.
684
2423
  */
685
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2424
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
686
2425
 
687
2426
  /**
688
2427
  * Will be passed down to the individual commits. This controls how much of an
@@ -745,6 +2484,39 @@ export namespace ContractGetEditHistoryResponse {
745
2484
 
746
2485
  unit_price: number;
747
2486
  }
2487
+
2488
+ /**
2489
+ * Rounding configuration for prorated recurring commit amounts.
2490
+ */
2491
+ export interface ProrationRounding {
2492
+ access?: ProrationRounding.Access;
2493
+
2494
+ invoice?: ProrationRounding.Invoice;
2495
+ }
2496
+
2497
+ export namespace ProrationRounding {
2498
+ export interface Access {
2499
+ /**
2500
+ * Number of decimal places to round to. Applied directly to the stored monetary
2501
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2502
+ * nearest 100 in the stored unit).
2503
+ */
2504
+ decimal_places: number;
2505
+
2506
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2507
+ }
2508
+
2509
+ export interface Invoice {
2510
+ /**
2511
+ * Number of decimal places to round to. Applied directly to the stored monetary
2512
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2513
+ * nearest 100 in the stored unit).
2514
+ */
2515
+ decimal_places: number;
2516
+
2517
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2518
+ }
2519
+ }
748
2520
  }
749
2521
 
750
2522
  export interface AddRecurringCredit {
@@ -820,6 +2592,11 @@ export namespace ContractGetEditHistoryResponse {
820
2592
  */
821
2593
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
822
2594
 
2595
+ /**
2596
+ * Rounding configuration for prorated recurring credit amounts.
2597
+ */
2598
+ proration_rounding?: AddRecurringCredit.ProrationRounding | null;
2599
+
823
2600
  /**
824
2601
  * The frequency at which the recurring commits will be created. If not provided: -
825
2602
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -827,7 +2604,7 @@ export namespace ContractGetEditHistoryResponse {
827
2604
  * be created aligned with the recurring commit's starting_at rather than the usage
828
2605
  * invoice dates.
829
2606
  */
830
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2607
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
831
2608
 
832
2609
  /**
833
2610
  * Will be passed down to the individual commits. This controls how much of an
@@ -879,6 +2656,26 @@ export namespace ContractGetEditHistoryResponse {
879
2656
  export interface Contract {
880
2657
  id: string;
881
2658
  }
2659
+
2660
+ /**
2661
+ * Rounding configuration for prorated recurring credit amounts.
2662
+ */
2663
+ export interface ProrationRounding {
2664
+ access?: ProrationRounding.Access;
2665
+ }
2666
+
2667
+ export namespace ProrationRounding {
2668
+ export interface Access {
2669
+ /**
2670
+ * Number of decimal places to round to. Applied directly to the stored monetary
2671
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2672
+ * nearest 100 in the stored unit).
2673
+ */
2674
+ decimal_places: number;
2675
+
2676
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2677
+ }
2678
+ }
882
2679
  }
883
2680
 
884
2681
  export interface AddResellerRoyalty {
@@ -970,6 +2767,8 @@ export namespace ContractGetEditHistoryResponse {
970
2767
 
971
2768
  id?: string;
972
2769
 
2770
+ billing_cycle_config?: AddSubscription.BillingCycleConfig;
2771
+
973
2772
  /**
974
2773
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
975
2774
  */
@@ -1022,6 +2821,21 @@ export namespace ContractGetEditHistoryResponse {
1022
2821
  invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1023
2822
 
1024
2823
  is_prorated: boolean;
2824
+
2825
+ rounding?: Proration.Rounding;
2826
+ }
2827
+
2828
+ export namespace Proration {
2829
+ export interface Rounding {
2830
+ /**
2831
+ * Number of decimal places to round to. Applied directly to the stored monetary
2832
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2833
+ * nearest 100 in the stored unit).
2834
+ */
2835
+ decimal_places: number;
2836
+
2837
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2838
+ }
1025
2839
  }
1026
2840
 
1027
2841
  export interface QuantitySchedule {
@@ -1046,6 +2860,19 @@ export namespace ContractGetEditHistoryResponse {
1046
2860
  }
1047
2861
  }
1048
2862
 
2863
+ export interface BillingCycleConfig {
2864
+ /**
2865
+ * The date this subscription's billing cycle is anchored to.
2866
+ */
2867
+ anchor_date: string;
2868
+
2869
+ /**
2870
+ * Controls whether this subscription consolidates onto usage invoices or gets its
2871
+ * own scheduled invoice.
2872
+ */
2873
+ invoice_placement: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
2874
+ }
2875
+
1049
2876
  export interface SeatConfig {
1050
2877
  /**
1051
2878
  * The property name, sent on usage events, that identifies the seat ID associated
@@ -1485,6 +3312,12 @@ export namespace ContractGetEditHistoryResponse {
1485
3312
  * lowers to this amount, a threshold charge will be initiated.
1486
3313
  */
1487
3314
  threshold_amount?: number;
3315
+
3316
+ /**
3317
+ * Determines which balances are excluded from remaining balance calculation for
3318
+ * threshold billing.
3319
+ */
3320
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1488
3321
  }
1489
3322
 
1490
3323
  export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -1514,6 +3347,11 @@ export namespace ContractGetEditHistoryResponse {
1514
3347
  }
1515
3348
 
1516
3349
  export interface DiscountConfiguration {
3350
+ /**
3351
+ * Update the discount cap. Set to null to remove an existing cap.
3352
+ */
3353
+ cap?: DiscountConfiguration.Cap | null;
3354
+
1517
3355
  /**
1518
3356
  * The fraction of the original amount that the customer pays after applying the
1519
3357
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1521,6 +3359,43 @@ export namespace ContractGetEditHistoryResponse {
1521
3359
  */
1522
3360
  payment_fraction?: number | null;
1523
3361
  }
3362
+
3363
+ export namespace DiscountConfiguration {
3364
+ /**
3365
+ * Update the discount cap. Set to null to remove an existing cap.
3366
+ */
3367
+ export interface Cap {
3368
+ /**
3369
+ * Accumulated spend ceiling above which the discount stops applying.
3370
+ */
3371
+ amount: number;
3372
+
3373
+ /**
3374
+ * Alias of the spend tracker this cap is measured against.
3375
+ */
3376
+ spend_tracker_alias: string;
3377
+ }
3378
+ }
3379
+
3380
+ export interface ThresholdBalanceSpecifier {
3381
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
3382
+ }
3383
+
3384
+ export namespace ThresholdBalanceSpecifier {
3385
+ export interface Exclude {
3386
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
3387
+ }
3388
+
3389
+ export namespace Exclude {
3390
+ export interface CustomFieldFilter {
3391
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
3392
+
3393
+ key: string;
3394
+
3395
+ value: string;
3396
+ }
3397
+ }
3398
+ }
1524
3399
  }
1525
3400
 
1526
3401
  export interface UpdateRecurringCommit {
@@ -1532,6 +3407,11 @@ export namespace ContractGetEditHistoryResponse {
1532
3407
 
1533
3408
  invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1534
3409
 
3410
+ /**
3411
+ * Rounding configuration for prorated recurring commit amounts.
3412
+ */
3413
+ proration_rounding?: UpdateRecurringCommit.ProrationRounding | null;
3414
+
1535
3415
  rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1536
3416
  }
1537
3417
 
@@ -1547,6 +3427,39 @@ export namespace ContractGetEditHistoryResponse {
1547
3427
 
1548
3428
  unit_price?: number;
1549
3429
  }
3430
+
3431
+ /**
3432
+ * Rounding configuration for prorated recurring commit amounts.
3433
+ */
3434
+ export interface ProrationRounding {
3435
+ access?: ProrationRounding.Access;
3436
+
3437
+ invoice?: ProrationRounding.Invoice;
3438
+ }
3439
+
3440
+ export namespace ProrationRounding {
3441
+ export interface Access {
3442
+ /**
3443
+ * Number of decimal places to round to. Applied directly to the stored monetary
3444
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3445
+ * nearest 100 in the stored unit).
3446
+ */
3447
+ decimal_places: number;
3448
+
3449
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3450
+ }
3451
+
3452
+ export interface Invoice {
3453
+ /**
3454
+ * Number of decimal places to round to. Applied directly to the stored monetary
3455
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3456
+ * nearest 100 in the stored unit).
3457
+ */
3458
+ decimal_places: number;
3459
+
3460
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3461
+ }
3462
+ }
1550
3463
  }
1551
3464
 
1552
3465
  export interface UpdateRecurringCredit {
@@ -1556,6 +3469,11 @@ export namespace ContractGetEditHistoryResponse {
1556
3469
 
1557
3470
  ending_before?: string;
1558
3471
 
3472
+ /**
3473
+ * Rounding configuration for prorated recurring credit amounts.
3474
+ */
3475
+ proration_rounding?: UpdateRecurringCredit.ProrationRounding | null;
3476
+
1559
3477
  rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1560
3478
  }
1561
3479
 
@@ -1565,6 +3483,26 @@ export namespace ContractGetEditHistoryResponse {
1565
3483
 
1566
3484
  unit_price?: number;
1567
3485
  }
3486
+
3487
+ /**
3488
+ * Rounding configuration for prorated recurring credit amounts.
3489
+ */
3490
+ export interface ProrationRounding {
3491
+ access?: ProrationRounding.Access;
3492
+ }
3493
+
3494
+ export namespace ProrationRounding {
3495
+ export interface Access {
3496
+ /**
3497
+ * Number of decimal places to round to. Applied directly to the stored monetary
3498
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3499
+ * nearest 100 in the stored unit).
3500
+ */
3501
+ decimal_places: number;
3502
+
3503
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3504
+ }
3505
+ }
1568
3506
  }
1569
3507
 
1570
3508
  export interface UpdateRefundInvoice {
@@ -1644,6 +3582,11 @@ export namespace ContractGetEditHistoryResponse {
1644
3582
 
1645
3583
  export namespace UpdateSpendThresholdConfiguration {
1646
3584
  export interface DiscountConfiguration {
3585
+ /**
3586
+ * Update the discount cap. Set to null to remove an existing cap.
3587
+ */
3588
+ cap?: DiscountConfiguration.Cap | null;
3589
+
1647
3590
  /**
1648
3591
  * The fraction of the original amount that the customer pays after applying the
1649
3592
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1651,6 +3594,23 @@ export namespace ContractGetEditHistoryResponse {
1651
3594
  */
1652
3595
  payment_fraction?: number | null;
1653
3596
  }
3597
+
3598
+ export namespace DiscountConfiguration {
3599
+ /**
3600
+ * Update the discount cap. Set to null to remove an existing cap.
3601
+ */
3602
+ export interface Cap {
3603
+ /**
3604
+ * Accumulated spend ceiling above which the discount stops applying.
3605
+ */
3606
+ amount: number;
3607
+
3608
+ /**
3609
+ * Alias of the spend tracker this cap is measured against.
3610
+ */
3611
+ spend_tracker_alias: string;
3612
+ }
3613
+ }
1654
3614
  }
1655
3615
 
1656
3616
  export interface UpdateSubscription {
@@ -1863,6 +3823,12 @@ export interface ContractEditParams {
1863
3823
 
1864
3824
  add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
1865
3825
 
3826
+ /**
3827
+ * Spend trackers to add to this contract. Aliases must be unique within a
3828
+ * contract.
3829
+ */
3830
+ add_spend_trackers?: Array<ContractEditParams.AddSpendTracker>;
3831
+
1866
3832
  /**
1867
3833
  * Optional list of
1868
3834
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1893,6 +3859,11 @@ export interface ContractEditParams {
1893
3859
  */
1894
3860
  archive_scheduled_charges?: Array<ContractEditParams.ArchiveScheduledCharge>;
1895
3861
 
3862
+ /**
3863
+ * Aliases of spend trackers to archive.
3864
+ */
3865
+ archive_spend_trackers?: Array<string>;
3866
+
1896
3867
  /**
1897
3868
  * IDs of overrides to remove
1898
3869
  */
@@ -2088,6 +4059,11 @@ export namespace ContractEditParams {
2088
4059
  */
2089
4060
  specifiers?: Array<Shared.CommitSpecifierInput>;
2090
4061
 
4062
+ /**
4063
+ * Optional attributes for spend tracker integration. Immutable after creation.
4064
+ */
4065
+ spend_tracker_attributes?: AddCommit.SpendTrackerAttributes;
4066
+
2091
4067
  /**
2092
4068
  * A temporary ID for the commit that can be used to reference the commit for
2093
4069
  * commit specific overrides.
@@ -2302,6 +4278,17 @@ export namespace ContractEditParams {
2302
4278
  on_session_payment?: boolean;
2303
4279
  }
2304
4280
  }
4281
+
4282
+ /**
4283
+ * Optional attributes for spend tracker integration. Immutable after creation.
4284
+ */
4285
+ export interface SpendTrackerAttributes {
4286
+ /**
4287
+ * If true, this commit will be included in spend trackers with discounted set to
4288
+ * DISCOUNTED_ONLY
4289
+ */
4290
+ counts_as_discounted: boolean;
4291
+ }
2305
4292
  }
2306
4293
 
2307
4294
  export interface AddCredit {
@@ -2600,6 +4587,15 @@ export namespace ContractEditParams {
2600
4587
 
2601
4588
  export namespace AddOverride {
2602
4589
  export interface OverrideSpecifier {
4590
+ /**
4591
+ * Can only be used for commit specific overrides. Must be used in conjunction with
4592
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
4593
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
4594
+ * `recurring_commit_ids` If provided, the override will apply to any specified
4595
+ * commit, credit, recurring commit or recurring credit IDs.
4596
+ */
4597
+ any_commit_or_credit_ids?: Array<string>;
4598
+
2603
4599
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2604
4600
 
2605
4601
  /**
@@ -2790,6 +4786,11 @@ export namespace ContractEditParams {
2790
4786
  */
2791
4787
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2792
4788
 
4789
+ /**
4790
+ * Optional rounding configuration for prorated recurring commit amounts.
4791
+ */
4792
+ proration_rounding?: AddRecurringCommit.ProrationRounding;
4793
+
2793
4794
  /**
2794
4795
  * Whether the created commits will use the commit rate or list rate
2795
4796
  */
@@ -2802,7 +4803,7 @@ export namespace ContractEditParams {
2802
4803
  * be created aligned with the recurring commit's starting_at rather than the usage
2803
4804
  * invoice dates.
2804
4805
  */
2805
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
4806
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2806
4807
 
2807
4808
  /**
2808
4809
  * Will be passed down to the individual commits. This controls how much of an
@@ -2871,6 +4872,39 @@ export namespace ContractEditParams {
2871
4872
  unit_price: number;
2872
4873
  }
2873
4874
 
4875
+ /**
4876
+ * Optional rounding configuration for prorated recurring commit amounts.
4877
+ */
4878
+ export interface ProrationRounding {
4879
+ access?: ProrationRounding.Access;
4880
+
4881
+ invoice?: ProrationRounding.Invoice;
4882
+ }
4883
+
4884
+ export namespace ProrationRounding {
4885
+ export interface Access {
4886
+ /**
4887
+ * Number of decimal places to round to. Applied directly to the stored monetary
4888
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
4889
+ * nearest 100 in the stored unit).
4890
+ */
4891
+ decimal_places: number;
4892
+
4893
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
4894
+ }
4895
+
4896
+ export interface Invoice {
4897
+ /**
4898
+ * Number of decimal places to round to. Applied directly to the stored monetary
4899
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
4900
+ * nearest 100 in the stored unit).
4901
+ */
4902
+ decimal_places: number;
4903
+
4904
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
4905
+ }
4906
+ }
4907
+
2874
4908
  /**
2875
4909
  * Attach a subscription to the recurring commit/credit.
2876
4910
  */
@@ -2965,6 +4999,11 @@ export namespace ContractEditParams {
2965
4999
  */
2966
5000
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2967
5001
 
5002
+ /**
5003
+ * Optional rounding configuration for prorated recurring credit amounts.
5004
+ */
5005
+ proration_rounding?: AddRecurringCredit.ProrationRounding;
5006
+
2968
5007
  /**
2969
5008
  * Whether the created commits will use the commit rate or list rate
2970
5009
  */
@@ -2977,7 +5016,7 @@ export namespace ContractEditParams {
2977
5016
  * be created aligned with the recurring commit's starting_at rather than the usage
2978
5017
  * invoice dates.
2979
5018
  */
2980
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
5019
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2981
5020
 
2982
5021
  /**
2983
5022
  * Will be passed down to the individual commits. This controls how much of an
@@ -3035,6 +5074,26 @@ export namespace ContractEditParams {
3035
5074
  unit?: 'PERIODS';
3036
5075
  }
3037
5076
 
5077
+ /**
5078
+ * Optional rounding configuration for prorated recurring credit amounts.
5079
+ */
5080
+ export interface ProrationRounding {
5081
+ access?: ProrationRounding.Access;
5082
+ }
5083
+
5084
+ export namespace ProrationRounding {
5085
+ export interface Access {
5086
+ /**
5087
+ * Number of decimal places to round to. Applied directly to the stored monetary
5088
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
5089
+ * nearest 100 in the stored unit).
5090
+ */
5091
+ decimal_places: number;
5092
+
5093
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
5094
+ }
5095
+ }
5096
+
3038
5097
  /**
3039
5098
  * Attach a subscription to the recurring commit/credit.
3040
5099
  */
@@ -3267,6 +5326,32 @@ export namespace ContractEditParams {
3267
5326
  }
3268
5327
  }
3269
5328
 
5329
+ export interface AddSpendTracker {
5330
+ /**
5331
+ * Human-readable identifier, unique per contract.
5332
+ */
5333
+ alias: string;
5334
+
5335
+ applicable_spend_specifiers: Array<AddSpendTracker.ApplicableSpendSpecifier>;
5336
+
5337
+ credit_type_id: string;
5338
+
5339
+ reset_frequency: 'BILLING_PERIOD';
5340
+ }
5341
+
5342
+ export namespace AddSpendTracker {
5343
+ export interface ApplicableSpendSpecifier {
5344
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
5345
+
5346
+ spend_type: 'COMMIT_PURCHASE';
5347
+
5348
+ /**
5349
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
5350
+ */
5351
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
5352
+ }
5353
+ }
5354
+
3270
5355
  export interface AddSubscription {
3271
5356
  collection_schedule: 'ADVANCE' | 'ARREARS';
3272
5357
 
@@ -3274,6 +5359,8 @@ export namespace ContractEditParams {
3274
5359
 
3275
5360
  subscription_rate: AddSubscription.SubscriptionRate;
3276
5361
 
5362
+ billing_cycle_config?: AddSubscription.BillingCycleConfig;
5363
+
3277
5364
  /**
3278
5365
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3279
5366
  */
@@ -3338,6 +5425,21 @@ export namespace ContractEditParams {
3338
5425
  * Indicates if the partial period will be prorated or charged a full amount.
3339
5426
  */
3340
5427
  is_prorated?: boolean;
5428
+
5429
+ rounding?: Proration.Rounding;
5430
+ }
5431
+
5432
+ export namespace Proration {
5433
+ export interface Rounding {
5434
+ /**
5435
+ * Number of decimal places to round to. Applied directly to the stored monetary
5436
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
5437
+ * nearest 100 in the stored unit).
5438
+ */
5439
+ decimal_places: number;
5440
+
5441
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
5442
+ }
3341
5443
  }
3342
5444
 
3343
5445
  export interface SubscriptionRate {
@@ -3353,6 +5455,20 @@ export namespace ContractEditParams {
3353
5455
  product_id: string;
3354
5456
  }
3355
5457
 
5458
+ export interface BillingCycleConfig {
5459
+ /**
5460
+ * The date to anchor the billing cycle to. If omitted, defaults to the contract's
5461
+ * usage invoice billing cycle anchor date.
5462
+ */
5463
+ anchor_date?: string;
5464
+
5465
+ /**
5466
+ * Controls whether this subscription consolidates onto usage invoices or gets its
5467
+ * own scheduled invoice. Defaults to ON_USAGE_INVOICE if omitted.
5468
+ */
5469
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
5470
+ }
5471
+
3356
5472
  export interface SeatConfig {
3357
5473
  /**
3358
5474
  * The initial assigned seats on this subscription.
@@ -3616,6 +5732,12 @@ export namespace ContractEditParams {
3616
5732
  * lowers to this amount, a threshold charge will be initiated.
3617
5733
  */
3618
5734
  threshold_amount?: number;
5735
+
5736
+ /**
5737
+ * Determines which balances are excluded from remaining balance calculation for
5738
+ * threshold billing.
5739
+ */
5740
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
3619
5741
  }
3620
5742
 
3621
5743
  export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -3645,6 +5767,11 @@ export namespace ContractEditParams {
3645
5767
  }
3646
5768
 
3647
5769
  export interface DiscountConfiguration {
5770
+ /**
5771
+ * Update the discount cap. Set to null to remove an existing cap.
5772
+ */
5773
+ cap?: DiscountConfiguration.Cap | null;
5774
+
3648
5775
  /**
3649
5776
  * The fraction of the original amount that the customer pays after applying the
3650
5777
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3652,6 +5779,43 @@ export namespace ContractEditParams {
3652
5779
  */
3653
5780
  payment_fraction?: number | null;
3654
5781
  }
5782
+
5783
+ export namespace DiscountConfiguration {
5784
+ /**
5785
+ * Update the discount cap. Set to null to remove an existing cap.
5786
+ */
5787
+ export interface Cap {
5788
+ /**
5789
+ * Accumulated spend ceiling above which the discount stops applying.
5790
+ */
5791
+ amount: number;
5792
+
5793
+ /**
5794
+ * Alias of the spend tracker this cap is measured against.
5795
+ */
5796
+ spend_tracker_alias: string;
5797
+ }
5798
+ }
5799
+
5800
+ export interface ThresholdBalanceSpecifier {
5801
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
5802
+ }
5803
+
5804
+ export namespace ThresholdBalanceSpecifier {
5805
+ export interface Exclude {
5806
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
5807
+ }
5808
+
5809
+ export namespace Exclude {
5810
+ export interface CustomFieldFilter {
5811
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
5812
+
5813
+ key: string;
5814
+
5815
+ value: string;
5816
+ }
5817
+ }
5818
+ }
3655
5819
  }
3656
5820
 
3657
5821
  export interface UpdateRecurringCommit {
@@ -3663,6 +5827,12 @@ export namespace ContractEditParams {
3663
5827
 
3664
5828
  invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
3665
5829
 
5830
+ /**
5831
+ * If provided, updates the rounding config on the recurring commit. Set to null to
5832
+ * clear rounding. Omit to leave unchanged.
5833
+ */
5834
+ proration_rounding?: UpdateRecurringCommit.ProrationRounding | null;
5835
+
3666
5836
  /**
3667
5837
  * If provided, updates the recurring commit to use the specified rate type when
3668
5838
  * generating future commits.
@@ -3682,6 +5852,40 @@ export namespace ContractEditParams {
3682
5852
 
3683
5853
  unit_price?: number;
3684
5854
  }
5855
+
5856
+ /**
5857
+ * If provided, updates the rounding config on the recurring commit. Set to null to
5858
+ * clear rounding. Omit to leave unchanged.
5859
+ */
5860
+ export interface ProrationRounding {
5861
+ access?: ProrationRounding.Access | null;
5862
+
5863
+ invoice?: ProrationRounding.Invoice | null;
5864
+ }
5865
+
5866
+ export namespace ProrationRounding {
5867
+ export interface Access {
5868
+ /**
5869
+ * Number of decimal places to round to. Applied directly to the stored monetary
5870
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
5871
+ * nearest 100 in the stored unit).
5872
+ */
5873
+ decimal_places: number;
5874
+
5875
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
5876
+ }
5877
+
5878
+ export interface Invoice {
5879
+ /**
5880
+ * Number of decimal places to round to. Applied directly to the stored monetary
5881
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
5882
+ * nearest 100 in the stored unit).
5883
+ */
5884
+ decimal_places: number;
5885
+
5886
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
5887
+ }
5888
+ }
3685
5889
  }
3686
5890
 
3687
5891
  export interface UpdateRecurringCredit {
@@ -3691,6 +5895,12 @@ export namespace ContractEditParams {
3691
5895
 
3692
5896
  ending_before?: string | null;
3693
5897
 
5898
+ /**
5899
+ * If provided, updates the rounding config on the recurring credit. Set to null to
5900
+ * clear rounding. Omit to leave unchanged.
5901
+ */
5902
+ proration_rounding?: UpdateRecurringCredit.ProrationRounding | null;
5903
+
3694
5904
  /**
3695
5905
  * If provided, updates the recurring credit to use the specified rate type when
3696
5906
  * generating future credits.
@@ -3704,6 +5914,27 @@ export namespace ContractEditParams {
3704
5914
 
3705
5915
  unit_price?: number;
3706
5916
  }
5917
+
5918
+ /**
5919
+ * If provided, updates the rounding config on the recurring credit. Set to null to
5920
+ * clear rounding. Omit to leave unchanged.
5921
+ */
5922
+ export interface ProrationRounding {
5923
+ access?: ProrationRounding.Access | null;
5924
+ }
5925
+
5926
+ export namespace ProrationRounding {
5927
+ export interface Access {
5928
+ /**
5929
+ * Number of decimal places to round to. Applied directly to the stored monetary
5930
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
5931
+ * nearest 100 in the stored unit).
5932
+ */
5933
+ decimal_places: number;
5934
+
5935
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
5936
+ }
5937
+ }
3707
5938
  }
3708
5939
 
3709
5940
  export interface UpdateScheduledCharge {
@@ -3775,6 +6006,11 @@ export namespace ContractEditParams {
3775
6006
 
3776
6007
  export namespace UpdateSpendThresholdConfiguration {
3777
6008
  export interface DiscountConfiguration {
6009
+ /**
6010
+ * Update the discount cap. Set to null to remove an existing cap.
6011
+ */
6012
+ cap?: DiscountConfiguration.Cap | null;
6013
+
3778
6014
  /**
3779
6015
  * The fraction of the original amount that the customer pays after applying the
3780
6016
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3782,6 +6018,23 @@ export namespace ContractEditParams {
3782
6018
  */
3783
6019
  payment_fraction?: number | null;
3784
6020
  }
6021
+
6022
+ export namespace DiscountConfiguration {
6023
+ /**
6024
+ * Update the discount cap. Set to null to remove an existing cap.
6025
+ */
6026
+ export interface Cap {
6027
+ /**
6028
+ * Accumulated spend ceiling above which the discount stops applying.
6029
+ */
6030
+ amount: number;
6031
+
6032
+ /**
6033
+ * Alias of the spend tracker this cap is measured against.
6034
+ */
6035
+ spend_tracker_alias: string;
6036
+ }
6037
+ }
3785
6038
  }
3786
6039
 
3787
6040
  export interface UpdateSubscription {
@@ -3789,6 +6042,8 @@ export namespace ContractEditParams {
3789
6042
 
3790
6043
  ending_before?: string | null;
3791
6044
 
6045
+ proration_rounding?: UpdateSubscription.ProrationRounding | null;
6046
+
3792
6047
  /**
3793
6048
  * Update the subscription's quantity management mode from QUANTITY_ONLY to
3794
6049
  * SEAT_BASED with the provided seat_group_key.
@@ -3806,6 +6061,17 @@ export namespace ContractEditParams {
3806
6061
  }
3807
6062
 
3808
6063
  export namespace UpdateSubscription {
6064
+ export interface ProrationRounding {
6065
+ /**
6066
+ * Number of decimal places to round to. Applied directly to the stored monetary
6067
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
6068
+ * nearest 100 in the stored unit).
6069
+ */
6070
+ decimal_places: number;
6071
+
6072
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
6073
+ }
6074
+
3809
6075
  /**
3810
6076
  * Update the subscription's quantity management mode from QUANTITY_ONLY to
3811
6077
  * SEAT_BASED with the provided seat_group_key.