@metronome/sdk 3.5.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 (307) hide show
  1. package/CHANGELOG.md +78 -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/bin/cli +12 -5
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts.map +1 -1
  11. package/client.js +11 -0
  12. package/client.js.map +1 -1
  13. package/client.mjs +11 -0
  14. package/client.mjs.map +1 -1
  15. package/core/api-promise.d.mts.map +1 -1
  16. package/core/api-promise.d.ts.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.mjs.map +1 -1
  19. package/core/pagination.d.mts.map +1 -1
  20. package/core/pagination.d.ts.map +1 -1
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/resource.d.mts.map +1 -1
  23. package/core/resource.d.ts.map +1 -1
  24. package/core/uploads.d.mts.map +1 -1
  25. package/core/uploads.d.ts.map +1 -1
  26. package/core/uploads.mjs.map +1 -1
  27. package/error.d.mts +1 -0
  28. package/error.d.mts.map +1 -1
  29. package/error.d.ts +1 -0
  30. package/error.d.ts.map +1 -1
  31. package/error.mjs +1 -0
  32. package/error.mjs.map +1 -1
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts.map +1 -1
  35. package/index.mjs.map +1 -1
  36. package/internal/detect-platform.mjs.map +1 -1
  37. package/internal/headers.mjs.map +1 -1
  38. package/internal/parse.d.mts.map +1 -1
  39. package/internal/parse.d.ts.map +1 -1
  40. package/internal/parse.mjs.map +1 -1
  41. package/internal/qs/formats.d.mts.map +1 -1
  42. package/internal/qs/formats.d.ts.map +1 -1
  43. package/internal/qs/index.d.mts +2 -2
  44. package/internal/qs/index.d.mts.map +1 -1
  45. package/internal/qs/index.d.ts +2 -2
  46. package/internal/qs/index.d.ts.map +1 -1
  47. package/internal/qs/index.mjs.map +1 -1
  48. package/internal/qs/stringify.d.mts.map +1 -1
  49. package/internal/qs/stringify.d.ts.map +1 -1
  50. package/internal/qs/stringify.mjs.map +1 -1
  51. package/internal/qs/utils.d.mts.map +1 -1
  52. package/internal/qs/utils.d.ts.map +1 -1
  53. package/internal/qs/utils.mjs.map +1 -1
  54. package/internal/request-options.d.mts.map +1 -1
  55. package/internal/request-options.d.ts.map +1 -1
  56. package/internal/shims.d.mts +6 -0
  57. package/internal/shims.d.mts.map +1 -1
  58. package/internal/shims.d.ts +6 -0
  59. package/internal/shims.d.ts.map +1 -1
  60. package/internal/to-file.d.mts.map +1 -1
  61. package/internal/to-file.d.ts.map +1 -1
  62. package/internal/to-file.mjs.map +1 -1
  63. package/internal/types.d.mts +10 -10
  64. package/internal/types.d.mts.map +1 -1
  65. package/internal/types.d.ts +10 -10
  66. package/internal/types.d.ts.map +1 -1
  67. package/internal/uploads.d.mts.map +1 -1
  68. package/internal/uploads.d.ts.map +1 -1
  69. package/internal/uploads.mjs.map +1 -1
  70. package/internal/utils/base64.mjs.map +1 -1
  71. package/internal/utils/log.d.mts.map +1 -1
  72. package/internal/utils/log.d.ts.map +1 -1
  73. package/internal/utils/log.js +2 -0
  74. package/internal/utils/log.js.map +1 -1
  75. package/internal/utils/log.mjs +2 -0
  76. package/internal/utils/log.mjs.map +1 -1
  77. package/internal/utils/path.mjs.map +1 -1
  78. package/internal/utils/query.mjs.map +1 -1
  79. package/internal/utils/values.mjs.map +1 -1
  80. package/internal/utils.d.mts.map +1 -1
  81. package/internal/utils.d.ts.map +1 -1
  82. package/internal/utils.mjs.map +1 -1
  83. package/package.json +1 -1
  84. package/pagination.d.mts +1 -0
  85. package/pagination.d.mts.map +1 -1
  86. package/pagination.d.ts +1 -0
  87. package/pagination.d.ts.map +1 -1
  88. package/pagination.mjs +1 -0
  89. package/pagination.mjs.map +1 -1
  90. package/resource.d.mts +1 -0
  91. package/resource.d.mts.map +1 -1
  92. package/resource.d.ts +1 -0
  93. package/resource.d.ts.map +1 -1
  94. package/resource.mjs +1 -0
  95. package/resource.mjs.map +1 -1
  96. package/resources/index.d.mts.map +1 -1
  97. package/resources/index.d.ts.map +1 -1
  98. package/resources/index.mjs.map +1 -1
  99. package/resources/shared.d.mts +321 -1
  100. package/resources/shared.d.mts.map +1 -1
  101. package/resources/shared.d.ts +321 -1
  102. package/resources/shared.d.ts.map +1 -1
  103. package/resources/v1/alerts.d.mts +1 -1
  104. package/resources/v1/alerts.d.mts.map +1 -1
  105. package/resources/v1/alerts.d.ts +1 -1
  106. package/resources/v1/alerts.d.ts.map +1 -1
  107. package/resources/v1/alerts.mjs.map +1 -1
  108. package/resources/v1/audit-logs.d.mts.map +1 -1
  109. package/resources/v1/audit-logs.d.ts.map +1 -1
  110. package/resources/v1/audit-logs.mjs.map +1 -1
  111. package/resources/v1/billable-metrics.d.mts.map +1 -1
  112. package/resources/v1/billable-metrics.d.ts.map +1 -1
  113. package/resources/v1/billable-metrics.mjs.map +1 -1
  114. package/resources/v1/contracts/contracts.d.mts +629 -143
  115. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  116. package/resources/v1/contracts/contracts.d.ts +629 -143
  117. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  118. package/resources/v1/contracts/contracts.js +47 -2
  119. package/resources/v1/contracts/contracts.js.map +1 -1
  120. package/resources/v1/contracts/contracts.mjs +47 -2
  121. package/resources/v1/contracts/contracts.mjs.map +1 -1
  122. package/resources/v1/contracts/index.d.mts +1 -1
  123. package/resources/v1/contracts/index.d.mts.map +1 -1
  124. package/resources/v1/contracts/index.d.ts +1 -1
  125. package/resources/v1/contracts/index.d.ts.map +1 -1
  126. package/resources/v1/contracts/index.js.map +1 -1
  127. package/resources/v1/contracts/index.mjs.map +1 -1
  128. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  129. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  130. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  131. package/resources/v1/contracts/products.d.mts +18 -0
  132. package/resources/v1/contracts/products.d.mts.map +1 -1
  133. package/resources/v1/contracts/products.d.ts +18 -0
  134. package/resources/v1/contracts/products.d.ts.map +1 -1
  135. package/resources/v1/contracts/products.mjs.map +1 -1
  136. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  137. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  138. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  139. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  140. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  141. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  142. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  143. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  144. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  145. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  146. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  147. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  148. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  149. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  150. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  151. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  152. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  153. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  154. package/resources/v1/contracts.d.mts.map +1 -1
  155. package/resources/v1/contracts.d.ts.map +1 -1
  156. package/resources/v1/contracts.mjs.map +1 -1
  157. package/resources/v1/credit-grants.d.mts.map +1 -1
  158. package/resources/v1/credit-grants.d.ts.map +1 -1
  159. package/resources/v1/credit-grants.mjs.map +1 -1
  160. package/resources/v1/custom-fields.d.mts.map +1 -1
  161. package/resources/v1/custom-fields.d.ts.map +1 -1
  162. package/resources/v1/custom-fields.mjs.map +1 -1
  163. package/resources/v1/customers/alerts.d.mts +1 -1
  164. package/resources/v1/customers/alerts.d.mts.map +1 -1
  165. package/resources/v1/customers/alerts.d.ts +1 -1
  166. package/resources/v1/customers/alerts.d.ts.map +1 -1
  167. package/resources/v1/customers/alerts.mjs.map +1 -1
  168. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  169. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  170. package/resources/v1/customers/billing-config.mjs.map +1 -1
  171. package/resources/v1/customers/commits.d.mts.map +1 -1
  172. package/resources/v1/customers/commits.d.ts.map +1 -1
  173. package/resources/v1/customers/commits.mjs.map +1 -1
  174. package/resources/v1/customers/credits.d.mts.map +1 -1
  175. package/resources/v1/customers/credits.d.ts.map +1 -1
  176. package/resources/v1/customers/credits.mjs.map +1 -1
  177. package/resources/v1/customers/customers.d.mts.map +1 -1
  178. package/resources/v1/customers/customers.d.ts.map +1 -1
  179. package/resources/v1/customers/customers.mjs.map +1 -1
  180. package/resources/v1/customers/index.d.mts.map +1 -1
  181. package/resources/v1/customers/index.d.ts.map +1 -1
  182. package/resources/v1/customers/index.mjs.map +1 -1
  183. package/resources/v1/customers/invoices.d.mts +9 -0
  184. package/resources/v1/customers/invoices.d.mts.map +1 -1
  185. package/resources/v1/customers/invoices.d.ts +9 -0
  186. package/resources/v1/customers/invoices.d.ts.map +1 -1
  187. package/resources/v1/customers/invoices.mjs.map +1 -1
  188. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  189. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  190. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  191. package/resources/v1/customers/plans.d.mts.map +1 -1
  192. package/resources/v1/customers/plans.d.ts.map +1 -1
  193. package/resources/v1/customers/plans.mjs.map +1 -1
  194. package/resources/v1/customers.d.mts.map +1 -1
  195. package/resources/v1/customers.d.ts.map +1 -1
  196. package/resources/v1/customers.mjs.map +1 -1
  197. package/resources/v1/dashboards.d.mts.map +1 -1
  198. package/resources/v1/dashboards.d.ts.map +1 -1
  199. package/resources/v1/dashboards.mjs.map +1 -1
  200. package/resources/v1/index.d.mts +1 -2
  201. package/resources/v1/index.d.mts.map +1 -1
  202. package/resources/v1/index.d.ts +1 -2
  203. package/resources/v1/index.d.ts.map +1 -1
  204. package/resources/v1/index.js +1 -3
  205. package/resources/v1/index.js.map +1 -1
  206. package/resources/v1/index.mjs +0 -1
  207. package/resources/v1/index.mjs.map +1 -1
  208. package/resources/v1/invoices.d.mts.map +1 -1
  209. package/resources/v1/invoices.d.ts.map +1 -1
  210. package/resources/v1/invoices.mjs.map +1 -1
  211. package/resources/v1/packages.d.mts +57 -5
  212. package/resources/v1/packages.d.mts.map +1 -1
  213. package/resources/v1/packages.d.ts +57 -5
  214. package/resources/v1/packages.d.ts.map +1 -1
  215. package/resources/v1/packages.js +3 -4
  216. package/resources/v1/packages.js.map +1 -1
  217. package/resources/v1/packages.mjs +3 -4
  218. package/resources/v1/packages.mjs.map +1 -1
  219. package/resources/v1/plans.d.mts.map +1 -1
  220. package/resources/v1/plans.d.ts.map +1 -1
  221. package/resources/v1/plans.mjs.map +1 -1
  222. package/resources/v1/pricing-units.d.mts.map +1 -1
  223. package/resources/v1/pricing-units.d.ts.map +1 -1
  224. package/resources/v1/pricing-units.mjs.map +1 -1
  225. package/resources/v1/services.d.mts.map +1 -1
  226. package/resources/v1/services.d.ts.map +1 -1
  227. package/resources/v1/services.mjs.map +1 -1
  228. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  229. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  230. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  231. package/resources/v1/settings/index.d.mts.map +1 -1
  232. package/resources/v1/settings/index.d.ts.map +1 -1
  233. package/resources/v1/settings/index.mjs.map +1 -1
  234. package/resources/v1/settings/settings.d.mts.map +1 -1
  235. package/resources/v1/settings/settings.d.ts.map +1 -1
  236. package/resources/v1/settings/settings.mjs.map +1 -1
  237. package/resources/v1/settings.d.mts.map +1 -1
  238. package/resources/v1/settings.d.ts.map +1 -1
  239. package/resources/v1/settings.mjs.map +1 -1
  240. package/resources/v1/usage.d.mts.map +1 -1
  241. package/resources/v1/usage.d.ts.map +1 -1
  242. package/resources/v1/usage.mjs.map +1 -1
  243. package/resources/v1/v1.d.mts +2 -6
  244. package/resources/v1/v1.d.mts.map +1 -1
  245. package/resources/v1/v1.d.ts +2 -6
  246. package/resources/v1/v1.d.ts.map +1 -1
  247. package/resources/v1/v1.js +0 -4
  248. package/resources/v1/v1.js.map +1 -1
  249. package/resources/v1/v1.mjs +0 -4
  250. package/resources/v1/v1.mjs.map +1 -1
  251. package/resources/v1.d.mts.map +1 -1
  252. package/resources/v1.d.ts.map +1 -1
  253. package/resources/v1.mjs.map +1 -1
  254. package/resources/v2/contracts.d.mts +1431 -2
  255. package/resources/v2/contracts.d.mts.map +1 -1
  256. package/resources/v2/contracts.d.ts +1431 -2
  257. package/resources/v2/contracts.d.ts.map +1 -1
  258. package/resources/v2/contracts.mjs.map +1 -1
  259. package/resources/v2/index.d.mts.map +1 -1
  260. package/resources/v2/index.d.ts.map +1 -1
  261. package/resources/v2/index.mjs.map +1 -1
  262. package/resources/v2/v2.d.mts.map +1 -1
  263. package/resources/v2/v2.d.ts.map +1 -1
  264. package/resources/v2/v2.mjs.map +1 -1
  265. package/resources/v2.d.mts.map +1 -1
  266. package/resources/v2.d.ts.map +1 -1
  267. package/resources/v2.mjs.map +1 -1
  268. package/resources/webhooks.d.mts.map +1 -1
  269. package/resources/webhooks.d.ts.map +1 -1
  270. package/resources/webhooks.mjs.map +1 -1
  271. package/resources.d.mts.map +1 -1
  272. package/resources.d.ts.map +1 -1
  273. package/resources.mjs.map +1 -1
  274. package/src/client.ts +12 -0
  275. package/src/internal/types.ts +6 -8
  276. package/src/internal/utils/log.ts +2 -0
  277. package/src/resources/shared.ts +417 -1
  278. package/src/resources/v1/alerts.ts +1 -1
  279. package/src/resources/v1/contracts/contracts.ts +813 -156
  280. package/src/resources/v1/contracts/index.ts +2 -0
  281. package/src/resources/v1/contracts/products.ts +20 -0
  282. package/src/resources/v1/customers/alerts.ts +1 -1
  283. package/src/resources/v1/customers/invoices.ts +12 -0
  284. package/src/resources/v1/index.ts +2 -11
  285. package/src/resources/v1/packages.ts +81 -6
  286. package/src/resources/v1/v1.ts +4 -26
  287. package/src/resources/v2/contracts.ts +1881 -2
  288. package/src/version.ts +1 -1
  289. package/uploads.d.mts +1 -0
  290. package/uploads.d.mts.map +1 -1
  291. package/uploads.d.ts +1 -0
  292. package/uploads.d.ts.map +1 -1
  293. package/uploads.mjs +1 -0
  294. package/uploads.mjs.map +1 -1
  295. package/version.d.mts +1 -1
  296. package/version.d.ts +1 -1
  297. package/version.js +1 -1
  298. package/version.mjs +1 -1
  299. package/resources/v1/payments.d.mts +0 -127
  300. package/resources/v1/payments.d.mts.map +0 -1
  301. package/resources/v1/payments.d.ts +0 -127
  302. package/resources/v1/payments.d.ts.map +0 -1
  303. package/resources/v1/payments.js +0 -71
  304. package/resources/v1/payments.js.map +0 -1
  305. package/resources/v1/payments.mjs +0 -67
  306. package/resources/v1/payments.mjs.map +0 -1
  307. package/src/resources/v1/payments.ts +0 -187
