@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
@@ -17,8 +17,8 @@ export declare class Contracts extends APIResource {
17
17
  /**
18
18
  * Contracts define a customer's products, pricing, discounts, access duration, and
19
19
  * billing configuration. Contracts serve as the central billing agreement for both
20
- * PLG and Enterprise customers, you can automatically customers access to your
21
- * products and services directly from your product or CRM.
20
+ * PLG and Enterprise customers. You can automatically grant customers access to
21
+ * your products and services directly from your product or CRM.
22
22
  *
23
23
  * ### Use this endpoint to:
24
24
  *
@@ -427,6 +427,49 @@ export declare class Contracts extends APIResource {
427
427
  * ```
428
428
  */
429
429
  listBalances(body: ContractListBalancesParams, options?: RequestOptions): PagePromise<ContractListBalancesResponsesBodyCursorPage, ContractListBalancesResponse>;
430
+ /**
431
+ * Retrieve detailed balance for seat-based credits and commits from the contract's
432
+ * subscriptions, broken down by individual seats.
433
+ *
434
+ * ### Use this endpoint to:
435
+ *
436
+ * - Display per-seat balance information in customer dashboards
437
+ * - Filter balance data by subscription or specific seats
438
+ *
439
+ * ### Key response fields:
440
+ *
441
+ * An array of seat balance objects containing:
442
+ *
443
+ * - Seat id
444
+ * - Balance: current total balance across all commits and credits
445
+ *
446
+ * ### Usage guidelines:
447
+ *
448
+ * - Date filtering: use `covering_date` OR `starting_at`/`ending_before` to filter
449
+ * balance data by time range
450
+ * - Set `include_credits_and_commits=true` for detailed commits and credits
451
+ * breakdown per seat
452
+ * - Set `include_ledgers=true` for detailed transaction history per commit/credit
453
+ * per seat
454
+ *
455
+ * @example
456
+ * ```ts
457
+ * const response = await client.v1.contracts.listSeatBalances(
458
+ * {
459
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
460
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
461
+ * covering_date: '2024-03-01T00:00:00.000Z',
462
+ * include_credits_and_commits: true,
463
+ * include_ledgers: true,
464
+ * limit: 25,
465
+ * subscription_ids: [
466
+ * '8deed800-1b7a-495d-a207-6c52bac54dc9',
467
+ * ],
468
+ * },
469
+ * );
470
+ * ```
471
+ */
472
+ listSeatBalances(body: ContractListSeatBalancesParams, options?: RequestOptions): APIPromise<ContractListSeatBalancesResponse>;
430
473
  /**
431
474
  * For a specific customer and contract, get the rates at a specific point in time.
432
475
  * This endpoint takes the contract's rate card into consideration, including
@@ -556,7 +599,360 @@ export declare class Contracts extends APIResource {
556
599
  }
557
600
  export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
558
601
  export interface ContractCreateResponse {
559
- data: Shared.ID;
602
+ data: ContractCreateResponse.Data;
603
+ }
604
+ export declare namespace ContractCreateResponse {
605
+ interface Data {
606
+ id: string;
607
+ /**
608
+ * The created contract.
609
+ */
610
+ contract?: Data.Contract;
611
+ }
612
+ namespace Data {
613
+ /**
614
+ * The created contract.
615
+ */
616
+ interface Contract {
617
+ id: string;
618
+ commits: Array<Shared.Commit>;
619
+ created_at: string;
620
+ created_by: string;
621
+ customer_id: string;
622
+ overrides: Array<Shared.Override>;
623
+ scheduled_charges: Array<Shared.ScheduledCharge>;
624
+ starting_at: string;
625
+ transitions: Array<Contract.Transition>;
626
+ usage_filter: Array<Contract.UsageFilter>;
627
+ usage_statement_schedule: Contract.UsageStatementSchedule;
628
+ credits?: Array<Shared.Credit>;
629
+ /**
630
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
631
+ */
632
+ custom_fields?: {
633
+ [key: string]: string;
634
+ };
635
+ /**
636
+ * The billing provider configuration associated with the contract.
637
+ */
638
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
639
+ ending_before?: string;
640
+ /**
641
+ * Indicates whether there are more items than the limit for this endpoint. Use the
642
+ * respective list endpoints to get the full lists.
643
+ */
644
+ has_more?: Contract.HasMore;
645
+ /**
646
+ * Either a **parent** configuration with a list of children or a **child**
647
+ * configuration with a single parent.
648
+ */
649
+ hierarchy_configuration?: Shared.HierarchyConfiguration;
650
+ /**
651
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
652
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
653
+ * each multiplier; the one with the lowest priority value will be prioritized
654
+ * first.
655
+ */
656
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
657
+ name?: string;
658
+ net_payment_terms_days?: number;
659
+ /**
660
+ * ID of the package this contract was created from, if applicable.
661
+ */
662
+ package_id?: string;
663
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
664
+ rate_card_id?: string;
665
+ recurring_commits?: Array<Contract.RecurringCommit>;
666
+ recurring_credits?: Array<Contract.RecurringCredit>;
667
+ /**
668
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
669
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
670
+ * `ending_before` date for consolidation to occur. This field cannot be modified
671
+ * after a Contract has been created. If this field is omitted, charges will appear
672
+ * on a separate invoice from usage charges.
673
+ */
674
+ scheduled_charges_on_usage_invoices?: 'ALL';
675
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
676
+ /**
677
+ * List of subscriptions on the contract.
678
+ */
679
+ subscriptions?: Array<Shared.Subscription>;
680
+ /**
681
+ * Optional uniqueness key to prevent duplicate contract creations.
682
+ */
683
+ uniqueness_key?: string;
684
+ }
685
+ namespace Contract {
686
+ interface Transition {
687
+ from_contract_id: string;
688
+ to_contract_id: string;
689
+ type: 'SUPERSEDE' | 'RENEWAL';
690
+ }
691
+ interface UsageFilter {
692
+ group_key: string;
693
+ group_values: Array<string>;
694
+ starting_at: string;
695
+ ending_before?: string;
696
+ }
697
+ interface UsageStatementSchedule {
698
+ /**
699
+ * Contract usage statements follow a selected cadence based on this date.
700
+ */
701
+ billing_anchor_date: string;
702
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
703
+ }
704
+ /**
705
+ * The billing provider configuration associated with the contract.
706
+ */
707
+ interface CustomerBillingProviderConfiguration {
708
+ id?: string;
709
+ billing_provider?: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace' | 'metronome';
710
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
711
+ }
712
+ /**
713
+ * Indicates whether there are more items than the limit for this endpoint. Use the
714
+ * respective list endpoints to get the full lists.
715
+ */
716
+ interface HasMore {
717
+ /**
718
+ * Whether there are more commits on this contract than the limit for this
719
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
720
+ * of commits.
721
+ */
722
+ commits: boolean;
723
+ /**
724
+ * Whether there are more credits on this contract than the limit for this
725
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
726
+ * of credits.
727
+ */
728
+ credits: boolean;
729
+ }
730
+ interface RecurringCommit {
731
+ id: string;
732
+ /**
733
+ * The amount of commit to grant.
734
+ */
735
+ access_amount: RecurringCommit.AccessAmount;
736
+ /**
737
+ * The amount of time the created commits will be valid for
738
+ */
739
+ commit_duration: RecurringCommit.CommitDuration;
740
+ /**
741
+ * Will be passed down to the individual commits
742
+ */
743
+ priority: number;
744
+ product: RecurringCommit.Product;
745
+ /**
746
+ * Whether the created commits will use the commit rate or list rate
747
+ */
748
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
749
+ /**
750
+ * Determines the start time for the first commit
751
+ */
752
+ starting_at: string;
753
+ /**
754
+ * Will be passed down to the individual commits
755
+ */
756
+ applicable_product_ids?: Array<string>;
757
+ /**
758
+ * Will be passed down to the individual commits
759
+ */
760
+ applicable_product_tags?: Array<string>;
761
+ contract?: RecurringCommit.Contract;
762
+ /**
763
+ * Will be passed down to the individual commits
764
+ */
765
+ description?: string;
766
+ /**
767
+ * Determines when the contract will stop creating recurring commits. Optional
768
+ */
769
+ ending_before?: string;
770
+ /**
771
+ * Optional configuration for recurring commit/credit hierarchy access control
772
+ */
773
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
774
+ /**
775
+ * The amount the customer should be billed for the commit. Not required.
776
+ */
777
+ invoice_amount?: RecurringCommit.InvoiceAmount;
778
+ /**
779
+ * Displayed on invoices. Will be passed through to the individual commits
780
+ */
781
+ name?: string;
782
+ /**
783
+ * Will be passed down to the individual commits
784
+ */
785
+ netsuite_sales_order_id?: string;
786
+ /**
787
+ * Determines whether the first and last commit will be prorated. If not provided,
788
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
789
+ */
790
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
791
+ /**
792
+ * The frequency at which the recurring commits will be created. If not provided: -
793
+ * The commits will be created on the usage invoice frequency. If provided: - The
794
+ * period defined in the duration will correspond to this frequency. - Commits will
795
+ * be created aligned with the recurring commit's starting_at rather than the usage
796
+ * invoice dates.
797
+ */
798
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
799
+ /**
800
+ * Will be passed down to the individual commits. This controls how much of an
801
+ * individual unexpired commit will roll over upon contract transition. Must be
802
+ * between 0 and 1.
803
+ */
804
+ rollover_fraction?: number;
805
+ /**
806
+ * List of filters that determine what kind of customer usage draws down a commit
807
+ * or credit. A customer's usage needs to meet the condition of at least one of the
808
+ * specifiers to contribute to a commit's or credit's drawdown.
809
+ */
810
+ specifiers?: Array<Shared.CommitSpecifier>;
811
+ /**
812
+ * Attach a subscription to the recurring commit/credit.
813
+ */
814
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
815
+ }
816
+ namespace RecurringCommit {
817
+ /**
818
+ * The amount of commit to grant.
819
+ */
820
+ interface AccessAmount {
821
+ credit_type_id: string;
822
+ unit_price: number;
823
+ quantity?: number;
824
+ }
825
+ /**
826
+ * The amount of time the created commits will be valid for
827
+ */
828
+ interface CommitDuration {
829
+ value: number;
830
+ unit?: 'PERIODS';
831
+ }
832
+ interface Product {
833
+ id: string;
834
+ name: string;
835
+ }
836
+ interface Contract {
837
+ id: string;
838
+ }
839
+ /**
840
+ * The amount the customer should be billed for the commit. Not required.
841
+ */
842
+ interface InvoiceAmount {
843
+ credit_type_id: string;
844
+ quantity: number;
845
+ unit_price: number;
846
+ }
847
+ }
848
+ interface RecurringCredit {
849
+ id: string;
850
+ /**
851
+ * The amount of commit to grant.
852
+ */
853
+ access_amount: RecurringCredit.AccessAmount;
854
+ /**
855
+ * The amount of time the created commits will be valid for
856
+ */
857
+ commit_duration: RecurringCredit.CommitDuration;
858
+ /**
859
+ * Will be passed down to the individual commits
860
+ */
861
+ priority: number;
862
+ product: RecurringCredit.Product;
863
+ /**
864
+ * Whether the created commits will use the commit rate or list rate
865
+ */
866
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
867
+ /**
868
+ * Determines the start time for the first commit
869
+ */
870
+ starting_at: string;
871
+ /**
872
+ * Will be passed down to the individual commits
873
+ */
874
+ applicable_product_ids?: Array<string>;
875
+ /**
876
+ * Will be passed down to the individual commits
877
+ */
878
+ applicable_product_tags?: Array<string>;
879
+ contract?: RecurringCredit.Contract;
880
+ /**
881
+ * Will be passed down to the individual commits
882
+ */
883
+ description?: string;
884
+ /**
885
+ * Determines when the contract will stop creating recurring commits. Optional
886
+ */
887
+ ending_before?: string;
888
+ /**
889
+ * Optional configuration for recurring commit/credit hierarchy access control
890
+ */
891
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
892
+ /**
893
+ * Displayed on invoices. Will be passed through to the individual commits
894
+ */
895
+ name?: string;
896
+ /**
897
+ * Will be passed down to the individual commits
898
+ */
899
+ netsuite_sales_order_id?: string;
900
+ /**
901
+ * Determines whether the first and last commit will be prorated. If not provided,
902
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
903
+ */
904
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
905
+ /**
906
+ * The frequency at which the recurring commits will be created. If not provided: -
907
+ * The commits will be created on the usage invoice frequency. If provided: - The
908
+ * period defined in the duration will correspond to this frequency. - Commits will
909
+ * be created aligned with the recurring commit's starting_at rather than the usage
910
+ * invoice dates.
911
+ */
912
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
913
+ /**
914
+ * Will be passed down to the individual commits. This controls how much of an
915
+ * individual unexpired commit will roll over upon contract transition. Must be
916
+ * between 0 and 1.
917
+ */
918
+ rollover_fraction?: number;
919
+ /**
920
+ * List of filters that determine what kind of customer usage draws down a commit
921
+ * or credit. A customer's usage needs to meet the condition of at least one of the
922
+ * specifiers to contribute to a commit's or credit's drawdown.
923
+ */
924
+ specifiers?: Array<Shared.CommitSpecifier>;
925
+ /**
926
+ * Attach a subscription to the recurring commit/credit.
927
+ */
928
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
929
+ }
930
+ namespace RecurringCredit {
931
+ /**
932
+ * The amount of commit to grant.
933
+ */
934
+ interface AccessAmount {
935
+ credit_type_id: string;
936
+ unit_price: number;
937
+ quantity?: number;
938
+ }
939
+ /**
940
+ * The amount of time the created commits will be valid for
941
+ */
942
+ interface CommitDuration {
943
+ value: number;
944
+ unit?: 'PERIODS';
945
+ }
946
+ interface Product {
947
+ id: string;
948
+ name: string;
949
+ }
950
+ interface Contract {
951
+ id: string;
952
+ }
953
+ }
954
+ }
955
+ }
560
956
  }
