@metronome/sdk 3.6.0 → 3.7.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 (279) hide show
  1. package/CHANGELOG.md +22 -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.mjs.map +1 -1
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts.map +1 -1
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.mjs.map +1 -1
  15. package/core/pagination.d.mts.map +1 -1
  16. package/core/pagination.d.ts.map +1 -1
  17. package/core/pagination.mjs.map +1 -1
  18. package/core/resource.d.mts.map +1 -1
  19. package/core/resource.d.ts.map +1 -1
  20. package/core/uploads.d.mts.map +1 -1
  21. package/core/uploads.d.ts.map +1 -1
  22. package/core/uploads.mjs.map +1 -1
  23. package/error.d.mts +1 -0
  24. package/error.d.mts.map +1 -1
  25. package/error.d.ts +1 -0
  26. package/error.d.ts.map +1 -1
  27. package/error.mjs +1 -0
  28. package/error.mjs.map +1 -1
  29. package/index.d.mts.map +1 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.mjs.map +1 -1
  32. package/internal/detect-platform.mjs.map +1 -1
  33. package/internal/headers.mjs.map +1 -1
  34. package/internal/parse.d.mts.map +1 -1
  35. package/internal/parse.d.ts.map +1 -1
  36. package/internal/parse.mjs.map +1 -1
  37. package/internal/qs/formats.d.mts.map +1 -1
  38. package/internal/qs/formats.d.ts.map +1 -1
  39. package/internal/qs/index.d.mts +2 -2
  40. package/internal/qs/index.d.mts.map +1 -1
  41. package/internal/qs/index.d.ts +2 -2
  42. package/internal/qs/index.d.ts.map +1 -1
  43. package/internal/qs/index.mjs.map +1 -1
  44. package/internal/qs/stringify.d.mts.map +1 -1
  45. package/internal/qs/stringify.d.ts.map +1 -1
  46. package/internal/qs/stringify.mjs.map +1 -1
  47. package/internal/qs/utils.d.mts.map +1 -1
  48. package/internal/qs/utils.d.ts.map +1 -1
  49. package/internal/qs/utils.mjs.map +1 -1
  50. package/internal/request-options.d.mts.map +1 -1
  51. package/internal/request-options.d.ts.map +1 -1
  52. package/internal/shims.d.mts +6 -0
  53. package/internal/shims.d.mts.map +1 -1
  54. package/internal/shims.d.ts +6 -0
  55. package/internal/shims.d.ts.map +1 -1
  56. package/internal/to-file.d.mts.map +1 -1
  57. package/internal/to-file.d.ts.map +1 -1
  58. package/internal/to-file.mjs.map +1 -1
  59. package/internal/types.d.mts +4 -4
  60. package/internal/types.d.mts.map +1 -1
  61. package/internal/types.d.ts +4 -4
  62. package/internal/types.d.ts.map +1 -1
  63. package/internal/uploads.d.mts.map +1 -1
  64. package/internal/uploads.d.ts.map +1 -1
  65. package/internal/uploads.mjs.map +1 -1
  66. package/internal/utils/base64.mjs.map +1 -1
  67. package/internal/utils/log.d.mts.map +1 -1
  68. package/internal/utils/log.d.ts.map +1 -1
  69. package/internal/utils/log.mjs.map +1 -1
  70. package/internal/utils/path.mjs.map +1 -1
  71. package/internal/utils/query.mjs.map +1 -1
  72. package/internal/utils/values.mjs.map +1 -1
  73. package/internal/utils.d.mts.map +1 -1
  74. package/internal/utils.d.ts.map +1 -1
  75. package/internal/utils.mjs.map +1 -1
  76. package/package.json +1 -1
  77. package/pagination.d.mts +1 -0
  78. package/pagination.d.mts.map +1 -1
  79. package/pagination.d.ts +1 -0
  80. package/pagination.d.ts.map +1 -1
  81. package/pagination.mjs +1 -0
  82. package/pagination.mjs.map +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/index.d.mts.map +1 -1
  90. package/resources/index.d.ts.map +1 -1
  91. package/resources/index.mjs.map +1 -1
  92. package/resources/shared.d.mts +226 -0
  93. package/resources/shared.d.mts.map +1 -1
  94. package/resources/shared.d.ts +226 -0
  95. package/resources/shared.d.ts.map +1 -1
  96. package/resources/v1/alerts.d.mts.map +1 -1
  97. package/resources/v1/alerts.d.ts.map +1 -1
  98. package/resources/v1/alerts.mjs.map +1 -1
  99. package/resources/v1/audit-logs.d.mts.map +1 -1
  100. package/resources/v1/audit-logs.d.ts.map +1 -1
  101. package/resources/v1/audit-logs.mjs.map +1 -1
  102. package/resources/v1/billable-metrics.d.mts.map +1 -1
  103. package/resources/v1/billable-metrics.d.ts.map +1 -1
  104. package/resources/v1/billable-metrics.mjs.map +1 -1
  105. package/resources/v1/contracts/contracts.d.mts +406 -1
  106. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  107. package/resources/v1/contracts/contracts.d.ts +406 -1
  108. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  109. package/resources/v1/contracts/contracts.js.map +1 -1
  110. package/resources/v1/contracts/contracts.mjs.map +1 -1
  111. package/resources/v1/contracts/index.d.mts.map +1 -1
  112. package/resources/v1/contracts/index.d.ts.map +1 -1
  113. package/resources/v1/contracts/index.mjs.map +1 -1
  114. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  115. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  116. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  117. package/resources/v1/contracts/products.d.mts.map +1 -1
  118. package/resources/v1/contracts/products.d.ts.map +1 -1
  119. package/resources/v1/contracts/products.mjs.map +1 -1
  120. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  121. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  122. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  123. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  124. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  125. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  126. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  127. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  128. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  129. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  130. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  131. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  132. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  133. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  134. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  135. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  136. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  137. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  138. package/resources/v1/contracts.d.mts.map +1 -1
  139. package/resources/v1/contracts.d.ts.map +1 -1
  140. package/resources/v1/contracts.mjs.map +1 -1
  141. package/resources/v1/credit-grants.d.mts.map +1 -1
  142. package/resources/v1/credit-grants.d.ts.map +1 -1
  143. package/resources/v1/credit-grants.mjs.map +1 -1
  144. package/resources/v1/custom-fields.d.mts.map +1 -1
  145. package/resources/v1/custom-fields.d.ts.map +1 -1
  146. package/resources/v1/custom-fields.mjs.map +1 -1
  147. package/resources/v1/customers/alerts.d.mts.map +1 -1
  148. package/resources/v1/customers/alerts.d.ts.map +1 -1
  149. package/resources/v1/customers/alerts.mjs.map +1 -1
  150. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  151. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  152. package/resources/v1/customers/billing-config.mjs.map +1 -1
  153. package/resources/v1/customers/commits.d.mts.map +1 -1
  154. package/resources/v1/customers/commits.d.ts.map +1 -1
  155. package/resources/v1/customers/commits.mjs.map +1 -1
  156. package/resources/v1/customers/credits.d.mts.map +1 -1
  157. package/resources/v1/customers/credits.d.ts.map +1 -1
  158. package/resources/v1/customers/credits.mjs.map +1 -1
  159. package/resources/v1/customers/customers.d.mts.map +1 -1
  160. package/resources/v1/customers/customers.d.ts.map +1 -1
  161. package/resources/v1/customers/customers.mjs.map +1 -1
  162. package/resources/v1/customers/index.d.mts.map +1 -1
  163. package/resources/v1/customers/index.d.ts.map +1 -1
  164. package/resources/v1/customers/index.mjs.map +1 -1
  165. package/resources/v1/customers/invoices.d.mts.map +1 -1
  166. package/resources/v1/customers/invoices.d.ts.map +1 -1
  167. package/resources/v1/customers/invoices.mjs.map +1 -1
  168. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  169. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  170. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  171. package/resources/v1/customers/plans.d.mts.map +1 -1
  172. package/resources/v1/customers/plans.d.ts.map +1 -1
  173. package/resources/v1/customers/plans.mjs.map +1 -1
  174. package/resources/v1/customers.d.mts.map +1 -1
  175. package/resources/v1/customers.d.ts.map +1 -1
  176. package/resources/v1/customers.mjs.map +1 -1
  177. package/resources/v1/dashboards.d.mts.map +1 -1
  178. package/resources/v1/dashboards.d.ts.map +1 -1
  179. package/resources/v1/dashboards.mjs.map +1 -1
  180. package/resources/v1/index.d.mts +0 -1
  181. package/resources/v1/index.d.mts.map +1 -1
  182. package/resources/v1/index.d.ts +0 -1
  183. package/resources/v1/index.d.ts.map +1 -1
  184. package/resources/v1/index.js +1 -3
  185. package/resources/v1/index.js.map +1 -1
  186. package/resources/v1/index.mjs +0 -1
  187. package/resources/v1/index.mjs.map +1 -1
  188. package/resources/v1/invoices.d.mts.map +1 -1
  189. package/resources/v1/invoices.d.ts.map +1 -1
  190. package/resources/v1/invoices.mjs.map +1 -1
  191. package/resources/v1/packages.d.mts +57 -4
  192. package/resources/v1/packages.d.mts.map +1 -1
  193. package/resources/v1/packages.d.ts +57 -4
  194. package/resources/v1/packages.d.ts.map +1 -1
  195. package/resources/v1/packages.js +3 -4
  196. package/resources/v1/packages.js.map +1 -1
  197. package/resources/v1/packages.mjs +3 -4
  198. package/resources/v1/packages.mjs.map +1 -1
  199. package/resources/v1/plans.d.mts.map +1 -1
  200. package/resources/v1/plans.d.ts.map +1 -1
  201. package/resources/v1/plans.mjs.map +1 -1
  202. package/resources/v1/pricing-units.d.mts.map +1 -1
  203. package/resources/v1/pricing-units.d.ts.map +1 -1
  204. package/resources/v1/pricing-units.mjs.map +1 -1
  205. package/resources/v1/services.d.mts.map +1 -1
  206. package/resources/v1/services.d.ts.map +1 -1
  207. package/resources/v1/services.mjs.map +1 -1
  208. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  209. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  210. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  211. package/resources/v1/settings/index.d.mts.map +1 -1
  212. package/resources/v1/settings/index.d.ts.map +1 -1
  213. package/resources/v1/settings/index.mjs.map +1 -1
  214. package/resources/v1/settings/settings.d.mts.map +1 -1
  215. package/resources/v1/settings/settings.d.ts.map +1 -1
  216. package/resources/v1/settings/settings.mjs.map +1 -1
  217. package/resources/v1/settings.d.mts.map +1 -1
  218. package/resources/v1/settings.d.ts.map +1 -1
  219. package/resources/v1/settings.mjs.map +1 -1
  220. package/resources/v1/usage.d.mts.map +1 -1
  221. package/resources/v1/usage.d.ts.map +1 -1
  222. package/resources/v1/usage.mjs.map +1 -1
  223. package/resources/v1/v1.d.mts +0 -4
  224. package/resources/v1/v1.d.mts.map +1 -1
  225. package/resources/v1/v1.d.ts +0 -4
  226. package/resources/v1/v1.d.ts.map +1 -1
  227. package/resources/v1/v1.js +0 -4
  228. package/resources/v1/v1.js.map +1 -1
  229. package/resources/v1/v1.mjs +0 -4
  230. package/resources/v1/v1.mjs.map +1 -1
  231. package/resources/v1.d.mts.map +1 -1
  232. package/resources/v1.d.ts.map +1 -1
  233. package/resources/v1.mjs.map +1 -1
  234. package/resources/v2/contracts.d.mts +1337 -1
  235. package/resources/v2/contracts.d.mts.map +1 -1
  236. package/resources/v2/contracts.d.ts +1337 -1
  237. package/resources/v2/contracts.d.ts.map +1 -1
  238. package/resources/v2/contracts.mjs.map +1 -1
  239. package/resources/v2/index.d.mts.map +1 -1
  240. package/resources/v2/index.d.ts.map +1 -1
  241. package/resources/v2/index.mjs.map +1 -1
  242. package/resources/v2/v2.d.mts.map +1 -1
  243. package/resources/v2/v2.d.ts.map +1 -1
  244. package/resources/v2/v2.mjs.map +1 -1
  245. package/resources/v2.d.mts.map +1 -1
  246. package/resources/v2.d.ts.map +1 -1
  247. package/resources/v2.mjs.map +1 -1
  248. package/resources/webhooks.d.mts.map +1 -1
  249. package/resources/webhooks.d.ts.map +1 -1
  250. package/resources/webhooks.mjs.map +1 -1
  251. package/resources.d.mts.map +1 -1
  252. package/resources.d.ts.map +1 -1
  253. package/resources.mjs.map +1 -1
  254. package/src/resources/shared.ts +290 -0
  255. package/src/resources/v1/contracts/contracts.ts +530 -1
  256. package/src/resources/v1/index.ts +0 -11
  257. package/src/resources/v1/packages.ts +81 -4
  258. package/src/resources/v1/v1.ts +0 -26
  259. package/src/resources/v2/contracts.ts +1756 -1
  260. package/src/version.ts +1 -1
  261. package/uploads.d.mts +1 -0
  262. package/uploads.d.mts.map +1 -1
  263. package/uploads.d.ts +1 -0
  264. package/uploads.d.ts.map +1 -1
  265. package/uploads.mjs +1 -0
  266. package/uploads.mjs.map +1 -1
  267. package/version.d.mts +1 -1
  268. package/version.d.ts +1 -1
  269. package/version.js +1 -1
  270. package/version.mjs +1 -1
  271. package/resources/v1/payments.d.mts +0 -127
  272. package/resources/v1/payments.d.mts.map +0 -1
  273. package/resources/v1/payments.d.ts +0 -127
  274. package/resources/v1/payments.d.ts.map +0 -1
  275. package/resources/v1/payments.js +0 -71
  276. package/resources/v1/payments.js.map +0 -1
  277. package/resources/v1/payments.mjs +0 -67
  278. package/resources/v1/payments.mjs.map +0 -1
  279. package/src/resources/v1/payments.ts +0 -187