@@ -58,8 +58,8 @@ export class Contracts extends APIResource {
58
58
  /**
59
59
  * Contracts define a customer's products, pricing, discounts, access duration, and
60
60
  * billing configuration. Contracts serve as the central billing agreement for both
61
- * PLG and Enterprise customers, you can automatically customers access to your
62
- * products and services directly from your product or CRM.
61
+ * PLG and Enterprise customers. You can automatically grant customers access to
62
+ * your products and services directly from your product or CRM.
63
63
  *
64
64
  * ### Use this endpoint to:
65
65
  *
@@ -515,6 +515,55 @@ export class Contracts extends APIResource {
515
515
  );
516
516
  }
517
517
 
518
+ /**
519
+ * Retrieve detailed balance for seat-based credits and commits from the contract's
520
+ * subscriptions, broken down by individual seats.
521
+ *
522
+ * ### Use this endpoint to:
523
+ *
524
+ * - Display per-seat balance information in customer dashboards
525
+ * - Filter balance data by subscription or specific seats
526
+ *
527
+ * ### Key response fields:
528
+ *
529
+ * An array of seat balance objects containing:
530
+ *
531
+ * - Seat id
532
+ * - Balance: current total balance across all commits and credits
533
+ *
534
+ * ### Usage guidelines:
535
+ *
536
+ * - Date filtering: use `covering_date` OR `starting_at`/`ending_before` to filter
537
+ * balance data by time range
538
+ * - Set `include_credits_and_commits=true` for detailed commits and credits
539
+ * breakdown per seat
540
+ * - Set `include_ledgers=true` for detailed transaction history per commit/credit
541
+ * per seat
542
+ *
543
+ * @example
544
+ * ```ts
545
+ * const response = await client.v1.contracts.listSeatBalances(
546
+ * {
547
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
548
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
549
+ * covering_date: '2024-03-01T00:00:00.000Z',
550
+ * include_credits_and_commits: true,
551
+ * include_ledgers: true,
552
+ * limit: 25,
553
+ * subscription_ids: [
554
+ * '8deed800-1b7a-495d-a207-6c52bac54dc9',
555
+ * ],
556
+ * },
557
+ * );
558
+ * ```
559
+ */
560
+ listSeatBalances(
561
+ body: ContractListSeatBalancesParams,
562
+ options?: RequestOptions,
563
+ ): APIPromise<ContractListSeatBalancesResponse> {
564
+ return this._client.post('/v1/contracts/seatBalances/list', { body, ...options });
565
+ }
566
+
518
567
  /**
519
568
  * For a specific customer and contract, get the rates at a specific point in time.
520
569
  * This endpoint takes the contract's rate card into consideration, including
@@ -681,7 +730,472 @@ export class Contracts extends APIResource {
681
730
  export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
682
731
 
683
732
  export interface ContractCreateResponse {
684
- data: Shared.ID;
733
+ data: ContractCreateResponse.Data;
734
+ }
735
+
736
+ export namespace ContractCreateResponse {
737
+ export interface Data {
738
+ id: string;
739
+
740
+ /**
741
+ * The created contract.
742
+ */
743
+ contract?: Data.Contract;
744
+ }
745
+
746
+ export namespace Data {
747
+ /**
748
+ * The created contract.
749
+ */
750
+ export interface Contract {
751
+ id: string;
752
+
753
+ commits: Array<Shared.Commit>;
754
+
755
+ created_at: string;
756
+
757
+ created_by: string;
758
+
759
+ customer_id: string;
760
+
761
+ overrides: Array<Shared.Override>;
762
+
763
+ scheduled_charges: Array<Shared.ScheduledCharge>;
764
+
765
+ starting_at: string;
766
+
767
+ transitions: Array<Contract.Transition>;
768
+
769
+ usage_filter: Array<Contract.UsageFilter>;
770
+
771
+ usage_statement_schedule: Contract.UsageStatementSchedule;
772
+
773
+ credits?: Array<Shared.Credit>;
774
+
775
+ /**
776
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
777
+ */
778
+ custom_fields?: { [key: string]: string };
779
+
780
+ /**
781
+ * The billing provider configuration associated with the contract.
782
+ */
783
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
784
+
785
+ ending_before?: string;
786
+
787
+ /**
788
+ * Indicates whether there are more items than the limit for this endpoint. Use the
789
+ * respective list endpoints to get the full lists.
790
+ */
791
+ has_more?: Contract.HasMore;
792
+
793
+ /**
794
+ * Either a **parent** configuration with a list of children or a **child**
795
+ * configuration with a single parent.
796
+ */
797
+ hierarchy_configuration?: Shared.HierarchyConfiguration;
798
+
799
+ /**
800
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
801
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
802
+ * each multiplier; the one with the lowest priority value will be prioritized
803
+ * first.
804
+ */
805
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
806
+
807
+ name?: string;
808
+
809
+ net_payment_terms_days?: number;
810
+
811
+ /**
812
+ * ID of the package this contract was created from, if applicable.
813
+ */
814
+ package_id?: string;
815
+
816
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
817
+
818
+ rate_card_id?: string;
819
+
820
+ recurring_commits?: Array<Contract.RecurringCommit>;
821
+
822
+ recurring_credits?: Array<Contract.RecurringCredit>;
823
+
824
+ /**
825
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
826
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
827
+ * `ending_before` date for consolidation to occur. This field cannot be modified
828
+ * after a Contract has been created. If this field is omitted, charges will appear
829
+ * on a separate invoice from usage charges.
830
+ */
831
+ scheduled_charges_on_usage_invoices?: 'ALL';
832
+
833
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
834
+
835
+ /**
836
+ * List of subscriptions on the contract.
837
+ */
838
+ subscriptions?: Array<Shared.Subscription>;
839
+
840
+ /**
841
+ * Optional uniqueness key to prevent duplicate contract creations.
842
+ */
843
+ uniqueness_key?: string;
844
+ }
845
+
846
+ export namespace Contract {
847
+ export interface Transition {
848
+ from_contract_id: string;
849
+
850
+ to_contract_id: string;
851
+
852
+ type: 'SUPERSEDE' | 'RENEWAL';
853
+ }
854
+
855
+ export interface UsageFilter {
856
+ group_key: string;
857
+
858
+ group_values: Array<string>;
859
+
860
+ starting_at: string;
861
+
862
+ ending_before?: string;
863
+ }
864
+
865
+ export interface UsageStatementSchedule {
866
+ /**
867
+ * Contract usage statements follow a selected cadence based on this date.
868
+ */
869
+ billing_anchor_date: string;
870
+
871
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
872
+ }
873
+
874
+ /**
875
+ * The billing provider configuration associated with the contract.
876
+ */
877
+ export interface CustomerBillingProviderConfiguration {
878
+ id?: string;
879
+
880
+ billing_provider?:
881
+ | 'aws_marketplace'
882
+ | 'stripe'
883
+ | 'netsuite'
884
+ | 'custom'
885
+ | 'azure_marketplace'
886
+ | 'quickbooks_online'
887
+ | 'workday'
888
+ | 'gcp_marketplace'
889
+ | 'metronome';
890
+
891
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
892
+ }
893
+
894
+ /**
895
+ * Indicates whether there are more items than the limit for this endpoint. Use the
896
+ * respective list endpoints to get the full lists.
897
+ */
898
+ export interface HasMore {
899
+ /**
900
+ * Whether there are more commits on this contract than the limit for this
901
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
902
+ * of commits.
903
+ */
904
+ commits: boolean;
905
+
906
+ /**
907
+ * Whether there are more credits on this contract than the limit for this
908
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
909
+ * of credits.
910
+ */
911
+ credits: boolean;
912
+ }
913
+
914
+ export interface RecurringCommit {
915
+ id: string;
916
+
917
+ /**
918
+ * The amount of commit to grant.
919
+ */
920
+ access_amount: RecurringCommit.AccessAmount;
921
+
922
+ /**
923
+ * The amount of time the created commits will be valid for
924
+ */
925
+ commit_duration: RecurringCommit.CommitDuration;
926
+
927
+ /**
928
+ * Will be passed down to the individual commits
929
+ */
930
+ priority: number;
931
+
932
+ product: RecurringCommit.Product;
933
+
934
+ /**
935
+ * Whether the created commits will use the commit rate or list rate
936
+ */
937
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
938
+
939
+ /**
940
+ * Determines the start time for the first commit
941
+ */
942
+ starting_at: string;
943
+
944
+ /**
945
+ * Will be passed down to the individual commits
946
+ */
947
+ applicable_product_ids?: Array<string>;
948
+
949
+ /**
950
+ * Will be passed down to the individual commits
951
+ */
952
+ applicable_product_tags?: Array<string>;
953
+
954
+ contract?: RecurringCommit.Contract;
955
+
956
+ /**
957
+ * Will be passed down to the individual commits
958
+ */
959
+ description?: string;
960
+
961
+ /**
962
+ * Determines when the contract will stop creating recurring commits. Optional
963
+ */
964
+ ending_before?: string;
965
+
966
+ /**
967
+ * Optional configuration for recurring commit/credit hierarchy access control
968
+ */
969
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
970
+
971
+ /**
972
+ * The amount the customer should be billed for the commit. Not required.
973
+ */
974
+ invoice_amount?: RecurringCommit.InvoiceAmount;
975
+
976
+ /**
977
+ * Displayed on invoices. Will be passed through to the individual commits
978
+ */
979
+ name?: string;
980
+
981
+ /**
982
+ * Will be passed down to the individual commits
983
+ */
984
+ netsuite_sales_order_id?: string;
985
+
986
+ /**
987
+ * Determines whether the first and last commit will be prorated. If not provided,
988
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
989
+ */
990
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
991
+
992
+ /**
993
+ * The frequency at which the recurring commits will be created. If not provided: -
994
+ * The commits will be created on the usage invoice frequency. If provided: - The
995
+ * period defined in the duration will correspond to this frequency. - Commits will
996
+ * be created aligned with the recurring commit's starting_at rather than the usage
997
+ * invoice dates.
998
+ */
999
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1000
+
1001
+ /**
1002
+ * Will be passed down to the individual commits. This controls how much of an
1003
+ * individual unexpired commit will roll over upon contract transition. Must be
1004
+ * between 0 and 1.
1005
+ */
1006
+ rollover_fraction?: number;
1007
+
1008
+ /**
1009
+ * List of filters that determine what kind of customer usage draws down a commit
1010
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1011
+ * specifiers to contribute to a commit's or credit's drawdown.
1012
+ */
1013
+ specifiers?: Array<Shared.CommitSpecifier>;
1014
+
1015
+ /**
1016
+ * Attach a subscription to the recurring commit/credit.
1017
+ */
1018
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1019
+ }
1020
+
1021
+ export namespace RecurringCommit {
1022
+ /**
1023
+ * The amount of commit to grant.
1024
+ */
1025
+ export interface AccessAmount {
1026
+ credit_type_id: string;
1027
+
1028
+ unit_price: number;
1029
+
1030
+ quantity?: number;
1031
+ }
1032
+
1033
+ /**
1034
+ * The amount of time the created commits will be valid for
1035
+ */
1036
+ export interface CommitDuration {
1037
+ value: number;
1038
+
1039
+ unit?: 'PERIODS';
1040
+ }
1041
+
1042
+ export interface Product {
1043
+ id: string;
1044
+
1045
+ name: string;
1046
+ }
1047
+
1048
+ export interface Contract {
1049
+ id: string;
1050
+ }
1051
+
1052
+ /**
1053
+ * The amount the customer should be billed for the commit. Not required.
1054
+ */
1055
+ export interface InvoiceAmount {
1056
+ credit_type_id: string;
1057
+
1058
+ quantity: number;
1059
+
1060
+ unit_price: number;
1061
+ }
1062
+ }
1063
+
1064
+ export interface RecurringCredit {
1065
+ id: string;
1066
+
1067
+ /**
1068
+ * The amount of commit to grant.
1069
+ */
1070
+ access_amount: RecurringCredit.AccessAmount;
1071
+
1072
+ /**
1073
+ * The amount of time the created commits will be valid for
1074
+ */
1075
+ commit_duration: RecurringCredit.CommitDuration;
1076
+
1077
+ /**
1078
+ * Will be passed down to the individual commits
1079
+ */
1080
+ priority: number;
1081
+
1082
+ product: RecurringCredit.Product;
1083
+
1084
+ /**
1085
+ * Whether the created commits will use the commit rate or list rate
1086
+ */
1087
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1088
+
1089
+ /**
1090
+ * Determines the start time for the first commit
1091
+ */
1092
+ starting_at: string;
1093
+
1094
+ /**
1095
+ * Will be passed down to the individual commits
1096
+ */
1097
+ applicable_product_ids?: Array<string>;
1098
+
1099
+ /**
1100
+ * Will be passed down to the individual commits
1101
+ */
1102
+ applicable_product_tags?: Array<string>;
1103
+
1104
+ contract?: RecurringCredit.Contract;
1105
+
1106
+ /**
1107
+ * Will be passed down to the individual commits
1108
+ */
1109
+ description?: string;
1110
+
1111
+ /**
1112
+ * Determines when the contract will stop creating recurring commits. Optional
1113
+ */
1114
+ ending_before?: string;
1115
+
1116
+ /**
1117
+ * Optional configuration for recurring commit/credit hierarchy access control
1118
+ */
1119
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1120
+
1121
+ /**
1122
+ * Displayed on invoices. Will be passed through to the individual commits
1123
+ */
1124
+ name?: string;
1125
+
1126
+ /**
1127
+ * Will be passed down to the individual commits
1128
+ */
1129
+ netsuite_sales_order_id?: string;
1130
+
1131
+ /**
1132
+ * Determines whether the first and last commit will be prorated. If not provided,
1133
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1134
+ */
1135
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1136
+
1137
+ /**
1138
+ * The frequency at which the recurring commits will be created. If not provided: -
1139
+ * The commits will be created on the usage invoice frequency. If provided: - The
1140
+ * period defined in the duration will correspond to this frequency. - Commits will
1141
+ * be created aligned with the recurring commit's starting_at rather than the usage
1142
+ * invoice dates.
1143
+ */
1144
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1145
+
1146
+ /**
1147
+ * Will be passed down to the individual commits. This controls how much of an
1148
+ * individual unexpired commit will roll over upon contract transition. Must be
1149
+ * between 0 and 1.
1150
+ */
1151
+ rollover_fraction?: number;
1152
+
1153
+ /**
1154
+ * List of filters that determine what kind of customer usage draws down a commit
1155
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1156
+ * specifiers to contribute to a commit's or credit's drawdown.
1157
+ */
1158
+ specifiers?: Array<Shared.CommitSpecifier>;
1159
+
1160
+ /**
1161
+ * Attach a subscription to the recurring commit/credit.
1162
+ */
1163
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1164
+ }
1165
+
1166
+ export namespace RecurringCredit {
1167
+ /**
1168
+ * The amount of commit to grant.
1169
+ */
1170
+ export interface AccessAmount {
1171
+ credit_type_id: string;
1172
+
1173
+ unit_price: number;
1174
+
1175
+ quantity?: number;
1176
+ }
1177
+
1178
+ /**
1179
+ * The amount of time the created commits will be valid for
1180
+ */
1181
+ export interface CommitDuration {
1182
+ value: number;
1183
+
1184
+ unit?: 'PERIODS';
1185
+ }
1186
+
1187
+ export interface Product {
1188
+ id: string;
1189
+
1190
+ name: string;
1191
+ }
1192
+
1193
+ export interface Contract {
1194
+ id: string;
1195
+ }
1196
+ }
1197
+ }
1198
+ }
685
1199
  }