561
957
  export interface ContractRetrieveResponse {
562
958
  data: Shared.Contract;
@@ -591,6 +987,134 @@ export declare namespace ContractGetNetBalanceResponse {
591
987
  }
592
988
  }
593
989
  export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
990
+ export interface ContractListSeatBalancesResponse {
991
+ data: Array<ContractListSeatBalancesResponse.Data>;
992
+ pagination: ContractListSeatBalancesResponse.Pagination;
993
+ }
994
+ export declare namespace ContractListSeatBalancesResponse {
995
+ interface Data {
996
+ balances: Array<Data.Balance>;
997
+ /**
998
+ * The unique identifier for the seat
999
+ */
1000
+ seat_id: string;
1001
+ /**
1002
+ * Array of commits applicable to this seat with their balances
1003
+ */
1004
+ commits?: Array<Data.Commit> | null;
1005
+ /**
1006
+ * Array of credits applicable to this seat with their balances
1007
+ */
1008
+ credits?: Array<Data.Credit>;
1009
+ }
1010
+ namespace Data {
1011
+ interface Balance {
1012
+ /**
1013
+ * The total balance across all commits and credits for this seat, of this credit
1014
+ * type.
1015
+ */
1016
+ balance: number;
1017
+ credit_type_id: string;
1018
+ /**
1019
+ * The total initial balances of all commits and credits for this seat, of this
1020
+ * credit type.
1021
+ */
1022
+ starting_balance: number;
1023
+ }
1024
+ interface Commit {
1025
+ /**
1026
+ * The commit or credit ID
1027
+ */
1028
+ id: string;
1029
+ /**
1030
+ * The current balance for this commit for this specific seat
1031
+ */
1032
+ balance: number;
1033
+ /**
1034
+ * The datetime when the commit becomes active
1035
+ */
1036
+ start_date: string;
1037
+ /**
1038
+ * The datetime when the commit expires
1039
+ */
1040
+ end_date?: string | null;
1041
+ /**
1042
+ * Transaction history for this commit for this seat (only included if
1043
+ * include_ledgers=true)
1044
+ */
1045
+ ledger_entries?: Array<Commit.LedgerEntry>;
1046
+ }
1047
+ namespace Commit {
1048
+ interface LedgerEntry {
1049
+ /**
1050
+ * Amount of the ledger entry
1051
+ */
1052
+ amount: number;
1053
+ /**
1054
+ * The datetime when the ledger is created
1055
+ */
1056
+ timestamp: string;
1057
+ /**
1058
+ * Commit ledger type
1059
+ */
1060
+ type: 'PREPAID_COMMIT_SEGMENT_START' | 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION' | 'PREPAID_COMMIT_ROLLOVER' | 'PREPAID_COMMIT_EXPIRATION' | 'PREPAID_COMMIT_CANCELED' | 'PREPAID_COMMIT_CREDITED' | 'PREPAID_COMMIT_MANUAL' | 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
1061
+ }
1062
+ }
1063
+ interface Credit {
1064
+ /**
1065
+ * The credit ID
1066
+ */
1067
+ id: string;
1068
+ /**
1069
+ * The current balance for this credit for this specific seat
1070
+ */
1071
+ balance: number;
1072
+ /**
1073
+ * The datetime when the credit becomes active
1074
+ */
1075
+ start_date: string;
1076
+ /**
1077
+ * The datetime when the credit expires
1078
+ */
1079
+ end_date?: string | null;
1080
+ /**
1081
+ * Transaction history for this credit for this seat (only included if
1082
+ * include_ledgers=true)
1083
+ */
1084
+ ledger_entries?: Array<Credit.LedgerEntry>;
1085
+ }
1086
+ namespace Credit {
1087
+ interface LedgerEntry {
1088
+ /**
1089
+ * Amount of the ledger entry
1090
+ */
1091
+ amount: number;
1092
+ /**
1093
+ * The datetime when the ledger is created
1094
+ */
1095
+ timestamp: string;
1096
+ /**
1097
+ * Credit ledger type
1098
+ */
1099
+ type: 'CREDIT_SEGMENT_START' | 'CREDIT_AUTOMATED_INVOICE_DEDUCTION' | 'CREDIT_EXPIRATION' | 'CREDIT_CANCELED' | 'CREDIT_CREDITED' | 'CREDIT_MANUAL' | 'CREDIT_SEAT_BASED_ADJUSTMENT' | 'CREDIT_ROLLOVER';
1100
+ }
1101
+ }
1102
+ }
1103
+ interface Pagination {
1104
+ /**
1105
+ * Number of seats available to fetch in the next page
1106
+ */
1107
+ seats_available_for_next_page: number;
1108
+ /**
1109
+ * Number of seats included in this response
1110
+ */
1111
+ seats_included: number;
1112
+ /**
1113
+ * Token to retrieve the next page of results. Null if no more pages available
1114
+ */
1115
+ next_page?: string | null;
1116
+ }
1117
+ }
594
1118
  export interface ContractRetrieveRateScheduleResponse {
595
1119
  data: Array<ContractRetrieveRateScheduleResponse.Data>;
596
1120
  next_page?: string | null;
@@ -702,7 +1226,7 @@ export interface ContractCreateParams {
702
1226
  /**
703
1227
  * If provided, provisions a customer on a package instead of creating a
704
1228
  * traditional contract. When specified, only customer_id, starting_at, package_id,
705
- * and uniqueness_key are allowed.
1229
+ * uniqueness_key, transition, and custom_fields are allowed.
706
1230
  */
707
1231
  package_id?: string;
708
1232
  prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
@@ -741,6 +1265,11 @@ export interface ContractCreateParams {
741
1265
  */
742
1266
  scheduled_charges_on_usage_invoices?: 'ALL';
743
1267
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1268
+ /**
1269
+ * Spend trackers to attach to this contract. Aliases must be unique within a
1270
+ * contract.
1271
+ */
1272
+ spend_trackers?: Array<ContractCreateParams.SpendTracker>;
744
1273
  /**
745
1274
  * Optional list of
746
1275
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -836,10 +1365,6 @@ export declare namespace ContractCreateParams {
836
1365
  * This field's availability is dependent on your client's configuration.
837
1366
  */
838
1367
  netsuite_sales_order_id?: string;
839
- /**
840
- * optionally payment gate this commit
841
- */
842
- payment_gate_config?: Commit.PaymentGateConfig;
843
1368
  /**
844
1369
  * If multiple commits are applicable, the one with the lower priority will apply
845
1370
  * first.
@@ -857,6 +1382,10 @@ export declare namespace ContractCreateParams {
857
1382
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
858
1383
  */
859
1384
  specifiers?: Array<Shared.CommitSpecifierInput>;
1385
+ /**
1386
+ * Optional attributes for spend tracker integration. Immutable after creation.
1387
+ */
1388
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
860
1389
  /**
861
1390
  * A temporary ID for the commit that can be used to reference the commit for
862
1391
  * commit specific overrides.
@@ -978,74 +1507,14 @@ export declare namespace ContractCreateParams {
978
1507
  }
979
1508
  }
980
1509
  /**
981
- * optionally payment gate this commit
1510
+ * Optional attributes for spend tracker integration. Immutable after creation.
982
1511
  */
983
- interface PaymentGateConfig {
1512
+ interface SpendTrackerAttributes {
984
1513
  /**
985
- * Gate access to the commit balance based on successful collection of payment.
986
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
987
- * facilitate payment using your own payment integration. Select NONE if you do not
988
- * wish to payment gate the commit balance.
1514
+ * If true, this commit will be included in spend trackers with discounted set to
1515
+ * DISCOUNTED_ONLY
989
1516
  */
990
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
991
- /**
992
- * Only applicable if using PRECALCULATED as your tax type.
993
- */
994
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
995
- /**
996
- * Only applicable if using STRIPE as your payment gate type.
997
- */
998
- stripe_config?: PaymentGateConfig.StripeConfig;
999
- /**
1000
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1001
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1002
- * will default to NONE.
1003
- */
1004
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1005
- }
1006
- namespace PaymentGateConfig {
1007
- /**
1008
- * Only applicable if using PRECALCULATED as your tax type.
1009
- */
1010
- interface PrecalculatedTaxConfig {
1011
- /**
1012
- * Amount of tax to be applied. This should be in the same currency and
1013
- * denomination as the commit's invoice schedule
1014
- */
1015
- tax_amount: number;
1016
- /**
1017
- * Name of the tax to be applied. This may be used in an invoice line item
1018
- * description.
1019
- */
1020
- tax_name?: string;
1021
- }
1022
- /**
1023
- * Only applicable if using STRIPE as your payment gate type.
1024
- */
1025
- interface StripeConfig {
1026
- /**
1027
- * If left blank, will default to INVOICE
1028
- */
1029
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1030
- /**
1031
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1032
- * your payment type.
1033
- */
1034
- invoice_metadata?: {
1035
- [key: string]: string;
1036
- };
1037
- /**
1038
- * If true, the payment will be made assuming the customer is present (i.e. on
1039
- * session).
1040
- *
1041
- * If false, the payment will be made assuming the customer is not present (i.e.
1042
- * off session). For cardholders from a country with an e-mandate requirement (e.g.
1043
- * India), the payment may be declined.
1044
- *
1045
- * If left blank, will default to false.
1046
- */
1047
- on_session_payment?: boolean;
1048
- }
1517
+ counts_as_discounted: boolean;
1049
1518
  }
1050
1519
  }
1051
1520
  interface Credit {
@@ -1885,6 +2354,25 @@ export declare namespace ContractCreateParams {
1885
2354
  }
1886
2355
  }
1887
2356
  }
2357
+ interface SpendTracker {
2358
+ /**
2359
+ * Human-readable identifier, unique per contract.
2360
+ */
2361
+ alias: string;
2362
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
2363
+ credit_type_id: string;
2364
+ reset_frequency: 'BILLING_PERIOD';
2365
+ }
2366
+ namespace SpendTracker {
2367
+ interface ApplicableSpendSpecifier {
2368
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
2369
+ spend_type: 'COMMIT_PURCHASE';
2370
+ /**
2371
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
2372
+ */
2373
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
2374
+ }
2375
+ }
1888
2376
  interface Subscription {
1889
2377
  collection_schedule: 'ADVANCE' | 'ARREARS';
1890
2378
  proration: Subscription.Proration;
@@ -2201,10 +2689,6 @@ export declare namespace ContractAmendParams {
2201
2689
  * This field's availability is dependent on your client's configuration.
2202
2690
  */
2203
2691
  netsuite_sales_order_id?: string;
2204
- /**
2205
- * optionally payment gate this commit
2206
- */
2207
- payment_gate_config?: Commit.PaymentGateConfig;
2208
2692
  /**
2209
2693
  * If multiple commits are applicable, the one with the lower priority will apply
2210
2694
  * first.
@@ -2222,6 +2706,10 @@ export declare namespace ContractAmendParams {
2222
2706
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
2223
2707
  */
2224
2708
  specifiers?: Array<Shared.CommitSpecifierInput>;
2709
+ /**
2710
+ * Optional attributes for spend tracker integration. Immutable after creation.
2711
+ */
2712
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
2225
2713
  /**
2226
2714
  * A temporary ID for the commit that can be used to reference the commit for
2227
2715
  * commit specific overrides.
@@ -2343,74 +2831,14 @@ export declare namespace ContractAmendParams {
2343
2831
  }
2344
2832
  }
2345
2833
  /**
2346
- * optionally payment gate this commit
2834
+ * Optional attributes for spend tracker integration. Immutable after creation.
2347
2835
  */
2348
- interface PaymentGateConfig {
2349
- /**
2350
- * Gate access to the commit balance based on successful collection of payment.
2351
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2352
- * facilitate payment using your own payment integration. Select NONE if you do not
2353
- * wish to payment gate the commit balance.
2354
- */
2355
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2836
+ interface SpendTrackerAttributes {
2356
2837
  /**
2357
- * Only applicable if using PRECALCULATED as your tax type.
2838
+ * If true, this commit will be included in spend trackers with discounted set to
2839
+ * DISCOUNTED_ONLY
2358
2840
  */
2359
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2360
- /**
2361
- * Only applicable if using STRIPE as your payment gate type.
2362
- */
2363
- stripe_config?: PaymentGateConfig.StripeConfig;
2364
- /**
2365
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2366
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2367
- * will default to NONE.
2368
- */
2369
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2370
- }
2371
- namespace PaymentGateConfig {
2372
- /**
2373
- * Only applicable if using PRECALCULATED as your tax type.
2374
- */
2375
- interface PrecalculatedTaxConfig {
2376
- /**
2377
- * Amount of tax to be applied. This should be in the same currency and
2378
- * denomination as the commit's invoice schedule
2379
- */
2380
- tax_amount: number;
2381
- /**
2382
- * Name of the tax to be applied. This may be used in an invoice line item
2383
- * description.
2384
- */
2385
- tax_name?: string;
2386
- }
2387
- /**
2388
- * Only applicable if using STRIPE as your payment gate type.
2389
- */
2390
- interface StripeConfig {
2391
- /**
2392
- * If left blank, will default to INVOICE
2393
- */
2394
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2395
- /**
2396
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2397
- * your payment type.
2398
- */
2399
- invoice_metadata?: {
2400
- [key: string]: string;
2401
- };
2402
- /**
2403
- * If true, the payment will be made assuming the customer is present (i.e. on
2404
- * session).
2405
- *
2406
- * If false, the payment will be made assuming the customer is not present (i.e.
2407
- * off session). For cardholders from a country with an e-mandate requirement (e.g.
2408
- * India), the payment may be declined.
2409
- *
2410
- * If left blank, will default to false.
2411
- */
2412
- on_session_payment?: boolean;
2413
- }
2841
+ counts_as_discounted: boolean;
2414
2842
  }
2415
2843
  }
2416
2844
  interface Credit {
@@ -3034,6 +3462,64 @@ export interface ContractListBalancesParams extends BodyCursorPageParams {
3034
3462
  */
3035
3463
  starting_at?: string;
3036
3464
  }
3465
+ export interface ContractListSeatBalancesParams {
3466
+ /**
3467
+ * The contract ID to retrieve seat balances for
3468
+ */
3469
+ contract_id: string;
3470
+ /**
3471
+ * The customer ID to retrieve seat balances for
3472
+ */
3473
+ customer_id: string;
3474
+ /**
3475
+ * Include only commits or credits with access that cover this specific date
3476
+ * (cannot be used with starting_at or ending_before).
3477
+ */
3478
+ covering_date?: string;
3479
+ /**
3480
+ * Page token from a previous response to retrieve the next page
3481
+ */
3482
+ cursor?: string;
3483
+ /**
3484
+ * Include only commits or credits with access effective on or before this date
3485
+ * (cannot be used with covering_date).
3486
+ */
3487
+ effective_before?: string;
3488
+ /**
3489
+ * Include credits and commits in the response
3490
+ */
3491
+ include_credits_and_commits?: boolean;
3492
+ /**
3493
+ * Include ledger entries for each commit and commit. `include_credits_and_commits`
3494
+ * must be set to `true` for `include_ledgers=true` to apply.
3495
+ */
3496
+ include_ledgers?: boolean;
3497
+ /**
3498
+ * Maximum number of seats to return. Range: 1-100. Default: 25. When
3499
+ * `include_credits_and_commits = true`, if the total commits/credits across all
3500
+ * seats exceeds 100, a limit of 100 applies to the total credits and commits.
3501
+ * Seats are included greedily to maximize the number of seats returned. Example:
3502
+ * if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned
3503
+ * (total: 108 commits). Each returned seat includes all of its associated credits
3504
+ * and commits.
3505
+ */
3506
+ limit?: number;
3507
+ /**
3508
+ * Optional filter to only include specific seats.
3509
+ */
3510
+ seat_ids?: Array<string>;
3511
+ /**
3512
+ * Include only commits or credits with access effective on or after this date
3513
+ * (cannot be used with covering_date).
3514
+ */
3515
+ starting_at?: string;
3516
+ /**
3517
+ * Optional filter to only include seats from specific subscriptions. If
3518
+ * subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be
3519
+ * returned.
3520
+ */
3521
+ subscription_ids?: Array<string>;
3522
+ }
3037
3523
  export interface ContractRetrieveRateScheduleParams {
3038
3524
  /**
3039
3525
  * Body param: ID of the contract to get the rate schedule for.
@@ -3188,7 +3674,7 @@ export interface ContractUpdateEndDateParams {
3188
3674
  ending_before?: string;
3189
3675
  }
3190
3676
  export declare namespace Contracts {
3191
- 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 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 ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
3677
+ 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, };
3192
3678
  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, };
3193
3679
  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, };
3194
3680
  export { NamedSchedules as NamedSchedules, type NamedScheduleRetrieveResponse as NamedScheduleRetrieveResponse, type NamedScheduleRetrieveParams as NamedScheduleRetrieveParams, type NamedScheduleUpdateParams as NamedScheduleUpdateParams, };