@@ -245,7 +245,1577 @@ 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
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
540
+
541
+ commit_ids?: Array<string>;
542
+
543
+ presentation_group_values?: { [key: string]: string | null };
544
+
545
+ pricing_group_values?: { [key: string]: string };
546
+
547
+ product_id?: string;
548
+
549
+ product_tags?: Array<string>;
550
+
551
+ recurring_commit_ids?: Array<string>;
552
+ }
553
+
554
+ export interface OverwriteRate {
555
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
556
+
557
+ credit_type?: Shared.CreditTypeData;
558
+
559
+ /**
560
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
561
+ * processors.
562
+ */
563
+ custom_rate?: { [key: string]: unknown };
564
+
565
+ /**
566
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
567
+ * set to true.
568
+ */
569
+ is_prorated?: boolean;
570
+
571
+ /**
572
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
573
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
574
+ */
575
+ price?: number;
576
+
577
+ /**
578
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
579
+ */
580
+ quantity?: number;
581
+
582
+ /**
583
+ * Only set for TIERED rate_type.
584
+ */
585
+ tiers?: Array<Shared.Tier>;
586
+ }
587
+
588
+ export interface Product {
589
+ id: string;
590
+
591
+ name: string;
592
+ }
593
+ }
594
+
595
+ export interface AddRecurringCommit {
596
+ id: string;
597
+
598
+ /**
599
+ * The amount of commit to grant.
600
+ */
601
+ access_amount: AddRecurringCommit.AccessAmount;
602
+
603
+ /**
604
+ * The amount of time the created commits will be valid for
605
+ */
606
+ commit_duration: AddRecurringCommit.CommitDuration;
607
+
608
+ /**
609
+ * Will be passed down to the individual commits
610
+ */
611
+ priority: number;
612
+
613
+ product: AddRecurringCommit.Product;
614
+
615
+ /**
616
+ * Whether the created commits will use the commit rate or list rate
617
+ */
618
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
619
+
620
+ /**
621
+ * Determines the start time for the first commit
622
+ */
623
+ starting_at: string;
624
+
625
+ /**
626
+ * Will be passed down to the individual commits
627
+ */
628
+ applicable_product_ids?: Array<string>;
629
+
630
+ /**
631
+ * Will be passed down to the individual commits
632
+ */
633
+ applicable_product_tags?: Array<string>;
634
+
635
+ contract?: AddRecurringCommit.Contract;
636
+
637
+ /**
638
+ * Will be passed down to the individual commits
639
+ */
640
+ description?: string;
641
+
642
+ /**
643
+ * Determines when the contract will stop creating recurring commits. Optional
644
+ */
645
+ ending_before?: string;
646
+
647
+ /**
648
+ * Optional configuration for recurring credit hierarchy access control
649
+ */
650
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
651
+
652
+ /**
653
+ * The amount the customer should be billed for the commit. Not required.
654
+ */
655
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
656
+
657
+ /**
658
+ * Displayed on invoices. Will be passed through to the individual commits
659
+ */
660
+ name?: string;
661
+
662
+ /**
663
+ * Will be passed down to the individual commits
664
+ */
665
+ netsuite_sales_order_id?: string;
666
+
667
+ /**
668
+ * Determines whether the first and last commit will be prorated. If not provided,
669
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
670
+ */
671
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
672
+
673
+ /**
674
+ * The frequency at which the recurring commits will be created. If not provided: -
675
+ * The commits will be created on the usage invoice frequency. If provided: - The
676
+ * period defined in the duration will correspond to this frequency. - Commits will
677
+ * be created aligned with the recurring commit's starting_at rather than the usage
678
+ * invoice dates.
679
+ */
680
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
681
+
682
+ /**
683
+ * Will be passed down to the individual commits. This controls how much of an
684
+ * individual unexpired commit will roll over upon contract transition. Must be
685
+ * between 0 and 1.
686
+ */
687
+ rollover_fraction?: number;
688
+
689
+ /**
690
+ * List of filters that determine what kind of customer usage draws down a commit
691
+ * or credit. A customer's usage needs to meet the condition of at least one of the
692
+ * specifiers to contribute to a commit's or credit's drawdown.
693
+ */
694
+ specifiers?: Array<Shared.CommitSpecifier>;
695
+
696
+ /**
697
+ * Attach a subscription to the recurring commit/credit.
698
+ */
699
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
700
+ }
701
+
702
+ export namespace AddRecurringCommit {
703
+ /**
704
+ * The amount of commit to grant.
705
+ */
706
+ export interface AccessAmount {
707
+ credit_type_id: string;
708
+
709
+ unit_price: number;
710
+
711
+ quantity?: number;
712
+ }
713
+
714
+ /**
715
+ * The amount of time the created commits will be valid for
716
+ */
717
+ export interface CommitDuration {
718
+ value: number;
719
+
720
+ unit?: 'PERIODS';
721
+ }
722
+
723
+ export interface Product {
724
+ id: string;
725
+
726
+ name: string;
727
+ }
728
+
729
+ export interface Contract {
730
+ id: string;
731
+ }
732
+
733
+ /**
734
+ * The amount the customer should be billed for the commit. Not required.
735
+ */
736
+ export interface InvoiceAmount {
737
+ credit_type_id: string;
738
+
739
+ quantity: number;
740
+
741
+ unit_price: number;
742
+ }
743
+ }
744
+
745
+ export interface AddRecurringCredit {
746
+ id: string;
747
+
748
+ /**
749
+ * The amount of commit to grant.
750
+ */
751
+ access_amount: AddRecurringCredit.AccessAmount;
752
+
753
+ /**
754
+ * The amount of time the created commits will be valid for
755
+ */
756
+ commit_duration: AddRecurringCredit.CommitDuration;
757
+
758
+ /**
759
+ * Will be passed down to the individual commits
760
+ */
761
+ priority: number;
762
+
763
+ product: AddRecurringCredit.Product;
764
+
765
+ /**
766
+ * Whether the created commits will use the commit rate or list rate
767
+ */
768
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
769
+
770
+ /**
771
+ * Determines the start time for the first commit
772
+ */
773
+ starting_at: string;
774
+
775
+ /**
776
+ * Will be passed down to the individual commits
777
+ */
778
+ applicable_product_ids?: Array<string>;
779
+
780
+ /**
781
+ * Will be passed down to the individual commits
782
+ */
783
+ applicable_product_tags?: Array<string>;
784
+
785
+ contract?: AddRecurringCredit.Contract;
786
+
787
+ /**
788
+ * Will be passed down to the individual commits
789
+ */
790
+ description?: string;
791
+
792
+ /**
793
+ * Determines when the contract will stop creating recurring commits. Optional
794
+ */
795
+ ending_before?: string;
796
+
797
+ /**
798
+ * Optional configuration for recurring credit hierarchy access control
799
+ */
800
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
801
+
802
+ /**
803
+ * Displayed on invoices. Will be passed through to the individual commits
804
+ */
805
+ name?: string;
806
+
807
+ /**
808
+ * Will be passed down to the individual commits
809
+ */
810
+ netsuite_sales_order_id?: string;
811
+
812
+ /**
813
+ * Determines whether the first and last commit will be prorated. If not provided,
814
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
815
+ */
816
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
817
+
818
+ /**
819
+ * The frequency at which the recurring commits will be created. If not provided: -
820
+ * The commits will be created on the usage invoice frequency. If provided: - The
821
+ * period defined in the duration will correspond to this frequency. - Commits will
822
+ * be created aligned with the recurring commit's starting_at rather than the usage
823
+ * invoice dates.
824
+ */
825
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
826
+
827
+ /**
828
+ * Will be passed down to the individual commits. This controls how much of an
829
+ * individual unexpired commit will roll over upon contract transition. Must be
830
+ * between 0 and 1.
831
+ */
832
+ rollover_fraction?: number;
833
+
834
+ /**
835
+ * List of filters that determine what kind of customer usage draws down a commit
836
+ * or credit. A customer's usage needs to meet the condition of at least one of the
837
+ * specifiers to contribute to a commit's or credit's drawdown.
838
+ */
839
+ specifiers?: Array<Shared.CommitSpecifier>;
840
+
841
+ /**
842
+ * Attach a subscription to the recurring commit/credit.
843
+ */
844
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
845
+ }
846
+
847
+ export namespace AddRecurringCredit {
848
+ /**
849
+ * The amount of commit to grant.
850
+ */
851
+ export interface AccessAmount {
852
+ credit_type_id: string;
853
+
854
+ unit_price: number;
855
+
856
+ quantity?: number;
857
+ }
858
+
859
+ /**
860
+ * The amount of time the created commits will be valid for
861
+ */
862
+ export interface CommitDuration {
863
+ value: number;
864
+
865
+ unit?: 'PERIODS';
866
+ }
867
+
868
+ export interface Product {
869
+ id: string;
870
+
871
+ name: string;
872
+ }
873
+
874
+ export interface Contract {
875
+ id: string;
876
+ }
877
+ }
878
+
879
+ export interface AddResellerRoyalty {
880
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
881
+
882
+ applicable_product_ids?: Array<string>;
883
+
884
+ applicable_product_tags?: Array<string>;
885
+
886
+ aws_account_number?: string;
887
+
888
+ aws_offer_id?: string;
889
+
890
+ aws_payer_reference_id?: string;
891
+
892
+ ending_before?: string | null;
893
+
894
+ fraction?: number;
895
+
896
+ gcp_account_id?: string;
897
+
898
+ gcp_offer_id?: string;
899
+
900
+ netsuite_reseller_id?: string;
901
+
902
+ reseller_contract_value?: number;
903
+
904
+ starting_at?: string;
905
+ }
906
+
907
+ export interface AddScheduledCharge {
908
+ id: string;
909
+
910
+ product: AddScheduledCharge.Product;
911
+
912
+ schedule: Shared.SchedulePointInTime;
913
+
914
+ /**
915
+ * displayed on invoices
916
+ */
917
+ name?: string;
918
+
919
+ /**
920
+ * This field's availability is dependent on your client's configuration.
921
+ */
922
+ netsuite_sales_order_id?: string;
923
+ }
924
+
925
+ export namespace AddScheduledCharge {
926
+ export interface Product {
927
+ id: string;
928
+
929
+ name: string;
930
+ }
931
+ }
932
+
933
+ export interface AddSubscription {
934
+ /**
935
+ * Previous, current, and next billing periods for the subscription.
936
+ */
937
+ billing_periods: AddSubscription.BillingPeriods;
938
+
939
+ collection_schedule: 'ADVANCE' | 'ARREARS';
940
+
941
+ proration: AddSubscription.Proration;
942
+
943
+ /**
944
+ * Determines how the subscription's quantity is controlled. Defaults to
945
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
946
+ * directly on the subscription. `initial_quantity` must be provided with this
947
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
948
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
949
+ * user_123) to increment and decrement a subscription quantity, rather than
950
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
951
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
952
+ * provided with this option.
953
+ */
954
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
955
+
956
+ /**
957
+ * List of quantity schedule items for the subscription. Only includes the current
958
+ * quantity and future quantity changes.
959
+ */
960
+ quantity_schedule: Array<AddSubscription.QuantitySchedule>;
961
+
962
+ starting_at: string;
963
+
964
+ subscription_rate: AddSubscription.SubscriptionRate;
965
+
966
+ id?: string;
967
+
968
+ /**
969
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
970
+ */
971
+ custom_fields?: { [key: string]: string };
972
+
973
+ description?: string;
974
+
975
+ ending_before?: string;
976
+
977
+ fiat_credit_type_id?: string;
978
+
979
+ name?: string;
980
+
981
+ seat_config?: AddSubscription.SeatConfig;
982
+ }
983
+
984
+ export namespace AddSubscription {
985
+ /**
986
+ * Previous, current, and next billing periods for the subscription.
987
+ */
988
+ export interface BillingPeriods {
989
+ current?: BillingPeriods.Current;
990
+
991
+ next?: BillingPeriods.Next;
992
+
993
+ previous?: BillingPeriods.Previous;
994
+ }
995
+
996
+ export namespace BillingPeriods {
997
+ export interface Current {
998
+ ending_before: string;
999
+
1000
+ starting_at: string;
1001
+ }
1002
+
1003
+ export interface Next {
1004
+ ending_before: string;
1005
+
1006
+ starting_at: string;
1007
+ }
1008
+
1009
+ export interface Previous {
1010
+ ending_before: string;
1011
+
1012
+ starting_at: string;
1013
+ }
1014
+ }
1015
+
1016
+ export interface Proration {
1017
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1018
+
1019
+ is_prorated: boolean;
1020
+ }
1021
+
1022
+ export interface QuantitySchedule {
1023
+ quantity: number;
1024
+
1025
+ starting_at: string;
1026
+
1027
+ ending_before?: string;
1028
+ }
1029
+
1030
+ export interface SubscriptionRate {
1031
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1032
+
1033
+ product: SubscriptionRate.Product;
1034
+ }
1035
+
1036
+ export namespace SubscriptionRate {
1037
+ export interface Product {
1038
+ id: string;
1039
+
1040
+ name: string;
1041
+ }
1042
+ }
1043
+
1044
+ export interface SeatConfig {
1045
+ /**
1046
+ * The property name, sent on usage events, that identifies the seat ID associated
1047
+ * with the usage event. For example, the property name might be seat_id or
1048
+ * user_id. The property must be set as a group key on billable metrics and a
1049
+ * presentation/pricing group key on contract products. This allows linked
1050
+ * recurring credits with an allocation per seat to be consumed by only one seat's
1051
+ * usage.
1052
+ */
1053
+ seat_group_key: string;
1054
+ }
1055
+ }
1056
+
1057
+ export interface AddUsageFilter {
1058
+ group_key: string;
1059
+
1060
+ group_values: Array<string>;
1061
+
1062
+ /**
1063
+ * This will match contract starting_at value if usage filter is active from the
1064
+ * beginning of the contract.
1065
+ */
1066
+ starting_at: string;
1067
+
1068
+ /**
1069
+ * This will match contract ending_before value if usage filter is active until the
1070
+ * end of the contract. It will be undefined if the contract is open-ended.
1071
+ */
1072
+ ending_before?: string;
1073
+ }
1074
+
1075
+ export interface ArchiveCommit {
1076
+ id: string;
1077
+ }
1078
+
1079
+ export interface ArchiveCredit {
1080
+ id: string;
1081
+ }
1082
+
1083
+ export interface ArchiveScheduledCharge {
1084
+ id: string;
1085
+ }
1086
+
1087
+ export interface RemoveOverride {
1088
+ id: string;
1089
+ }
1090
+
1091
+ export interface UpdateCommit {
1092
+ id: string;
1093
+
1094
+ access_schedule?: UpdateCommit.AccessSchedule;
1095
+
1096
+ /**
1097
+ * Which products the commit applies to. If applicable_product_ids,
1098
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1099
+ * all products.
1100
+ */
1101
+ applicable_product_ids?: Array<string> | null;
1102
+
1103
+ /**
1104
+ * Which tags the commit applies to. If applicable_product_ids,
1105
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1106
+ * all products.
1107
+ */
1108
+ applicable_product_tags?: Array<string> | null;
1109
+
1110
+ description?: string;
1111
+
1112
+ /**
1113
+ * Optional configuration for commit hierarchy access control
1114
+ */
1115
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1116
+
1117
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
1118
+
1119
+ name?: string;
1120
+
1121
+ netsuite_sales_order_id?: string | null;
1122
+
1123
+ /**
1124
+ * If multiple commits are applicable, the one with the lower priority will apply
1125
+ * first.
1126
+ */
1127
+ priority?: number | null;
1128
+
1129
+ product_id?: string;
1130
+
1131
+ /**
1132
+ * If set, the commit's rate type was updated to the specified value.
1133
+ */
1134
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1135
+
1136
+ rollover_fraction?: number | null;
1137
+
1138
+ /**
1139
+ * List of filters that determine what kind of customer usage draws down a commit
1140
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1141
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1142
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1143
+ * Instead, to target usage by product or product tag, pass those values in the
1144
+ * body of `specifiers`.
1145
+ */
1146
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1147
+ }
1148
+
1149
+ export namespace UpdateCommit {
1150
+ export interface AccessSchedule {
1151
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
1152
+
1153
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
1154
+
1155
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
1156
+ }
1157
+
1158
+ export namespace AccessSchedule {
1159
+ export interface AddScheduleItem {
1160
+ amount: number;
1161
+
1162
+ /**
1163
+ * RFC 3339 timestamp (exclusive)
1164
+ */
1165
+ ending_before: string;
1166
+
1167
+ /**
1168
+ * RFC 3339 timestamp (inclusive)
1169
+ */
1170
+ starting_at: string;
1171
+ }
1172
+
1173
+ export interface RemoveScheduleItem {
1174
+ id: string;
1175
+ }
1176
+
1177
+ export interface UpdateScheduleItem {
1178
+ id: string;
1179
+
1180
+ amount?: number;
1181
+
1182
+ /**
1183
+ * RFC 3339 timestamp (exclusive)
1184
+ */
1185
+ ending_before?: string;
1186
+
1187
+ /**
1188
+ * RFC 3339 timestamp (inclusive)
1189
+ */
1190
+ starting_at?: string;
1191
+ }
1192
+ }
1193
+
1194
+ export interface InvoiceSchedule {
1195
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1196
+
1197
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1198
+
1199
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1200
+ }
1201
+
1202
+ export namespace InvoiceSchedule {
1203
+ export interface AddScheduleItem {
1204
+ timestamp: string;
1205
+
1206
+ amount?: number;
1207
+
1208
+ quantity?: number;
1209
+
1210
+ unit_price?: number;
1211
+ }
1212
+
1213
+ export interface RemoveScheduleItem {
1214
+ id: string;
1215
+ }
1216
+
1217
+ export interface UpdateScheduleItem {
1218
+ id: string;
1219
+
1220
+ amount?: number;
1221
+
1222
+ quantity?: number;
1223
+
1224
+ timestamp?: string;
1225
+
1226
+ unit_price?: number;
1227
+ }
1228
+ }
1229
+ }
1230
+
1231
+ export interface UpdateCredit {
1232
+ id: string;
1233
+
1234
+ access_schedule?: UpdateCredit.AccessSchedule;
1235
+
1236
+ /**
1237
+ * Which products the credit applies to. If applicable_product_ids,
1238
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1239
+ * all products.
1240
+ */
1241
+ applicable_product_ids?: Array<string> | null;
1242
+
1243
+ /**
1244
+ * Which tags the credit applies to. If applicable_product_ids,
1245
+ * applicable_product_tags or specifiers are not provided, the credit applies to
1246
+ * all products.
1247
+ */
1248
+ applicable_product_tags?: Array<string> | null;
1249
+
1250
+ description?: string;
1251
+
1252
+ /**
1253
+ * Optional configuration for credit hierarchy access control
1254
+ */
1255
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1256
+
1257
+ name?: string;
1258
+
1259
+ netsuite_sales_order_id?: string | null;
1260
+
1261
+ /**
1262
+ * If multiple credits are applicable, the one with the lower priority will apply
1263
+ * first.
1264
+ */
1265
+ priority?: number | null;
1266
+
1267
+ product_id?: string;
1268
+
1269
+ /**
1270
+ * If set, the credit's rate type was updated to the specified value.
1271
+ */
1272
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1273
+
1274
+ rollover_fraction?: number | null;
1275
+
1276
+ /**
1277
+ * List of filters that determine what kind of customer usage draws down a commit
1278
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1279
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1280
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1281
+ * Instead, to target usage by product or product tag, pass those values in the
1282
+ * body of `specifiers`.
1283
+ */
1284
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1285
+ }
1286
+
1287
+ export namespace UpdateCredit {
1288
+ export interface AccessSchedule {
1289
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
1290
+
1291
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
1292
+
1293
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
1294
+ }
1295
+
1296
+ export namespace AccessSchedule {
1297
+ export interface AddScheduleItem {
1298
+ amount: number;
1299
+
1300
+ /**
1301
+ * RFC 3339 timestamp (exclusive)
1302
+ */
1303
+ ending_before: string;
1304
+
1305
+ /**
1306
+ * RFC 3339 timestamp (inclusive)
1307
+ */
1308
+ starting_at: string;
1309
+ }
1310
+
1311
+ export interface RemoveScheduleItem {
1312
+ id: string;
1313
+ }
1314
+
1315
+ export interface UpdateScheduleItem {
1316
+ id: string;
1317
+
1318
+ amount?: number;
1319
+
1320
+ /**
1321
+ * RFC 3339 timestamp (exclusive)
1322
+ */
1323
+ ending_before?: string;
1324
+
1325
+ /**
1326
+ * RFC 3339 timestamp (inclusive)
1327
+ */
1328
+ starting_at?: string;
1329
+ }
1330
+ }
1331
+ }
1332
+
1333
+ export interface UpdateDiscount {
1334
+ id: string;
1335
+
1336
+ /**
1337
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1338
+ */
1339
+ custom_fields?: { [key: string]: string };
1340
+
1341
+ name?: string;
1342
+
1343
+ netsuite_sales_order_id?: string;
1344
+
1345
+ /**
1346
+ * Must provide either schedule_items or recurring_schedule.
1347
+ */
1348
+ schedule?: UpdateDiscount.Schedule;
1349
+ }
1350
+
1351
+ export namespace UpdateDiscount {
1352
+ /**
1353
+ * Must provide either schedule_items or recurring_schedule.
1354
+ */
1355
+ export interface Schedule {
1356
+ /**
1357
+ * Defaults to USD (cents) if not passed.
1358
+ */
1359
+ credit_type_id?: string;
1360
+
1361
+ /**
1362
+ * This field is only applicable to commit invoice schedules. If true, this
1363
+ * schedule will not generate an invoice.
1364
+ */
1365
+ do_not_invoice?: boolean;
1366
+
1367
+ /**
1368
+ * Enter the unit price and quantity for the charge or instead only send the
1369
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1370
+ * quantity is inferred to be 1.
1371
+ */
1372
+ recurring_schedule?: Schedule.RecurringSchedule;
1373
+
1374
+ /**
1375
+ * Either provide amount or provide both unit_price and quantity.
1376
+ */
1377
+ schedule_items?: Array<Schedule.ScheduleItem>;
1378
+ }
1379
+
1380
+ export namespace Schedule {
1381
+ /**
1382
+ * Enter the unit price and quantity for the charge or instead only send the
1383
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1384
+ * quantity is inferred to be 1.
1385
+ */
1386
+ export interface RecurringSchedule {
1387
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
1388
+
1389
+ /**
1390
+ * RFC 3339 timestamp (exclusive).
1391
+ */
1392
+ ending_before: string;
1393
+
1394
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
1395
+
1396
+ /**
1397
+ * RFC 3339 timestamp (inclusive).
1398
+ */
1399
+ starting_at: string;
1400
+
1401
+ /**
1402
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1403
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1404
+ * inferred to be 1.
1405
+ */
1406
+ amount?: number;
1407
+
1408
+ /**
1409
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1410
+ * amount and must be specified with unit_price. If specified amount cannot be
1411
+ * provided.
1412
+ */
1413
+ quantity?: number;
1414
+
1415
+ /**
1416
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1417
+ * amount and must be specified with quantity. If specified amount cannot be
1418
+ * provided.
1419
+ */
1420
+ unit_price?: number;
1421
+ }
1422
+
1423
+ export interface ScheduleItem {
1424
+ /**
1425
+ * timestamp of the scheduled event
1426
+ */
1427
+ timestamp: string;
1428
+
1429
+ /**
1430
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1431
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1432
+ * inferred to be 1.
1433
+ */
1434
+ amount?: number;
1435
+
1436
+ /**
1437
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1438
+ * amount and must be specified with unit_price. If specified amount cannot be
1439
+ * provided.
1440
+ */
1441
+ quantity?: number;
1442
+
1443
+ /**
1444
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1445
+ * amount and must be specified with quantity. If specified amount cannot be
1446
+ * provided.
1447
+ */
1448
+ unit_price?: number;
1449
+ }
1450
+ }
1451
+ }
1452
+
1453
+ export interface UpdatePrepaidBalanceThresholdConfiguration {
1454
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
1455
+
1456
+ /**
1457
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1458
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1459
+ */
1460
+ custom_credit_type_id?: string | null;
1461
+
1462
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
1463
+
1464
+ /**
1465
+ * When set to false, the contract will not be evaluated against the
1466
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1467
+ * regardless of prior state.
1468
+ */
1469
+ is_enabled?: boolean;
1470
+
1471
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1472
+
1473
+ /**
1474
+ * Specify the amount the balance should be recharged to.
1475
+ */
1476
+ recharge_to_amount?: number;
1477
+
1478
+ /**
1479
+ * Specify the threshold amount for the contract. Each time the contract's balance
1480
+ * lowers to this amount, a threshold charge will be initiated.
1481
+ */
1482
+ threshold_amount?: number;
1483
+
1484
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1485
+ }
1486
+
1487
+ export namespace UpdatePrepaidBalanceThresholdConfiguration {
1488
+ export interface Commit extends Shared.UpdateBaseThresholdCommit {
1489
+ /**
1490
+ * Which products the threshold commit applies to. If both applicable_product_ids
1491
+ * and applicable_product_tags are not provided, the commit applies to all
1492
+ * products.
1493
+ */
1494
+ applicable_product_ids?: Array<string> | null;
1495
+
1496
+ /**
1497
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
1498
+ * applicable_product_tags are not provided, the commit applies to all products.
1499
+ */
1500
+ applicable_product_tags?: Array<string> | null;
1501
+
1502
+ /**
1503
+ * List of filters that determine what kind of customer usage draws down a commit
1504
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1505
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1506
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1507
+ * Instead, to target usage by product or product tag, pass those values in the
1508
+ * body of `specifiers`.
1509
+ */
1510
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1511
+ }
1512
+
1513
+ export interface DiscountConfiguration {
1514
+ /**
1515
+ * Update the discount cap. Set to null to remove an existing cap.
1516
+ */
1517
+ cap?: DiscountConfiguration.Cap | null;
1518
+
1519
+ /**
1520
+ * The fraction of the original amount that the customer pays after applying the
1521
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1522
+ * the customer pays 85% of the original amount (a 15% discount).
1523
+ */
1524
+ payment_fraction?: number | null;
1525
+ }
1526
+
1527
+ export namespace DiscountConfiguration {
1528
+ /**
1529
+ * Update the discount cap. Set to null to remove an existing cap.
1530
+ */
1531
+ export interface Cap {
1532
+ /**
1533
+ * Accumulated spend ceiling above which the discount stops applying.
1534
+ */
1535
+ amount: number;
1536
+
1537
+ /**
1538
+ * Alias of the spend tracker this cap is measured against.
1539
+ */
1540
+ spend_tracker_alias: string;
1541
+ }
1542
+ }
1543
+
1544
+ export interface ThresholdBalanceSpecifier {
1545
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
1546
+ }
1547
+
1548
+ export namespace ThresholdBalanceSpecifier {
1549
+ export interface Exclude {
1550
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
1551
+ }
1552
+
1553
+ export namespace Exclude {
1554
+ export interface CustomFieldFilter {
1555
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
1556
+
1557
+ key: string;
1558
+
1559
+ value: string;
1560
+ }
1561
+ }
1562
+ }
1563
+ }
1564
+
1565
+ export interface UpdateRecurringCommit {
1566
+ id: string;
1567
+
1568
+ access_amount?: UpdateRecurringCommit.AccessAmount;
1569
+
1570
+ ending_before?: string;
1571
+
1572
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1573
+
1574
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1575
+ }
1576
+
1577
+ export namespace UpdateRecurringCommit {
1578
+ export interface AccessAmount {
1579
+ quantity?: number;
1580
+
1581
+ unit_price?: number;
1582
+ }
1583
+
1584
+ export interface InvoiceAmount {
1585
+ quantity?: number;
1586
+
1587
+ unit_price?: number;
1588
+ }
1589
+ }
1590
+
1591
+ export interface UpdateRecurringCredit {
1592
+ id: string;
1593
+
1594
+ access_amount?: UpdateRecurringCredit.AccessAmount;
1595
+
1596
+ ending_before?: string;
1597
+
1598
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1599
+ }
1600
+
1601
+ export namespace UpdateRecurringCredit {
1602
+ export interface AccessAmount {
1603
+ quantity?: number;
1604
+
1605
+ unit_price?: number;
1606
+ }
1607
+ }
1608
+
1609
+ export interface UpdateRefundInvoice {
1610
+ date: string;
1611
+
1612
+ invoice_id: string;
1613
+ }
1614
+
1615
+ export interface UpdateScheduledCharge {
1616
+ id: string;
1617
+
1618
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
1619
+
1620
+ name?: string;
1621
+
1622
+ netsuite_sales_order_id?: string | null;
1623
+ }
1624
+
1625
+ export namespace UpdateScheduledCharge {
1626
+ export interface InvoiceSchedule {
1627
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1628
+
1629
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1630
+
1631
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1632
+ }
1633
+
1634
+ export namespace InvoiceSchedule {
1635
+ export interface AddScheduleItem {
1636
+ timestamp: string;
1637
+
1638
+ amount?: number;
1639
+
1640
+ quantity?: number;
1641
+
1642
+ unit_price?: number;
1643
+ }
1644
+
1645
+ export interface RemoveScheduleItem {
1646
+ id: string;
1647
+ }
1648
+
1649
+ export interface UpdateScheduleItem {
1650
+ id: string;
1651
+
1652
+ amount?: number;
1653
+
1654
+ quantity?: number;
1655
+
1656
+ timestamp?: string;
1657
+
1658
+ unit_price?: number;
1659
+ }
1660
+ }
1661
+ }
1662
+
1663
+ export interface UpdateSpendThresholdConfiguration {
1664
+ commit?: Shared.UpdateBaseThresholdCommit;
1665
+
1666
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
1667
+
1668
+ /**
1669
+ * When set to false, the contract will not be evaluated against the
1670
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1671
+ * regardless of prior state.
1672
+ */
1673
+ is_enabled?: boolean;
1674
+
1675
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1676
+
1677
+ /**
1678
+ * Specify the threshold amount for the contract. Each time the contract's usage
1679
+ * hits this amount, a threshold charge will be initiated.
1680
+ */
1681
+ threshold_amount?: number;
1682
+ }
1683
+
1684
+ export namespace UpdateSpendThresholdConfiguration {
1685
+ export interface DiscountConfiguration {
1686
+ /**
1687
+ * Update the discount cap. Set to null to remove an existing cap.
1688
+ */
1689
+ cap?: DiscountConfiguration.Cap | null;
1690
+
1691
+ /**
1692
+ * The fraction of the original amount that the customer pays after applying the
1693
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1694
+ * the customer pays 85% of the original amount (a 15% discount).
1695
+ */
1696
+ payment_fraction?: number | null;
1697
+ }
1698
+
1699
+ export namespace DiscountConfiguration {
1700
+ /**
1701
+ * Update the discount cap. Set to null to remove an existing cap.
1702
+ */
1703
+ export interface Cap {
1704
+ /**
1705
+ * Accumulated spend ceiling above which the discount stops applying.
1706
+ */
1707
+ amount: number;
1708
+
1709
+ /**
1710
+ * Alias of the spend tracker this cap is measured against.
1711
+ */
1712
+ spend_tracker_alias: string;
1713
+ }
1714
+ }
1715
+ }
1716
+
1717
+ export interface UpdateSubscription {
1718
+ id: string;
1719
+
1720
+ ending_before?: string;
1721
+
1722
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
1723
+
1724
+ /**
1725
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1726
+ */
1727
+ seat_updates?: UpdateSubscription.SeatUpdates;
1728
+ }
1729
+
1730
+ export namespace UpdateSubscription {
1731
+ export interface QuantityUpdate {
1732
+ starting_at: string;
1733
+
1734
+ quantity?: number;
1735
+
1736
+ quantity_delta?: number;
1737
+ }
1738
+
1739
+ /**
1740
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1741
+ */
1742
+ export interface SeatUpdates {
1743
+ /**
1744
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
1745
+ * IDs will fill these unassigned seats and not increase the total subscription
1746
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
1747
+ * total subscription quantity will increase.
1748
+ */
1749
+ add_seat_ids?: Array<SeatUpdates.AddSeatID>;
1750
+
1751
+ /**
1752
+ * Adds unassigned seats to the subscription. This will increase the total
1753
+ * subscription quantity.
1754
+ */
1755
+ add_unassigned_seats?: Array<SeatUpdates.AddUnassignedSeat>;
1756
+
1757
+ /**
1758
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
1759
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
1760
+ * found on the subscription, this is a no-op.
1761
+ */
1762
+ remove_seat_ids?: Array<SeatUpdates.RemoveSeatID>;
1763
+
1764
+ /**
1765
+ * Removes unassigned seats from the subscription. This will decrease the total
1766
+ * subscription quantity if there are are unassigned seats.
1767
+ */
1768
+ remove_unassigned_seats?: Array<SeatUpdates.RemoveUnassignedSeat>;
1769
+ }
1770
+
1771
+ export namespace SeatUpdates {
1772
+ export interface AddSeatID {
1773
+ seat_ids: Array<string>;
1774
+
1775
+ /**
1776
+ * Assigned seats will be added/removed starting at this date.
1777
+ */
1778
+ starting_at: string;
1779
+ }
1780
+
1781
+ export interface AddUnassignedSeat {
1782
+ /**
1783
+ * The number of unassigned seats on the subscription will increase/decrease by
1784
+ * this delta. Must be greater than 0.
1785
+ */
1786
+ quantity: number;
1787
+
1788
+ /**
1789
+ * Unassigned seats will be updated starting at this date.
1790
+ */
1791
+ starting_at: string;
1792
+ }
1793
+
1794
+ export interface RemoveSeatID {
1795
+ seat_ids: Array<string>;
1796
+
1797
+ /**
1798
+ * Assigned seats will be added/removed starting at this date.
1799
+ */
1800
+ starting_at: string;
1801
+ }
1802
+
1803
+ export interface RemoveUnassignedSeat {
1804
+ /**
1805
+ * The number of unassigned seats on the subscription will increase/decrease by
1806
+ * this delta. Must be greater than 0.
1807
+ */
1808
+ quantity: number;
1809
+
1810
+ /**
1811
+ * Unassigned seats will be updated starting at this date.
1812
+ */
1813
+ starting_at: string;
1814
+ }
1815
+ }
1816
+ }
1817
+ }
1818
+ }
249
1819
  }