686
1200
 
687
1201
  export interface ContractRetrieveResponse {
@@ -726,6 +1240,178 @@ export namespace ContractGetNetBalanceResponse {
726
1240
 
727
1241
  export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
728
1242
 
1243
+ export interface ContractListSeatBalancesResponse {
1244
+ data: Array<ContractListSeatBalancesResponse.Data>;
1245
+
1246
+ pagination: ContractListSeatBalancesResponse.Pagination;
1247
+ }
1248
+
1249
+ export namespace ContractListSeatBalancesResponse {
1250
+ export interface Data {
1251
+ balances: Array<Data.Balance>;
1252
+
1253
+ /**
1254
+ * The unique identifier for the seat
1255
+ */
1256
+ seat_id: string;
1257
+
1258
+ /**
1259
+ * Array of commits applicable to this seat with their balances
1260
+ */
1261
+ commits?: Array<Data.Commit> | null;
1262
+
1263
+ /**
1264
+ * Array of credits applicable to this seat with their balances
1265
+ */
1266
+ credits?: Array<Data.Credit>;
1267
+ }
1268
+
1269
+ export namespace Data {
1270
+ export interface Balance {
1271
+ /**
1272
+ * The total balance across all commits and credits for this seat, of this credit
1273
+ * type.
1274
+ */
1275
+ balance: number;
1276
+
1277
+ credit_type_id: string;
1278
+
1279
+ /**
1280
+ * The total initial balances of all commits and credits for this seat, of this
1281
+ * credit type.
1282
+ */
1283
+ starting_balance: number;
1284
+ }
1285
+
1286
+ export interface Commit {
1287
+ /**
1288
+ * The commit or credit ID
1289
+ */
1290
+ id: string;
1291
+
1292
+ /**
1293
+ * The current balance for this commit for this specific seat
1294
+ */
1295
+ balance: number;
1296
+
1297
+ /**
1298
+ * The datetime when the commit becomes active
1299
+ */
1300
+ start_date: string;
1301
+
1302
+ /**
1303
+ * The datetime when the commit expires
1304
+ */
1305
+ end_date?: string | null;
1306
+
1307
+ /**
1308
+ * Transaction history for this commit for this seat (only included if
1309
+ * include_ledgers=true)
1310
+ */
1311
+ ledger_entries?: Array<Commit.LedgerEntry>;
1312
+ }
1313
+
1314
+ export namespace Commit {
1315
+ export interface LedgerEntry {
1316
+ /**
1317
+ * Amount of the ledger entry
1318
+ */
1319
+ amount: number;
1320
+
1321
+ /**
1322
+ * The datetime when the ledger is created
1323
+ */
1324
+ timestamp: string;
1325
+
1326
+ /**
1327
+ * Commit ledger type
1328
+ */
1329
+ type:
1330
+ | 'PREPAID_COMMIT_SEGMENT_START'
1331
+ | 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'
1332
+ | 'PREPAID_COMMIT_ROLLOVER'
1333
+ | 'PREPAID_COMMIT_EXPIRATION'
1334
+ | 'PREPAID_COMMIT_CANCELED'
1335
+ | 'PREPAID_COMMIT_CREDITED'
1336
+ | 'PREPAID_COMMIT_MANUAL'
1337
+ | 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
1338
+ }
1339
+ }
1340
+
1341
+ export interface Credit {
1342
+ /**
1343
+ * The credit ID
1344
+ */
1345
+ id: string;
1346
+
1347
+ /**
1348
+ * The current balance for this credit for this specific seat
1349
+ */
1350
+ balance: number;
1351
+
1352
+ /**
1353
+ * The datetime when the credit becomes active
1354
+ */
1355
+ start_date: string;
1356
+
1357
+ /**
1358
+ * The datetime when the credit expires
1359
+ */
1360
+ end_date?: string | null;
1361
+
1362
+ /**
1363
+ * Transaction history for this credit for this seat (only included if
1364
+ * include_ledgers=true)
1365
+ */
1366
+ ledger_entries?: Array<Credit.LedgerEntry>;
1367
+ }
1368
+
1369
+ export namespace Credit {
1370
+ export interface LedgerEntry {
1371
+ /**
1372
+ * Amount of the ledger entry
1373
+ */
1374
+ amount: number;
1375
+
1376
+ /**
1377
+ * The datetime when the ledger is created
1378
+ */
1379
+ timestamp: string;
1380
+
1381
+ /**
1382
+ * Credit ledger type
1383
+ */
1384
+ type:
1385
+ | 'CREDIT_SEGMENT_START'
1386
+ | 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'
1387
+ | 'CREDIT_EXPIRATION'
1388
+ | 'CREDIT_CANCELED'
1389
+ | 'CREDIT_CREDITED'
1390
+ | 'CREDIT_MANUAL'
1391
+ | 'CREDIT_SEAT_BASED_ADJUSTMENT'
1392
+ | 'CREDIT_ROLLOVER';
1393
+ }
1394
+ }
1395
+ }
1396
+
1397
+ export interface Pagination {
1398
+ /**
1399
+ * Number of seats available to fetch in the next page
1400
+ */
1401
+ seats_available_for_next_page: number;
1402
+
1403
+ /**
1404
+ * Number of seats included in this response
1405
+ */
1406
+ seats_included: number;
1407
+
1408
+ /**
1409
+ * Token to retrieve the next page of results. Null if no more pages available
1410
+ */
1411
+ next_page?: string | null;
1412
+ }
1413
+ }
1414
+
729
1415
  export interface ContractRetrieveRateScheduleResponse {
730
1416
  data: Array<ContractRetrieveRateScheduleResponse.Data>;
731
1417
 
@@ -872,7 +1558,7 @@ export interface ContractCreateParams {
872
1558
  /**
873
1559
  * If provided, provisions a customer on a package instead of creating a
874
1560
  * traditional contract. When specified, only customer_id, starting_at, package_id,
875
- * and uniqueness_key are allowed.
1561
+ * uniqueness_key, transition, and custom_fields are allowed.
876
1562
  */
877
1563
  package_id?: string;
878
1564
 
@@ -924,6 +1610,12 @@ export interface ContractCreateParams {
924
1610
 
925
1611
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
926
1612
 
1613
+ /**
1614
+ * Spend trackers to attach to this contract. Aliases must be unique within a
1615
+ * contract.
1616
+ */
1617
+ spend_trackers?: Array<ContractCreateParams.SpendTracker>;
1618
+
927
1619
  /**
928
1620
  * Optional list of
929
1621
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1038,11 +1730,6 @@ export namespace ContractCreateParams {
1038
1730
  */
1039
1731
  netsuite_sales_order_id?: string;
1040
1732
 
1041
- /**
1042
- * optionally payment gate this commit
1043
- */
1044
- payment_gate_config?: Commit.PaymentGateConfig;
1045
-
1046
1733
  /**
1047
1734
  * If multiple commits are applicable, the one with the lower priority will apply
1048
1735
  * first.
@@ -1064,6 +1751,11 @@ export namespace ContractCreateParams {
1064
1751
  */
1065
1752
  specifiers?: Array<Shared.CommitSpecifierInput>;
1066
1753
 
1754
+ /**
1755
+ * Optional attributes for spend tracker integration. Immutable after creation.
1756
+ */
1757
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
1758
+
1067
1759
  /**
1068
1760
  * A temporary ID for the commit that can be used to reference the commit for
1069
1761
  * commit specific overrides.
@@ -1206,80 +1898,14 @@ export namespace ContractCreateParams {
1206
1898
  }
1207
1899
 
1208
1900
  /**
1209
- * optionally payment gate this commit
1901
+ * Optional attributes for spend tracker integration. Immutable after creation.
1210
1902
  */
1211
- export interface PaymentGateConfig {
1212
- /**
1213
- * Gate access to the commit balance based on successful collection of payment.
1214
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1215
- * facilitate payment using your own payment integration. Select NONE if you do not
1216
- * wish to payment gate the commit balance.
1217
- */
1218
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1219
-
1903
+ export interface SpendTrackerAttributes {
1220
1904
  /**
1221
- * Only applicable if using PRECALCULATED as your tax type.
1905
+ * If true, this commit will be included in spend trackers with discounted set to
1906
+ * DISCOUNTED_ONLY
1222
1907
  */
1223
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1224
-
1225
- /**
1226
- * Only applicable if using STRIPE as your payment gate type.
1227
- */
1228
- stripe_config?: PaymentGateConfig.StripeConfig;
1229
-
1230
- /**
1231
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1232
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1233
- * will default to NONE.
1234
- */
1235
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1236
- }
1237
-
1238
- export namespace PaymentGateConfig {
1239
- /**
1240
- * Only applicable if using PRECALCULATED as your tax type.
1241
- */
1242
- export interface PrecalculatedTaxConfig {
1243
- /**
1244
- * Amount of tax to be applied. This should be in the same currency and
1245
- * denomination as the commit's invoice schedule
1246
- */
1247
- tax_amount: number;
1248
-
1249
- /**
1250
- * Name of the tax to be applied. This may be used in an invoice line item
1251
- * description.
1252
- */
1253
- tax_name?: string;
1254
- }
1255
-
1256
- /**
1257
- * Only applicable if using STRIPE as your payment gate type.
1258
- */
1259
- export interface StripeConfig {
1260
- /**
1261
- * If left blank, will default to INVOICE
1262
- */
1263
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1264
-
1265
- /**
1266
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1267
- * your payment type.
1268
- */
1269
- invoice_metadata?: { [key: string]: string };
1270
-
1271
- /**
1272
- * If true, the payment will be made assuming the customer is present (i.e. on
1273
- * session).
1274
- *
1275
- * If false, the payment will be made assuming the customer is not present (i.e.
1276
- * off session). For cardholders from a country with an e-mandate requirement (e.g.
1277
- * India), the payment may be declined.
1278
- *
1279
- * If left blank, will default to false.
1280
- */
1281
- on_session_payment?: boolean;
1282
- }
1908
+ counts_as_discounted: boolean;
1283
1909
  }
1284
1910
  }
1285
1911
 
@@ -2285,6 +2911,32 @@ export namespace ContractCreateParams {
2285
2911
  }
2286
2912
  }
2287
2913
 
2914
+ export interface SpendTracker {
2915
+ /**
2916
+ * Human-readable identifier, unique per contract.
2917
+ */
2918
+ alias: string;
2919
+
2920
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
2921
+
2922
+ credit_type_id: string;
2923
+
2924
+ reset_frequency: 'BILLING_PERIOD';
2925
+ }
2926
+
2927
+ export namespace SpendTracker {
2928
+ export interface ApplicableSpendSpecifier {
2929
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
2930
+
2931
+ spend_type: 'COMMIT_PURCHASE';
2932
+
2933
+ /**
2934
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
2935
+ */
2936
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
2937
+ }
2938
+ }
2939
+
2288
2940
  export interface Subscription {
2289
2941
  collection_schedule: 'ADVANCE' | 'ARREARS';
2290
2942
 
@@ -2664,11 +3316,6 @@ export namespace ContractAmendParams {
2664
3316
  */
2665
3317
  netsuite_sales_order_id?: string;
2666
3318
 
2667
- /**
2668
- * optionally payment gate this commit
2669
- */
2670
- payment_gate_config?: Commit.PaymentGateConfig;
2671
-
2672
3319
  /**
2673
3320
  * If multiple commits are applicable, the one with the lower priority will apply
2674
3321
  * first.
@@ -2690,6 +3337,11 @@ export namespace ContractAmendParams {
2690
3337
  */
2691
3338
  specifiers?: Array<Shared.CommitSpecifierInput>;
2692
3339
 
3340
+ /**
3341
+ * Optional attributes for spend tracker integration. Immutable after creation.
3342
+ */
3343
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
3344
+
2693
3345
  /**
2694
3346
  * A temporary ID for the commit that can be used to reference the commit for
2695
3347
  * commit specific overrides.
@@ -2832,80 +3484,14 @@ export namespace ContractAmendParams {
2832
3484
  }
2833
3485
 
2834
3486
  /**
2835
- * optionally payment gate this commit
3487
+ * Optional attributes for spend tracker integration. Immutable after creation.
2836
3488
  */
2837
- export interface PaymentGateConfig {
2838
- /**
2839
- * Gate access to the commit balance based on successful collection of payment.
2840
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2841
- * facilitate payment using your own payment integration. Select NONE if you do not
2842
- * wish to payment gate the commit balance.
2843
- */
2844
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2845
-
2846
- /**
2847
- * Only applicable if using PRECALCULATED as your tax type.
2848
- */
2849
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2850
-
2851
- /**
2852
- * Only applicable if using STRIPE as your payment gate type.
2853
- */
2854
- stripe_config?: PaymentGateConfig.StripeConfig;
2855
-
2856
- /**
2857
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2858
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2859
- * will default to NONE.
2860
- */
2861
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2862
- }
2863
-
2864
- export namespace PaymentGateConfig {
2865
- /**
2866
- * Only applicable if using PRECALCULATED as your tax type.
2867
- */
2868
- export interface PrecalculatedTaxConfig {
2869
- /**
2870
- * Amount of tax to be applied. This should be in the same currency and
2871
- * denomination as the commit's invoice schedule
2872
- */
2873
- tax_amount: number;
2874
-
2875
- /**
2876
- * Name of the tax to be applied. This may be used in an invoice line item
2877
- * description.
2878
- */
2879
- tax_name?: string;
2880
- }
2881
-
3489
+ export interface SpendTrackerAttributes {
2882
3490
  /**
2883
- * Only applicable if using STRIPE as your payment gate type.
3491
+ * If true, this commit will be included in spend trackers with discounted set to
3492
+ * DISCOUNTED_ONLY
2884
3493
  */
2885
- export interface StripeConfig {
2886
- /**
2887
- * If left blank, will default to INVOICE
2888
- */
2889
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2890
-
2891
- /**
2892
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2893
- * your payment type.
2894
- */
2895
- invoice_metadata?: { [key: string]: string };
2896
-
2897
- /**
2898
- * If true, the payment will be made assuming the customer is present (i.e. on
2899
- * session).
2900
- *
2901
- * If false, the payment will be made assuming the customer is not present (i.e.
2902
- * off session). For cardholders from a country with an e-mandate requirement (e.g.
2903
- * India), the payment may be declined.
2904
- *
2905
- * If left blank, will default to false.
2906
- */
2907
- on_session_payment?: boolean;
2908
- }
3494
+ counts_as_discounted: boolean;
2909
3495
  }
2910
3496
  }
2911
3497
 
@@ -3658,6 +4244,75 @@ export interface ContractListBalancesParams extends BodyCursorPageParams {
3658
4244
  starting_at?: string;
3659
4245
  }
3660
4246
 
4247
+ export interface ContractListSeatBalancesParams {
4248
+ /**
4249
+ * The contract ID to retrieve seat balances for
4250
+ */
4251
+ contract_id: string;
4252
+
4253
+ /**
4254
+ * The customer ID to retrieve seat balances for
4255
+ */
4256
+ customer_id: string;
4257
+
4258
+ /**
4259
+ * Include only commits or credits with access that cover this specific date
4260
+ * (cannot be used with starting_at or ending_before).
4261
+ */
4262
+ covering_date?: string;
4263
+
4264
+ /**
4265
+ * Page token from a previous response to retrieve the next page
4266
+ */
4267
+ cursor?: string;
4268
+
4269
+ /**
4270
+ * Include only commits or credits with access effective on or before this date
4271
+ * (cannot be used with covering_date).
4272
+ */
4273
+ effective_before?: string;
4274
+
4275
+ /**
4276
+ * Include credits and commits in the response
4277
+ */
4278
+ include_credits_and_commits?: boolean;
4279
+
4280
+ /**
4281
+ * Include ledger entries for each commit and commit. `include_credits_and_commits`
4282
+ * must be set to `true` for `include_ledgers=true` to apply.
4283
+ */
4284
+ include_ledgers?: boolean;
4285
+
4286
+ /**
4287
+ * Maximum number of seats to return. Range: 1-100. Default: 25. When
4288
+ * `include_credits_and_commits = true`, if the total commits/credits across all
4289
+ * seats exceeds 100, a limit of 100 applies to the total credits and commits.
4290
+ * Seats are included greedily to maximize the number of seats returned. Example:
4291
+ * if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned
4292
+ * (total: 108 commits). Each returned seat includes all of its associated credits
4293
+ * and commits.
4294
+ */
4295
+ limit?: number;
4296
+
4297
+ /**
4298
+ * Optional filter to only include specific seats.
4299
+ */
4300
+ seat_ids?: Array<string>;
4301
+
4302
+ /**
4303
+ * Include only commits or credits with access effective on or after this date
4304
+ * (cannot be used with covering_date).
4305
+ */
4306
+ starting_at?: string;
4307
+
4308
+ /**
4309
+ * Optional filter to only include seats from specific subscriptions. If
4310
+ * subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be
4311
+ * returned.
4312
+ */
4313
+ subscription_ids?: Array<string>;
4314
+ }
4315
+
3661
4316
  export interface ContractRetrieveRateScheduleParams {
3662
4317
  /**
3663
4318
  * Body param: ID of the contract to get the rate schedule for.
@@ -3858,6 +4513,7 @@ export declare namespace Contracts {
3858
4513
  type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
3859
4514
  type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
3860
4515
  type ContractListBalancesResponse as ContractListBalancesResponse,
4516
+ type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
3861
4517
  type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
3862
4518
  type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
3863
4519
  type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
@@ -3872,6 +4528,7 @@ export declare namespace Contracts {
3872
4528
  type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
3873
4529
  type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
3874
4530
  type ContractListBalancesParams as ContractListBalancesParams,
4531
+ type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
3875
4532
  type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
3876
4533
  type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
3877
4534
  type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams,