@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
@@ -373,6 +373,47 @@ export declare class Contracts extends APIResource {
373
373
  * ```
374
374
  */
375
375
  getNetBalance(body: ContractGetNetBalanceParams, options?: RequestOptions): APIPromise<ContractGetNetBalanceResponse>;
376
+ /**
377
+ * Get the history of subscription seats schedule over time for a given
378
+ * `subscription_id`. This endpoint provides information about seat assignments and
379
+ * total quantities for different time periods, allowing you to track how seat
380
+ * assignments have changed over time.
381
+ *
382
+ * ### Use this endpoint to:
383
+ *
384
+ * - Track changes to seat assignments over time
385
+ * - Get seat schedule for a specific date using the `covering_date` parameter
386
+ * - Get seat schedule history with optional date range filtering using
387
+ * `starting_at` and `ending_before`
388
+ *
389
+ * ### Key response fields:
390
+ *
391
+ * - data: array of seat schedule entries with time periods, quantity, and
392
+ * assignments
393
+ * - next_page: cursor for pagination to retrieve additional results
394
+ *
395
+ * ### Usage guidelines:
396
+ *
397
+ * - Use `covering_date` to get the active seats for a specific point in time.
398
+ * `covering_date` cannot be used with `starting_at` or `ending_before`.
399
+ * - Use `starting_at` and `ending_before` to filter results by time range.
400
+ * `starting_at` and `ending_before` cannot be used with `covering_date`.
401
+ * - Maximum limit is 10 seat schedule entries per request
402
+ * - Results are ordered by `starting_at` timestamp
403
+ *
404
+ * @example
405
+ * ```ts
406
+ * const response =
407
+ * await client.v1.contracts.getSubscriptionSeatsHistory({
408
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
409
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
410
+ * subscription_id: '1a824d53-bde6-4d82-96d7-6347ff227d5c',
411
+ * covering_date: '2024-01-15T00:00:00.000Z',
412
+ * limit: 10,
413
+ * });
414
+ * ```
415
+ */
416
+ getSubscriptionSeatsHistory(body: ContractGetSubscriptionSeatsHistoryParams, options?: RequestOptions): APIPromise<ContractGetSubscriptionSeatsHistoryResponse>;
376
417
  /**
377
418
  * Retrieve a comprehensive view of all available balances (commits and credits)
378
419
  * for a customer. This endpoint provides real-time visibility into prepaid funds,
@@ -599,7 +640,415 @@ export declare class Contracts extends APIResource {
599
640
  }
600
641
  export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
601
642
  export interface ContractCreateResponse {
602
- data: Shared.ID;
643
+ data: ContractCreateResponse.Data;
644
+ }
645
+ export declare namespace ContractCreateResponse {
646
+ interface Data {
647
+ id: string;
648
+ /**
649
+ * The created contract.
650
+ */
651
+ contract?: Data.Contract;
652
+ }
653
+ namespace Data {
654
+ /**
655
+ * The created contract.
656
+ */
657
+ interface Contract {
658
+ id: string;
659
+ commits: Array<Shared.Commit>;
660
+ created_at: string;
661
+ created_by: string;
662
+ customer_id: string;
663
+ overrides: Array<Shared.Override>;
664
+ scheduled_charges: Array<Shared.ScheduledCharge>;
665
+ starting_at: string;
666
+ transitions: Array<Contract.Transition>;
667
+ usage_filter: Array<Contract.UsageFilter>;
668
+ usage_statement_schedule: Contract.UsageStatementSchedule;
669
+ credits?: Array<Shared.Credit>;
670
+ /**
671
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
672
+ */
673
+ custom_fields?: {
674
+ [key: string]: string;
675
+ };
676
+ /**
677
+ * The billing provider configuration associated with the contract.
678
+ */
679
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
680
+ ending_before?: string;
681
+ /**
682
+ * Indicates whether there are more items than the limit for this endpoint. Use the
683
+ * respective list endpoints to get the full lists.
684
+ */
685
+ has_more?: Contract.HasMore;
686
+ /**
687
+ * Either a **parent** configuration with a list of children or a **child**
688
+ * configuration with a single parent.
689
+ */
690
+ hierarchy_configuration?: Shared.HierarchyConfiguration;
691
+ /**
692
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
693
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
694
+ * each multiplier; the one with the lowest priority value will be prioritized
695
+ * first.
696
+ */
697
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
698
+ name?: string;
699
+ net_payment_terms_days?: number;
700
+ /**
701
+ * ID of the package this contract was created from, if applicable.
702
+ */
703
+ package_id?: string;
704
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
705
+ rate_card_id?: string;
706
+ recurring_commits?: Array<Contract.RecurringCommit>;
707
+ recurring_credits?: Array<Contract.RecurringCredit>;
708
+ /**
709
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
710
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
711
+ * `ending_before` date for consolidation to occur. This field cannot be modified
712
+ * after a Contract has been created. If this field is omitted, charges will appear
713
+ * on a separate invoice from usage charges.
714
+ */
715
+ scheduled_charges_on_usage_invoices?: 'ALL';
716
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
717
+ /**
718
+ * List of subscriptions on the contract.
719
+ */
720
+ subscriptions?: Array<Shared.Subscription>;
721
+ /**
722
+ * Optional uniqueness key to prevent duplicate contract creations.
723
+ */
724
+ uniqueness_key?: string;
725
+ }
726
+ namespace Contract {
727
+ interface Transition {
728
+ from_contract_id: string;
729
+ to_contract_id: string;
730
+ type: 'SUPERSEDE' | 'RENEWAL';
731
+ }
732
+ interface UsageFilter {
733
+ group_key: string;
734
+ group_values: Array<string>;
735
+ starting_at: string;
736
+ ending_before?: string;
737
+ }
738
+ interface UsageStatementSchedule {
739
+ /**
740
+ * Contract usage statements follow a selected cadence based on this date.
741
+ */
742
+ billing_anchor_date: string;
743
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
744
+ }
745
+ /**
746
+ * The billing provider configuration associated with the contract.
747
+ */
748
+ interface CustomerBillingProviderConfiguration {
749
+ id?: string;
750
+ billing_provider?: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace' | 'metronome';
751
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
752
+ }
753
+ /**
754
+ * Indicates whether there are more items than the limit for this endpoint. Use the
755
+ * respective list endpoints to get the full lists.
756
+ */
757
+ interface HasMore {
758
+ /**
759
+ * Whether there are more commits on this contract than the limit for this
760
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
761
+ * of commits.
762
+ */
763
+ commits: boolean;
764
+ /**
765
+ * Whether there are more credits on this contract than the limit for this
766
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
767
+ * of credits.
768
+ */
769
+ credits: boolean;
770
+ }
771
+ interface RecurringCommit {
772
+ id: string;
773
+ /**
774
+ * The amount of commit to grant.
775
+ */
776
+ access_amount: RecurringCommit.AccessAmount;
777
+ /**
778
+ * The amount of time the created commits will be valid for
779
+ */
780
+ commit_duration: RecurringCommit.CommitDuration;
781
+ /**
782
+ * Will be passed down to the individual commits
783
+ */
784
+ priority: number;
785
+ product: RecurringCommit.Product;
786
+ /**
787
+ * Whether the created commits will use the commit rate or list rate
788
+ */
789
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
790
+ /**
791
+ * Determines the start time for the first commit
792
+ */
793
+ starting_at: string;
794
+ /**
795
+ * Will be passed down to the individual commits
796
+ */
797
+ applicable_product_ids?: Array<string>;
798
+ /**
799
+ * Will be passed down to the individual commits
800
+ */
801
+ applicable_product_tags?: Array<string>;
802
+ contract?: RecurringCommit.Contract;
803
+ /**
804
+ * Will be passed down to the individual commits
805
+ */
806
+ description?: string;
807
+ /**
808
+ * Determines when the contract will stop creating recurring commits. Optional
809
+ */
810
+ ending_before?: string;
811
+ /**
812
+ * Optional configuration for recurring commit/credit hierarchy access control
813
+ */
814
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
815
+ /**
816
+ * The amount the customer should be billed for the commit. Not required.
817
+ */
818
+ invoice_amount?: RecurringCommit.InvoiceAmount;
819
+ /**
820
+ * Displayed on invoices. Will be passed through to the individual commits
821
+ */
822
+ name?: string;
823
+ /**
824
+ * Will be passed down to the individual commits
825
+ */
826
+ netsuite_sales_order_id?: string;
827
+ /**
828
+ * Determines whether the first and last commit will be prorated. If not provided,
829
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
830
+ */
831
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
832
+ /**
833
+ * Rounding configuration for prorated recurring commit amounts.
834
+ */
835
+ proration_rounding?: RecurringCommit.ProrationRounding | null;
836
+ /**
837
+ * The frequency at which the recurring commits will be created. If not provided: -
838
+ * The commits will be created on the usage invoice frequency. If provided: - The
839
+ * period defined in the duration will correspond to this frequency. - Commits will
840
+ * be created aligned with the recurring commit's starting_at rather than the usage
841
+ * invoice dates.
842
+ */
843
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
844
+ /**
845
+ * Will be passed down to the individual commits. This controls how much of an
846
+ * individual unexpired commit will roll over upon contract transition. Must be
847
+ * between 0 and 1.
848
+ */
849
+ rollover_fraction?: number;
850
+ /**
851
+ * List of filters that determine what kind of customer usage draws down a commit
852
+ * or credit. A customer's usage needs to meet the condition of at least one of the
853
+ * specifiers to contribute to a commit's or credit's drawdown.
854
+ */
855
+ specifiers?: Array<Shared.CommitSpecifier>;
856
+ /**
857
+ * Attach a subscription to the recurring commit/credit.
858
+ */
859
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
860
+ }
861
+ namespace RecurringCommit {
862
+ /**
863
+ * The amount of commit to grant.
864
+ */
865
+ interface AccessAmount {
866
+ credit_type_id: string;
867
+ unit_price: number;
868
+ quantity?: number;
869
+ }
870
+ /**
871
+ * The amount of time the created commits will be valid for
872
+ */
873
+ interface CommitDuration {
874
+ value: number;
875
+ unit?: 'PERIODS';
876
+ }
877
+ interface Product {
878
+ id: string;
879
+ name: string;
880
+ }
881
+ interface Contract {
882
+ id: string;
883
+ }
884
+ /**
885
+ * The amount the customer should be billed for the commit. Not required.
886
+ */
887
+ interface InvoiceAmount {
888
+ credit_type_id: string;
889
+ quantity: number;
890
+ unit_price: number;
891
+ }
892
+ /**
893
+ * Rounding configuration for prorated recurring commit amounts.
894
+ */
895
+ interface ProrationRounding {
896
+ access?: ProrationRounding.Access;
897
+ invoice?: ProrationRounding.Invoice;
898
+ }
899
+ namespace ProrationRounding {
900
+ interface Access {
901
+ /**
902
+ * Number of decimal places to round to. Applied directly to the stored monetary
903
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
904
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
905
+ * dollar).
906
+ */
907
+ decimal_places: number;
908
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
909
+ }
910
+ interface Invoice {
911
+ /**
912
+ * Number of decimal places to round to. Applied directly to the stored monetary
913
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
914
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
915
+ * dollar).
916
+ */
917
+ decimal_places: number;
918
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
919
+ }
920
+ }
921
+ }
922
+ interface RecurringCredit {
923
+ id: string;
924
+ /**
925
+ * The amount of commit to grant.
926
+ */
927
+ access_amount: RecurringCredit.AccessAmount;
928
+ /**
929
+ * The amount of time the created commits will be valid for
930
+ */
931
+ commit_duration: RecurringCredit.CommitDuration;
932
+ /**
933
+ * Will be passed down to the individual commits
934
+ */
935
+ priority: number;
936
+ product: RecurringCredit.Product;
937
+ /**
938
+ * Whether the created commits will use the commit rate or list rate
939
+ */
940
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
941
+ /**
942
+ * Determines the start time for the first commit
943
+ */
944
+ starting_at: string;
945
+ /**
946
+ * Will be passed down to the individual commits
947
+ */
948
+ applicable_product_ids?: Array<string>;
949
+ /**
950
+ * Will be passed down to the individual commits
951
+ */
952
+ applicable_product_tags?: Array<string>;
953
+ contract?: RecurringCredit.Contract;
954
+ /**
955
+ * Will be passed down to the individual commits
956
+ */
957
+ description?: string;
958
+ /**
959
+ * Determines when the contract will stop creating recurring commits. Optional
960
+ */
961
+ ending_before?: string;
962
+ /**
963
+ * Optional configuration for recurring commit/credit hierarchy access control
964
+ */
965
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
966
+ /**
967
+ * Displayed on invoices. Will be passed through to the individual commits
968
+ */
969
+ name?: string;
970
+ /**
971
+ * Will be passed down to the individual commits
972
+ */
973
+ netsuite_sales_order_id?: string;
974
+ /**
975
+ * Determines whether the first and last commit will be prorated. If not provided,
976
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
977
+ */
978
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
979
+ /**
980
+ * Rounding configuration for prorated recurring credit amounts.
981
+ */
982
+ proration_rounding?: RecurringCredit.ProrationRounding | null;
983
+ /**
984
+ * The frequency at which the recurring commits will be created. If not provided: -
985
+ * The commits will be created on the usage invoice frequency. If provided: - The
986
+ * period defined in the duration will correspond to this frequency. - Commits will
987
+ * be created aligned with the recurring commit's starting_at rather than the usage
988
+ * invoice dates.
989
+ */
990
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
991
+ /**
992
+ * Will be passed down to the individual commits. This controls how much of an
993
+ * individual unexpired commit will roll over upon contract transition. Must be
994
+ * between 0 and 1.
995
+ */
996
+ rollover_fraction?: number;
997
+ /**
998
+ * List of filters that determine what kind of customer usage draws down a commit
999
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1000
+ * specifiers to contribute to a commit's or credit's drawdown.
1001
+ */
1002
+ specifiers?: Array<Shared.CommitSpecifier>;
1003
+ /**
1004
+ * Attach a subscription to the recurring commit/credit.
1005
+ */
1006
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1007
+ }
1008
+ namespace RecurringCredit {
1009
+ /**
1010
+ * The amount of commit to grant.
1011
+ */
1012
+ interface AccessAmount {
1013
+ credit_type_id: string;
1014
+ unit_price: number;
1015
+ quantity?: number;
1016
+ }
1017
+ /**
1018
+ * The amount of time the created commits will be valid for
1019
+ */
1020
+ interface CommitDuration {
1021
+ value: number;
1022
+ unit?: 'PERIODS';
1023
+ }
1024
+ interface Product {
1025
+ id: string;
1026
+ name: string;
1027
+ }
1028
+ interface Contract {
1029
+ id: string;
1030
+ }
1031
+ /**
1032
+ * Rounding configuration for prorated recurring credit amounts.
1033
+ */
1034
+ interface ProrationRounding {
1035
+ access?: ProrationRounding.Access;
1036
+ }
1037
+ namespace ProrationRounding {
1038
+ interface Access {
1039
+ /**
1040
+ * Number of decimal places to round to. Applied directly to the stored monetary
1041
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1042
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1043
+ * dollar).
1044
+ */
1045
+ decimal_places: number;
1046
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1047
+ }
1048
+ }
1049
+ }
1050
+ }
1051
+ }
603
1052
  }
604
1053
  export interface ContractRetrieveResponse {
605
1054
  data: Shared.Contract;
@@ -633,6 +1082,33 @@ export declare namespace ContractGetNetBalanceResponse {
633
1082
  credit_type_id: string;
634
1083
  }
635
1084
  }
1085
+ export interface ContractGetSubscriptionSeatsHistoryResponse {
1086
+ data: Array<ContractGetSubscriptionSeatsHistoryResponse.Data>;
1087
+ /**
1088
+ * Cursor for the next page of results
1089
+ */
1090
+ next_page: string | null;
1091
+ }
1092
+ export declare namespace ContractGetSubscriptionSeatsHistoryResponse {
1093
+ interface Data {
1094
+ /**
1095
+ * Array of seat IDs that are assigned in this period
1096
+ */
1097
+ assigned_seat_ids: Array<string>;
1098
+ /**
1099
+ * The end time of this seat schedule period (null if ongoing)
1100
+ */
1101
+ ending_before: string | null;
1102
+ /**
1103
+ * The start time of this seat schedule period
1104
+ */
1105
+ starting_at: string;
1106
+ /**
1107
+ * Total number of assigned and unassigned seats in this period
1108
+ */
1109
+ total_quantity: number;
1110
+ }
1111
+ }
636
1112
  export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
637
1113
  export interface ContractListSeatBalancesResponse {
638
1114
  data: Array<ContractListSeatBalancesResponse.Data>;
@@ -912,6 +1388,11 @@ export interface ContractCreateParams {
912
1388
  */
913
1389
  scheduled_charges_on_usage_invoices?: 'ALL';
914
1390
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1391
+ /**
1392
+ * Spend trackers to attach to this contract. Aliases must be unique within a
1393
+ * contract.
1394
+ */
1395
+ spend_trackers?: Array<ContractCreateParams.SpendTracker>;
915
1396
  /**
916
1397
  * Optional list of
917
1398
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1024,6 +1505,10 @@ export declare namespace ContractCreateParams {
1024
1505
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
1025
1506
  */
1026
1507
  specifiers?: Array<Shared.CommitSpecifierInput>;
1508
+ /**
1509
+ * Optional attributes for spend tracker integration. Immutable after creation.
1510
+ */
1511
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
1027
1512
  /**
1028
1513
  * A temporary ID for the commit that can be used to reference the commit for
1029
1514
  * commit specific overrides.
@@ -1144,6 +1629,16 @@ export declare namespace ContractCreateParams {
1144
1629
  unit_price?: number;
1145
1630
  }
1146
1631
  }
1632
+ /**
1633
+ * Optional attributes for spend tracker integration. Immutable after creation.
1634
+ */
1635
+ interface SpendTrackerAttributes {
1636
+ /**
1637
+ * If true, this commit will be included in spend trackers with discounted set to
1638
+ * DISCOUNTED_ONLY
1639
+ */
1640
+ counts_as_discounted: boolean;
1641
+ }
1147
1642
  }
1148
1643
  interface Credit {
1149
1644
  /**
@@ -1392,9 +1887,10 @@ export declare namespace ContractCreateParams {
1392
1887
  entitled?: boolean;
1393
1888
  /**
1394
1889
  * Indicates whether the override should only apply to commits. Defaults to
1395
- * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
1396
- * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
1397
- * apply when consuming any prepaid or postpaid commit.
1890
+ * `false`. If `true` you can specify relevant commits in `override_specifiers` by
1891
+ * passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
1892
+ * you do not specify any of these fields, the override will apply when consuming
1893
+ * any prepaid commit, postpaid commit, or credit
1398
1894
  */
1399
1895
  is_commit_specific?: boolean;
1400
1896
  /**
@@ -1439,6 +1935,14 @@ export declare namespace ContractCreateParams {
1439
1935
  }
1440
1936
  namespace Override {
1441
1937
  interface OverrideSpecifier {
1938
+ /**
1939
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1940
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1941
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
1942
+ * `recurring_commit_ids` If provided, the override will apply to any specified
1943
+ * commit, credit, recurring commit or recurring credit IDs.
1944
+ */
1945
+ any_commit_or_credit_ids?: Array<string>;
1442
1946
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1443
1947
  /**
1444
1948
  * Can only be used for commit specific overrides. Must be used in conjunction with
@@ -1600,6 +2104,10 @@ export declare namespace ContractCreateParams {
1600
2104
  * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1601
2105
  */
1602
2106
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2107
+ /**
2108
+ * Optional rounding configuration for prorated recurring commit amounts.
2109
+ */
2110
+ proration_rounding?: RecurringCommit.ProrationRounding;
1603
2111
  /**
1604
2112
  * Whether the created commits will use the commit rate or list rate
1605
2113
  */
@@ -1611,7 +2119,7 @@ export declare namespace ContractCreateParams {
1611
2119
  * be created aligned with the recurring commit's starting_at rather than the usage
1612
2120
  * invoice dates.
1613
2121
  */
1614
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2122
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1615
2123
  /**
1616
2124
  * Will be passed down to the individual commits. This controls how much of an
1617
2125
  * individual unexpired commit will roll over upon contract transition. Must be
@@ -1665,6 +2173,35 @@ export declare namespace ContractCreateParams {
1665
2173
  quantity: number;
1666
2174
  unit_price: number;
1667
2175
  }
2176
+ /**
2177
+ * Optional rounding configuration for prorated recurring commit amounts.
2178
+ */
2179
+ interface ProrationRounding {
2180
+ access?: ProrationRounding.Access;
2181
+ invoice?: ProrationRounding.Invoice;
2182
+ }
2183
+ namespace ProrationRounding {
2184
+ interface Access {
2185
+ /**
2186
+ * Number of decimal places to round to. Applied directly to the stored monetary
2187
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2188
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2189
+ * dollar).
2190
+ */
2191
+ decimal_places: number;
2192
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2193
+ }
2194
+ interface Invoice {
2195
+ /**
2196
+ * Number of decimal places to round to. Applied directly to the stored monetary
2197
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2198
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2199
+ * dollar).
2200
+ */
2201
+ decimal_places: number;
2202
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2203
+ }
2204
+ }
1668
2205
  /**
1669
2206
  * Attach a subscription to the recurring commit/credit.
1670
2207
  */
@@ -1742,6 +2279,10 @@ export declare namespace ContractCreateParams {
1742
2279
  * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1743
2280
  */
1744
2281
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2282
+ /**
2283
+ * Optional rounding configuration for prorated recurring credit amounts.
2284
+ */
2285
+ proration_rounding?: RecurringCredit.ProrationRounding;
1745
2286
  /**
1746
2287
  * Whether the created commits will use the commit rate or list rate
1747
2288
  */
@@ -1753,7 +2294,7 @@ export declare namespace ContractCreateParams {
1753
2294
  * be created aligned with the recurring commit's starting_at rather than the usage
1754
2295
  * invoice dates.
1755
2296
  */
1756
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2297
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1757
2298
  /**
1758
2299
  * Will be passed down to the individual commits. This controls how much of an
1759
2300
  * individual unexpired commit will roll over upon contract transition. Must be
@@ -1799,6 +2340,24 @@ export declare namespace ContractCreateParams {
1799
2340
  value: number;
1800
2341
  unit?: 'PERIODS';
1801
2342
  }
2343
+ /**
2344
+ * Optional rounding configuration for prorated recurring credit amounts.
2345
+ */
2346
+ interface ProrationRounding {
2347
+ access?: ProrationRounding.Access;
2348
+ }
2349
+ namespace ProrationRounding {
2350
+ interface Access {
2351
+ /**
2352
+ * Number of decimal places to round to. Applied directly to the stored monetary
2353
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2354
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2355
+ * dollar).
2356
+ */
2357
+ decimal_places: number;
2358
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2359
+ }
2360
+ }
1802
2361
  /**
1803
2362
  * Attach a subscription to the recurring commit/credit.
1804
2363
  */
@@ -1982,10 +2541,30 @@ export declare namespace ContractCreateParams {
1982
2541
  }
1983
2542
  }
1984
2543
  }
2544
+ interface SpendTracker {
2545
+ /**
2546
+ * Human-readable identifier, unique per contract.
2547
+ */
2548
+ alias: string;
2549
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
2550
+ credit_type_id: string;
2551
+ reset_frequency: 'BILLING_PERIOD';
2552
+ }
2553
+ namespace SpendTracker {
2554
+ interface ApplicableSpendSpecifier {
2555
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
2556
+ spend_type: 'COMMIT_PURCHASE';
2557
+ /**
2558
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
2559
+ */
2560
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
2561
+ }
2562
+ }
1985
2563
  interface Subscription {
1986
2564
  collection_schedule: 'ADVANCE' | 'ARREARS';
1987
2565
  proration: Subscription.Proration;
1988
2566
  subscription_rate: Subscription.SubscriptionRate;
2567
+ billing_cycle_config?: Subscription.BillingCycleConfig;
1989
2568
  /**
1990
2569
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1991
2570
  */
@@ -2042,6 +2621,19 @@ export declare namespace ContractCreateParams {
2042
2621
  * Indicates if the partial period will be prorated or charged a full amount.
2043
2622
  */
2044
2623
  is_prorated?: boolean;
2624
+ rounding?: Proration.Rounding;
2625
+ }
2626
+ namespace Proration {
2627
+ interface Rounding {
2628
+ /**
2629
+ * Number of decimal places to round to. Applied directly to the stored monetary
2630
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2631
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2632
+ * dollar).
2633
+ */
2634
+ decimal_places: number;
2635
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2636
+ }
2045
2637
  }
2046
2638
  interface SubscriptionRate {
2047
2639
  /**
@@ -2054,6 +2646,18 @@ export declare namespace ContractCreateParams {
2054
2646
  */
2055
2647
  product_id: string;
2056
2648
  }
2649
+ interface BillingCycleConfig {
2650
+ /**
2651
+ * The date to anchor the billing cycle to. If omitted, defaults to the contract's
2652
+ * usage invoice billing cycle anchor date.
2653
+ */
2654
+ anchor_date?: string;
2655
+ /**
2656
+ * Controls whether this subscription consolidates onto usage invoices or gets its
2657
+ * own scheduled invoice. Defaults to ON_USAGE_INVOICE if omitted.
2658
+ */
2659
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
2660
+ }
2057
2661
  interface SeatConfig {
2058
2662
  /**
2059
2663
  * The initial assigned seats on this subscription.
@@ -2315,6 +2919,10 @@ export declare namespace ContractAmendParams {
2315
2919
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
2316
2920
  */
2317
2921
  specifiers?: Array<Shared.CommitSpecifierInput>;
2922
+ /**
2923
+ * Optional attributes for spend tracker integration. Immutable after creation.
2924
+ */
2925
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
2318
2926
  /**
2319
2927
  * A temporary ID for the commit that can be used to reference the commit for
2320
2928
  * commit specific overrides.
@@ -2435,6 +3043,16 @@ export declare namespace ContractAmendParams {
2435
3043
  unit_price?: number;
2436
3044
  }
2437
3045
  }
3046
+ /**
3047
+ * Optional attributes for spend tracker integration. Immutable after creation.
3048
+ */
3049
+ interface SpendTrackerAttributes {
3050
+ /**
3051
+ * If true, this commit will be included in spend trackers with discounted set to
3052
+ * DISCOUNTED_ONLY
3053
+ */
3054
+ counts_as_discounted: boolean;
3055
+ }
2438
3056
  }
2439
3057
  interface Credit {
2440
3058
  /**
@@ -2642,9 +3260,10 @@ export declare namespace ContractAmendParams {
2642
3260
  entitled?: boolean;
2643
3261
  /**
2644
3262
  * Indicates whether the override should only apply to commits. Defaults to
2645
- * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
2646
- * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
2647
- * apply when consuming any prepaid or postpaid commit.
3263
+ * `false`. If `true` you can specify relevant commits in `override_specifiers` by
3264
+ * passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
3265
+ * you do not specify any of these fields, the override will apply when consuming
3266
+ * any prepaid commit, postpaid commit, or credit
2648
3267
  */
2649
3268
  is_commit_specific?: boolean;
2650
3269
  /**
@@ -2689,6 +3308,14 @@ export declare namespace ContractAmendParams {
2689
3308
  }
2690
3309
  namespace Override {
2691
3310
  interface OverrideSpecifier {
3311
+ /**
3312
+ * Can only be used for commit specific overrides. Must be used in conjunction with
3313
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
3314
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
3315
+ * `recurring_commit_ids` If provided, the override will apply to any specified
3316
+ * commit, credit, recurring commit or recurring credit IDs.
3317
+ */
3318
+ any_commit_or_credit_ids?: Array<string>;
2692
3319
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2693
3320
  /**
2694
3321
  * Can only be used for commit specific overrides. Must be used in conjunction with
@@ -3019,6 +3646,38 @@ export interface ContractGetNetBalanceParams {
3019
3646
  */
3020
3647
  invoice_inclusion_mode?: 'FINALIZED' | 'FINALIZED_AND_DRAFT';
3021
3648
  }
3649
+ export interface ContractGetSubscriptionSeatsHistoryParams {
3650
+ contract_id: string;
3651
+ customer_id: string;
3652
+ subscription_id: string;
3653
+ /**
3654
+ * Get the seats history segment for the covering date. Cannot be used with
3655
+ * `starting_at` or `ending_before`.
3656
+ */
3657
+ covering_date?: string | null;
3658
+ /**
3659
+ * Cursor for pagination. Use the value from the `next_page` field of the previous
3660
+ * response to retrieve the next page of results.
3661
+ */
3662
+ cursor?: string | null;
3663
+ /**
3664
+ * Include seats history segments that are active at or before this timestamp. Use
3665
+ * with `starting_at` to get a specific time range. If not set, there's no upper
3666
+ * bound.
3667
+ */
3668
+ ending_before?: string | null;
3669
+ /**
3670
+ * Maximum number of seat schedule entries to return. Defaults to 10. Required
3671
+ * range: 1 <= x <= 10.
3672
+ */
3673
+ limit?: number | null;
3674
+ /**
3675
+ * Include seats history segments that are active at or after this timestamp. Use
3676
+ * with `ending_before` to get a specific time range. If not set, there's no lower
3677
+ * bound.
3678
+ */
3679
+ starting_at?: string | null;
3680
+ }
3022
3681
  export interface ContractListBalancesParams extends BodyCursorPageParams {
3023
3682
  customer_id: string;
3024
3683
  id?: string;
@@ -3103,6 +3762,11 @@ export interface ContractListSeatBalancesParams {
3103
3762
  * Optional filter to only include specific seats.
3104
3763
  */
3105
3764
  seat_ids?: Array<string>;
3765
+ /**
3766
+ * When true, any seat_ids not found in contract subscriptions will be silently
3767
+ * omitted from the response instead of returning a 400 error.
3768
+ */
3769
+ skip_missing_seat_ids?: boolean;
3106
3770
  /**
3107
3771
  * Include only commits or credits with access effective on or after this date
3108
3772
  * (cannot be used with covering_date).
@@ -3269,7 +3933,7 @@ export interface ContractUpdateEndDateParams {
3269
3933
  ending_before?: string;
3270
3934
  }
3271
3935
  export declare namespace Contracts {
3272
- export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractAmendResponse as ContractAmendResponse, type ContractArchiveResponse as ContractArchiveResponse, type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse, type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse, type ContractListBalancesResponse as ContractListBalancesResponse, type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse, type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse, type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse, type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse, type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse, type ContractListBalancesResponsesBodyCursorPage as ContractListBalancesResponsesBodyCursorPage, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractAddManualBalanceEntryParams as ContractAddManualBalanceEntryParams, type ContractAmendParams as ContractAmendParams, type ContractArchiveParams as ContractArchiveParams, type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams, type ContractGetNetBalanceParams as ContractGetNetBalanceParams, type ContractListBalancesParams as ContractListBalancesParams, type ContractListSeatBalancesParams as ContractListSeatBalancesParams, type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
3936
+ export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractAmendResponse as ContractAmendResponse, type ContractArchiveResponse as ContractArchiveResponse, type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse, type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse, type ContractGetSubscriptionSeatsHistoryResponse as ContractGetSubscriptionSeatsHistoryResponse, type ContractListBalancesResponse as ContractListBalancesResponse, type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse, type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse, type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse, type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse, type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse, type ContractListBalancesResponsesBodyCursorPage as ContractListBalancesResponsesBodyCursorPage, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractAddManualBalanceEntryParams as ContractAddManualBalanceEntryParams, type ContractAmendParams as ContractAmendParams, type ContractArchiveParams as ContractArchiveParams, type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams, type ContractGetNetBalanceParams as ContractGetNetBalanceParams, type ContractGetSubscriptionSeatsHistoryParams as ContractGetSubscriptionSeatsHistoryParams, type ContractListBalancesParams as ContractListBalancesParams, type ContractListSeatBalancesParams as ContractListSeatBalancesParams, type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
3273
3937
  export { Products as Products, type ProductListItemState as ProductListItemState, type QuantityConversion as QuantityConversion, type QuantityRounding as QuantityRounding, type ProductCreateResponse as ProductCreateResponse, type ProductRetrieveResponse as ProductRetrieveResponse, type ProductUpdateResponse as ProductUpdateResponse, type ProductListResponse as ProductListResponse, type ProductArchiveResponse as ProductArchiveResponse, type ProductListResponsesCursorPage as ProductListResponsesCursorPage, type ProductCreateParams as ProductCreateParams, type ProductRetrieveParams as ProductRetrieveParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, type ProductArchiveParams as ProductArchiveParams, };
3274
3938
  export { RateCards as RateCards, type RateCardCreateResponse as RateCardCreateResponse, type RateCardRetrieveResponse as RateCardRetrieveResponse, type RateCardUpdateResponse as RateCardUpdateResponse, type RateCardListResponse as RateCardListResponse, type RateCardArchiveResponse as RateCardArchiveResponse, type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse, type RateCardListResponsesCursorPage as RateCardListResponsesCursorPage, type RateCardCreateParams as RateCardCreateParams, type RateCardRetrieveParams as RateCardRetrieveParams, type RateCardUpdateParams as RateCardUpdateParams, type RateCardListParams as RateCardListParams, type RateCardArchiveParams as RateCardArchiveParams, type RateCardRetrieveRateScheduleParams as RateCardRetrieveRateScheduleParams, };
3275
3939
  export { NamedSchedules as NamedSchedules, type NamedScheduleRetrieveResponse as NamedScheduleRetrieveResponse, type NamedScheduleRetrieveParams as NamedScheduleRetrieveParams, type NamedScheduleUpdateParams as NamedScheduleUpdateParams, };