250
1820
 
251
1821
  export interface ContractEditCommitResponse {
@@ -1485,6 +3055,8 @@ export namespace ContractGetEditHistoryResponse {
1485
3055
  * lowers to this amount, a threshold charge will be initiated.
1486
3056
  */
1487
3057
  threshold_amount?: number;
3058
+
3059
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1488
3060
  }
1489
3061
 
1490
3062
  export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -1514,6 +3086,11 @@ export namespace ContractGetEditHistoryResponse {
1514
3086
  }
1515
3087
 
1516
3088
  export interface DiscountConfiguration {
3089
+ /**
3090
+ * Update the discount cap. Set to null to remove an existing cap.
3091
+ */
3092
+ cap?: DiscountConfiguration.Cap | null;
3093
+
1517
3094
  /**
1518
3095
  * The fraction of the original amount that the customer pays after applying the
1519
3096
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1521,6 +3098,43 @@ export namespace ContractGetEditHistoryResponse {
1521
3098
  */
1522
3099
  payment_fraction?: number | null;
1523
3100
  }
3101
+
3102
+ export namespace DiscountConfiguration {
3103
+ /**
3104
+ * Update the discount cap. Set to null to remove an existing cap.
3105
+ */
3106
+ export interface Cap {
3107
+ /**
3108
+ * Accumulated spend ceiling above which the discount stops applying.
3109
+ */
3110
+ amount: number;
3111
+
3112
+ /**
3113
+ * Alias of the spend tracker this cap is measured against.
3114
+ */
3115
+ spend_tracker_alias: string;
3116
+ }
3117
+ }
3118
+
3119
+ export interface ThresholdBalanceSpecifier {
3120
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
3121
+ }
3122
+
3123
+ export namespace ThresholdBalanceSpecifier {
3124
+ export interface Exclude {
3125
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
3126
+ }
3127
+
3128
+ export namespace Exclude {
3129
+ export interface CustomFieldFilter {
3130
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
3131
+
3132
+ key: string;
3133
+
3134
+ value: string;
3135
+ }
3136
+ }
3137
+ }
1524
3138
  }
1525
3139
 
1526
3140
  export interface UpdateRecurringCommit {
@@ -1644,6 +3258,11 @@ export namespace ContractGetEditHistoryResponse {
1644
3258
 
1645
3259
  export namespace UpdateSpendThresholdConfiguration {
1646
3260
  export interface DiscountConfiguration {
3261
+ /**
3262
+ * Update the discount cap. Set to null to remove an existing cap.
3263
+ */
3264
+ cap?: DiscountConfiguration.Cap | null;
3265
+
1647
3266
  /**
1648
3267
  * The fraction of the original amount that the customer pays after applying the
1649
3268
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1651,6 +3270,23 @@ export namespace ContractGetEditHistoryResponse {
1651
3270
  */
1652
3271
  payment_fraction?: number | null;
1653
3272
  }
3273
+
3274
+ export namespace DiscountConfiguration {
3275
+ /**
3276
+ * Update the discount cap. Set to null to remove an existing cap.
3277
+ */
3278
+ export interface Cap {
3279
+ /**
3280
+ * Accumulated spend ceiling above which the discount stops applying.
3281
+ */
3282
+ amount: number;
3283
+
3284
+ /**
3285
+ * Alias of the spend tracker this cap is measured against.
3286
+ */
3287
+ spend_tracker_alias: string;
3288
+ }
3289
+ }
1654
3290
  }
1655
3291
 
1656
3292
  export interface UpdateSubscription {
@@ -1863,6 +3499,12 @@ export interface ContractEditParams {
1863
3499
 
1864
3500
  add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
1865
3501
 
3502
+ /**
3503
+ * Spend trackers to add to this contract. Aliases must be unique within a
3504
+ * contract.
3505
+ */
3506
+ add_spend_trackers?: Array<ContractEditParams.AddSpendTracker>;
3507
+
1866
3508
  /**
1867
3509
  * Optional list of
1868
3510
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1893,6 +3535,11 @@ export interface ContractEditParams {
1893
3535
  */
1894
3536
  archive_scheduled_charges?: Array<ContractEditParams.ArchiveScheduledCharge>;
1895
3537
 
3538
+ /**
3539
+ * Aliases of spend trackers to archive.
3540
+ */
3541
+ archive_spend_trackers?: Array<string>;
3542
+
1896
3543
  /**
1897
3544
  * IDs of overrides to remove
1898
3545
  */
@@ -2088,6 +3735,11 @@ export namespace ContractEditParams {
2088
3735
  */
2089
3736
  specifiers?: Array<Shared.CommitSpecifierInput>;
2090
3737
 
3738
+ /**
3739
+ * Optional attributes for spend tracker integration. Immutable after creation.
3740
+ */
3741
+ spend_tracker_attributes?: AddCommit.SpendTrackerAttributes;
3742
+
2091
3743
  /**
2092
3744
  * A temporary ID for the commit that can be used to reference the commit for
2093
3745
  * commit specific overrides.
@@ -2302,6 +3954,17 @@ export namespace ContractEditParams {
2302
3954
  on_session_payment?: boolean;
2303
3955
  }
2304
3956
  }
3957
+
3958
+ /**
3959
+ * Optional attributes for spend tracker integration. Immutable after creation.
3960
+ */
3961
+ export interface SpendTrackerAttributes {
3962
+ /**
3963
+ * If true, this commit will be included in spend trackers with discounted set to
3964
+ * DISCOUNTED_ONLY
3965
+ */
3966
+ counts_as_discounted: boolean;
3967
+ }
2305
3968
  }
2306
3969
 
2307
3970
  export interface AddCredit {
@@ -3267,6 +4930,32 @@ export namespace ContractEditParams {
3267
4930
  }
3268
4931
  }
3269
4932
 
4933
+ export interface AddSpendTracker {
4934
+ /**
4935
+ * Human-readable identifier, unique per contract.
4936
+ */
4937
+ alias: string;
4938
+
4939
+ applicable_spend_specifiers: Array<AddSpendTracker.ApplicableSpendSpecifier>;
4940
+
4941
+ credit_type_id: string;
4942
+
4943
+ reset_frequency: 'BILLING_PERIOD';
4944
+ }
4945
+
4946
+ export namespace AddSpendTracker {
4947
+ export interface ApplicableSpendSpecifier {
4948
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
4949
+
4950
+ spend_type: 'COMMIT_PURCHASE';
4951
+
4952
+ /**
4953
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
4954
+ */
4955
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
4956
+ }
4957
+ }
4958
+
3270
4959
  export interface AddSubscription {
3271
4960
  collection_schedule: 'ADVANCE' | 'ARREARS';
3272
4961
 
@@ -3616,6 +5305,8 @@ export namespace ContractEditParams {
3616
5305
  * lowers to this amount, a threshold charge will be initiated.
3617
5306
  */
3618
5307
  threshold_amount?: number;
5308
+
5309
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
3619
5310
  }
3620
5311
 
3621
5312
  export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -3645,6 +5336,11 @@ export namespace ContractEditParams {
3645
5336
  }
3646
5337
 
3647
5338
  export interface DiscountConfiguration {
5339
+ /**
5340
+ * Update the discount cap. Set to null to remove an existing cap.
5341
+ */
5342
+ cap?: DiscountConfiguration.Cap | null;
5343
+
3648
5344
  /**
3649
5345
  * The fraction of the original amount that the customer pays after applying the
3650
5346
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3652,6 +5348,43 @@ export namespace ContractEditParams {
3652
5348
  */
3653
5349
  payment_fraction?: number | null;
3654
5350
  }
5351
+
5352
+ export namespace DiscountConfiguration {
5353
+ /**
5354
+ * Update the discount cap. Set to null to remove an existing cap.
5355
+ */
5356
+ export interface Cap {
5357
+ /**
5358
+ * Accumulated spend ceiling above which the discount stops applying.
5359
+ */
5360
+ amount: number;
5361
+
5362
+ /**
5363
+ * Alias of the spend tracker this cap is measured against.
5364
+ */
5365
+ spend_tracker_alias: string;
5366
+ }
5367
+ }
5368
+
5369
+ export interface ThresholdBalanceSpecifier {
5370
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
5371
+ }
5372
+
5373
+ export namespace ThresholdBalanceSpecifier {
5374
+ export interface Exclude {
5375
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
5376
+ }
5377
+
5378
+ export namespace Exclude {
5379
+ export interface CustomFieldFilter {
5380
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
5381
+
5382
+ key: string;
5383
+
5384
+ value: string;
5385
+ }
5386
+ }
5387
+ }
3655
5388
  }
3656
5389
 
3657
5390
  export interface UpdateRecurringCommit {
@@ -3775,6 +5508,11 @@ export namespace ContractEditParams {
3775
5508
 
3776
5509
  export namespace UpdateSpendThresholdConfiguration {
3777
5510
  export interface DiscountConfiguration {
5511
+ /**
5512
+ * Update the discount cap. Set to null to remove an existing cap.
5513
+ */
5514
+ cap?: DiscountConfiguration.Cap | null;
5515
+
3778
5516
  /**
3779
5517
  * The fraction of the original amount that the customer pays after applying the
3780
5518
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3782,6 +5520,23 @@ export namespace ContractEditParams {
3782
5520
  */
3783
5521
  payment_fraction?: number | null;
3784
5522
  }
5523
+
5524
+ export namespace DiscountConfiguration {
5525
+ /**
5526
+ * Update the discount cap. Set to null to remove an existing cap.
5527
+ */
5528
+ export interface Cap {
5529
+ /**
5530
+ * Accumulated spend ceiling above which the discount stops applying.
5531
+ */
5532
+ amount: number;
5533
+
5534
+ /**
5535
+ * Alias of the spend tracker this cap is measured against.
5536
+ */
5537
+ spend_tracker_alias: string;
5538
+ }
5539
+ }
3785
5540
  }
3786
5541
 
3787
5542
  export interface UpdateSubscription {