@metronome/sdk 0.1.0-beta.8 → 0.1.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 (485) hide show
  1. package/CHANGELOG.md +227 -0
  2. package/README.md +37 -52
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +25 -15
  9. package/core.js.map +1 -1
  10. package/core.mjs +26 -16
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +10 -42
  13. package/index.d.ts +10 -42
  14. package/index.d.ts.map +1 -1
  15. package/index.js +14 -55
  16. package/index.js.map +1 -1
  17. package/index.mjs +14 -55
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/pagination.d.ts +1 -0
  21. package/pagination.d.ts.map +1 -1
  22. package/pagination.js +3 -0
  23. package/pagination.js.map +1 -1
  24. package/pagination.mjs +3 -0
  25. package/pagination.mjs.map +1 -1
  26. package/resource.d.ts +1 -1
  27. package/resource.d.ts.map +1 -1
  28. package/resource.js.map +1 -1
  29. package/resource.mjs.map +1 -1
  30. package/resources/index.d.ts +2 -13
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js +5 -38
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs +2 -13
  35. package/resources/index.mjs.map +1 -1
  36. package/resources/shared.d.ts +512 -24
  37. package/resources/shared.d.ts.map +1 -1
  38. package/resources/{alerts.d.ts → v1/alerts.d.ts} +29 -5
  39. package/resources/v1/alerts.d.ts.map +1 -0
  40. package/resources/v1/alerts.js +40 -0
  41. package/resources/v1/alerts.js.map +1 -0
  42. package/resources/v1/alerts.mjs +36 -0
  43. package/resources/v1/alerts.mjs.map +1 -0
  44. package/resources/{audit-logs.d.ts → v1/audit-logs.d.ts} +11 -3
  45. package/resources/v1/audit-logs.d.ts.map +1 -0
  46. package/resources/{audit-logs.js → v1/audit-logs.js} +4 -4
  47. package/resources/v1/audit-logs.js.map +1 -0
  48. package/resources/{audit-logs.mjs → v1/audit-logs.mjs} +4 -4
  49. package/resources/v1/audit-logs.mjs.map +1 -0
  50. package/resources/{billable-metrics.d.ts → v1/billable-metrics.d.ts} +62 -7
  51. package/resources/v1/billable-metrics.d.ts.map +1 -0
  52. package/resources/v1/billable-metrics.js +84 -0
  53. package/resources/v1/billable-metrics.js.map +1 -0
  54. package/resources/v1/billable-metrics.mjs +79 -0
  55. package/resources/v1/billable-metrics.mjs.map +1 -0
  56. package/resources/{contracts → v1/contracts}/contracts.d.ts +1618 -62
  57. package/resources/v1/contracts/contracts.d.ts.map +1 -0
  58. package/resources/v1/contracts/contracts.js +312 -0
  59. package/resources/v1/contracts/contracts.js.map +1 -0
  60. package/resources/v1/contracts/contracts.mjs +285 -0
  61. package/resources/v1/contracts/contracts.mjs.map +1 -0
  62. package/resources/v1/contracts/index.d.ts +5 -0
  63. package/resources/v1/contracts/index.d.ts.map +1 -0
  64. package/resources/v1/contracts/index.js.map +1 -0
  65. package/resources/v1/contracts/index.mjs.map +1 -0
  66. package/resources/{contracts → v1/contracts}/named-schedules.d.ts +23 -2
  67. package/resources/v1/contracts/named-schedules.d.ts.map +1 -0
  68. package/resources/v1/contracts/named-schedules.js +48 -0
  69. package/resources/v1/contracts/named-schedules.js.map +1 -0
  70. package/resources/v1/contracts/named-schedules.mjs +44 -0
  71. package/resources/v1/contracts/named-schedules.mjs.map +1 -0
  72. package/resources/{contracts → v1/contracts}/products.d.ts +55 -7
  73. package/resources/v1/contracts/products.d.ts.map +1 -0
  74. package/resources/v1/contracts/products.js +84 -0
  75. package/resources/v1/contracts/products.js.map +1 -0
  76. package/resources/v1/contracts/products.mjs +79 -0
  77. package/resources/v1/contracts/products.mjs.map +1 -0
  78. package/resources/{contracts → v1/contracts}/rate-cards/index.d.ts +1 -1
  79. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -0
  80. package/resources/v1/contracts/rate-cards/index.js.map +1 -0
  81. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -0
  82. package/resources/{contracts → v1/contracts}/rate-cards/named-schedules.d.ts +27 -2
  83. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -0
  84. package/resources/v1/contracts/rate-cards/named-schedules.js +52 -0
  85. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -0
  86. package/resources/v1/contracts/rate-cards/named-schedules.mjs +48 -0
  87. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -0
  88. package/resources/{contracts → v1/contracts}/rate-cards/product-orders.d.ts +33 -3
  89. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -0
  90. package/resources/v1/contracts/rate-cards/product-orders.js +54 -0
  91. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -0
  92. package/resources/v1/contracts/rate-cards/product-orders.mjs +50 -0
  93. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -0
  94. package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.d.ts +118 -14
  95. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -0
  96. package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.js +83 -12
  97. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -0
  98. package/resources/v1/contracts/rate-cards/rate-cards.mjs +140 -0
  99. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -0
  100. package/resources/{contracts → v1/contracts}/rate-cards/rates.d.ts +118 -14
  101. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -0
  102. package/resources/v1/contracts/rate-cards/rates.js +106 -0
  103. package/resources/v1/contracts/rate-cards/rates.js.map +1 -0
  104. package/resources/v1/contracts/rate-cards/rates.mjs +101 -0
  105. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -0
  106. package/resources/v1/contracts/rate-cards.d.ts +2 -0
  107. package/resources/v1/contracts/rate-cards.d.ts.map +1 -0
  108. package/resources/v1/contracts/rate-cards.js +19 -0
  109. package/resources/v1/contracts/rate-cards.js.map +1 -0
  110. package/resources/v1/contracts/rate-cards.mjs +3 -0
  111. package/resources/v1/contracts/rate-cards.mjs.map +1 -0
  112. package/resources/v1/contracts.d.ts +2 -0
  113. package/resources/v1/contracts.d.ts.map +1 -0
  114. package/resources/v1/contracts.js +19 -0
  115. package/resources/v1/contracts.js.map +1 -0
  116. package/resources/v1/contracts.mjs +3 -0
  117. package/resources/v1/contracts.mjs.map +1 -0
  118. package/resources/{credit-grants.d.ts → v1/credit-grants.d.ts} +81 -6
  119. package/resources/v1/credit-grants.d.ts.map +1 -0
  120. package/resources/v1/credit-grants.js +89 -0
  121. package/resources/v1/credit-grants.js.map +1 -0
  122. package/resources/v1/credit-grants.mjs +84 -0
  123. package/resources/v1/credit-grants.mjs.map +1 -0
  124. package/resources/{custom-fields.d.ts → v1/custom-fields.d.ts} +53 -9
  125. package/resources/v1/custom-fields.d.ts.map +1 -0
  126. package/resources/{custom-fields.js → v1/custom-fields.js} +42 -7
  127. package/resources/v1/custom-fields.js.map +1 -0
  128. package/resources/{custom-fields.mjs → v1/custom-fields.mjs} +42 -7
  129. package/resources/v1/custom-fields.mjs.map +1 -0
  130. package/resources/{customers → v1/customers}/alerts.d.ts +31 -3
  131. package/resources/v1/customers/alerts.d.ts.map +1 -0
  132. package/resources/v1/customers/alerts.js +56 -0
  133. package/resources/v1/customers/alerts.js.map +1 -0
  134. package/resources/v1/customers/alerts.mjs +52 -0
  135. package/resources/v1/customers/alerts.mjs.map +1 -0
  136. package/resources/{customers → v1/customers}/billing-config.d.ts +33 -2
  137. package/resources/v1/customers/billing-config.d.ts.map +1 -0
  138. package/resources/v1/customers/billing-config.js +65 -0
  139. package/resources/v1/customers/billing-config.js.map +1 -0
  140. package/resources/v1/customers/billing-config.mjs +61 -0
  141. package/resources/v1/customers/billing-config.mjs.map +1 -0
  142. package/resources/{customers → v1/customers}/commits.d.ts +97 -10
  143. package/resources/v1/customers/commits.d.ts.map +1 -0
  144. package/resources/v1/customers/commits.js +82 -0
  145. package/resources/v1/customers/commits.js.map +1 -0
  146. package/resources/v1/customers/commits.mjs +78 -0
  147. package/resources/v1/customers/commits.mjs.map +1 -0
  148. package/resources/{customers → v1/customers}/credits.d.ts +76 -6
  149. package/resources/v1/customers/credits.d.ts.map +1 -0
  150. package/resources/v1/customers/credits.js +67 -0
  151. package/resources/v1/customers/credits.js.map +1 -0
  152. package/resources/v1/customers/credits.mjs +63 -0
  153. package/resources/v1/customers/credits.mjs.map +1 -0
  154. package/resources/{customers → v1/customers}/customers.d.ts +197 -14
  155. package/resources/v1/customers/customers.d.ts.map +1 -0
  156. package/resources/{customers → v1/customers}/customers.js +118 -16
  157. package/resources/v1/customers/customers.js.map +1 -0
  158. package/resources/v1/customers/customers.mjs +228 -0
  159. package/resources/v1/customers/customers.mjs.map +1 -0
  160. package/resources/{customers → v1/customers}/index.d.ts +1 -1
  161. package/resources/v1/customers/index.d.ts.map +1 -0
  162. package/resources/v1/customers/index.js.map +1 -0
  163. package/resources/v1/customers/index.mjs.map +1 -0
  164. package/resources/{customers → v1/customers}/invoices.d.ts +152 -57
  165. package/resources/v1/customers/invoices.d.ts.map +1 -0
  166. package/resources/v1/customers/invoices.js +103 -0
  167. package/resources/v1/customers/invoices.js.map +1 -0
  168. package/resources/v1/customers/invoices.mjs +97 -0
  169. package/resources/v1/customers/invoices.mjs.map +1 -0
  170. package/resources/{customers → v1/customers}/named-schedules.d.ts +23 -2
  171. package/resources/v1/customers/named-schedules.d.ts.map +1 -0
  172. package/resources/v1/customers/named-schedules.js +48 -0
  173. package/resources/v1/customers/named-schedules.js.map +1 -0
  174. package/resources/v1/customers/named-schedules.mjs +44 -0
  175. package/resources/v1/customers/named-schedules.mjs.map +1 -0
  176. package/resources/{customers → v1/customers}/plans.d.ts +50 -5
  177. package/resources/v1/customers/plans.d.ts.map +1 -0
  178. package/resources/v1/customers/plans.js +99 -0
  179. package/resources/v1/customers/plans.js.map +1 -0
  180. package/resources/v1/customers/plans.mjs +93 -0
  181. package/resources/v1/customers/plans.mjs.map +1 -0
  182. package/resources/v1/customers.d.ts +2 -0
  183. package/resources/v1/customers.d.ts.map +1 -0
  184. package/resources/v1/customers.js +19 -0
  185. package/resources/v1/customers.js.map +1 -0
  186. package/resources/v1/customers.mjs +3 -0
  187. package/resources/v1/customers.mjs.map +1 -0
  188. package/resources/{dashboards.d.ts → v1/dashboards.d.ts} +32 -4
  189. package/resources/v1/dashboards.d.ts.map +1 -0
  190. package/resources/v1/dashboards.js +43 -0
  191. package/resources/v1/dashboards.js.map +1 -0
  192. package/resources/v1/dashboards.mjs +39 -0
  193. package/resources/v1/dashboards.mjs.map +1 -0
  194. package/resources/v1/index.d.ts +15 -0
  195. package/resources/v1/index.d.ts.map +1 -0
  196. package/resources/v1/index.js +44 -0
  197. package/resources/v1/index.js.map +1 -0
  198. package/resources/v1/index.mjs +16 -0
  199. package/resources/v1/index.mjs.map +1 -0
  200. package/resources/{invoices.d.ts → v1/invoices.d.ts} +16 -2
  201. package/resources/v1/invoices.d.ts.map +1 -0
  202. package/resources/v1/invoices.js +35 -0
  203. package/resources/v1/invoices.js.map +1 -0
  204. package/resources/v1/invoices.mjs +31 -0
  205. package/resources/v1/invoices.mjs.map +1 -0
  206. package/resources/{plans.d.ts → v1/plans.d.ts} +51 -8
  207. package/resources/v1/plans.d.ts.map +1 -0
  208. package/resources/{plans.js → v1/plans.js} +34 -7
  209. package/resources/v1/plans.js.map +1 -0
  210. package/resources/v1/plans.mjs +74 -0
  211. package/resources/v1/plans.mjs.map +1 -0
  212. package/resources/{pricing-units.d.ts → v1/pricing-units.d.ts} +11 -3
  213. package/resources/v1/pricing-units.d.ts.map +1 -0
  214. package/resources/{pricing-units.js → v1/pricing-units.js} +4 -4
  215. package/resources/v1/pricing-units.js.map +1 -0
  216. package/resources/{pricing-units.mjs → v1/pricing-units.mjs} +4 -4
  217. package/resources/v1/pricing-units.mjs.map +1 -0
  218. package/resources/{services.d.ts → v1/services.d.ts} +7 -2
  219. package/resources/v1/services.d.ts.map +1 -0
  220. package/resources/{services.js → v1/services.js} +7 -2
  221. package/resources/v1/services.js.map +1 -0
  222. package/resources/{services.mjs → v1/services.mjs} +7 -2
  223. package/resources/v1/services.mjs.map +1 -0
  224. package/resources/v1/usage.d.ts +325 -0
  225. package/resources/v1/usage.d.ts.map +1 -0
  226. package/resources/v1/usage.js +92 -0
  227. package/resources/v1/usage.js.map +1 -0
  228. package/resources/v1/usage.mjs +87 -0
  229. package/resources/v1/usage.mjs.map +1 -0
  230. package/resources/v1/v1.d.ts +58 -0
  231. package/resources/v1/v1.d.ts.map +1 -0
  232. package/resources/v1/v1.js +98 -0
  233. package/resources/v1/v1.js.map +1 -0
  234. package/resources/v1/v1.mjs +71 -0
  235. package/resources/v1/v1.mjs.map +1 -0
  236. package/resources/v1.d.ts +2 -0
  237. package/resources/v1.d.ts.map +1 -0
  238. package/resources/v1.js +19 -0
  239. package/resources/v1.js.map +1 -0
  240. package/resources/v1.mjs +3 -0
  241. package/resources/v1.mjs.map +1 -0
  242. package/resources/v2/contracts.d.ts +5955 -0
  243. package/resources/v2/contracts.d.ts.map +1 -0
  244. package/resources/v2/contracts.js +136 -0
  245. package/resources/v2/contracts.js.map +1 -0
  246. package/resources/v2/contracts.mjs +132 -0
  247. package/resources/v2/contracts.mjs.map +1 -0
  248. package/resources/v2/index.d.ts +3 -0
  249. package/resources/v2/index.d.ts.map +1 -0
  250. package/resources/v2/index.js +9 -0
  251. package/resources/v2/index.js.map +1 -0
  252. package/resources/v2/index.mjs +4 -0
  253. package/resources/v2/index.mjs.map +1 -0
  254. package/resources/v2/v2.d.ts +10 -0
  255. package/resources/v2/v2.d.ts.map +1 -0
  256. package/resources/v2/v2.js +39 -0
  257. package/resources/v2/v2.js.map +1 -0
  258. package/resources/v2/v2.mjs +12 -0
  259. package/resources/v2/v2.mjs.map +1 -0
  260. package/resources/v2.d.ts +2 -0
  261. package/resources/v2.d.ts.map +1 -0
  262. package/resources/v2.js +19 -0
  263. package/resources/v2.js.map +1 -0
  264. package/resources/v2.mjs +3 -0
  265. package/resources/v2.mjs.map +1 -0
  266. package/resources/webhooks.js +5 -5
  267. package/resources/webhooks.js.map +1 -1
  268. package/resources/webhooks.mjs +5 -5
  269. package/resources/webhooks.mjs.map +1 -1
  270. package/resources.d.ts +2 -0
  271. package/resources.d.ts.map +1 -0
  272. package/resources.js +18 -0
  273. package/resources.js.map +1 -0
  274. package/resources.mjs +2 -0
  275. package/resources.mjs.map +1 -0
  276. package/src/_shims/auto/runtime-bun.ts +1 -1
  277. package/src/_shims/auto/runtime-node.ts +1 -1
  278. package/src/_shims/auto/runtime.ts +1 -1
  279. package/src/_shims/auto/types-node.ts +1 -1
  280. package/src/_shims/bun-runtime.ts +2 -2
  281. package/src/_shims/index.d.ts +5 -3
  282. package/src/_shims/index.js +5 -1
  283. package/src/_shims/index.mjs +6 -2
  284. package/src/_shims/node-runtime.ts +3 -3
  285. package/src/_shims/registry.ts +1 -1
  286. package/src/_shims/web-runtime.ts +3 -3
  287. package/src/core.ts +49 -21
  288. package/src/error.ts +1 -1
  289. package/src/index.ts +31 -349
  290. package/src/internal/qs/formats.ts +1 -1
  291. package/src/internal/qs/index.ts +3 -3
  292. package/src/internal/qs/stringify.ts +3 -3
  293. package/src/internal/qs/utils.ts +2 -2
  294. package/src/pagination.ts +5 -1
  295. package/src/resource.ts +2 -2
  296. package/src/resources/index.ts +4 -144
  297. package/src/resources/shared.ts +587 -26
  298. package/src/resources/{alerts.ts → v1/alerts.ts} +31 -7
  299. package/src/resources/{audit-logs.ts → v1/audit-logs.ts} +13 -5
  300. package/src/resources/{billable-metrics.ts → v1/billable-metrics.ts} +61 -12
  301. package/src/resources/{contracts → v1/contracts}/contracts.ts +1848 -83
  302. package/src/resources/{contracts → v1/contracts}/index.ts +8 -4
  303. package/src/resources/{contracts → v1/contracts}/named-schedules.ts +25 -4
  304. package/src/resources/{contracts → v1/contracts}/products.ts +58 -14
  305. package/src/resources/{contracts → v1/contracts}/rate-cards/index.ts +6 -4
  306. package/src/resources/{contracts → v1/contracts}/rate-cards/named-schedules.ts +29 -4
  307. package/src/resources/{contracts → v1/contracts}/rate-cards/product-orders.ts +38 -5
  308. package/src/resources/{contracts → v1/contracts}/rate-cards/rate-cards.ts +137 -25
  309. package/src/resources/{contracts → v1/contracts}/rate-cards/rates.ts +105 -17
  310. package/src/resources/v1/contracts/rate-cards.ts +3 -0
  311. package/src/resources/v1/contracts.ts +3 -0
  312. package/src/resources/{credit-grants.ts → v1/credit-grants.ts} +86 -14
  313. package/src/resources/{custom-fields.ts → v1/custom-fields.ts} +62 -14
  314. package/src/resources/{customers → v1/customers}/alerts.ts +35 -6
  315. package/src/resources/{customers → v1/customers}/billing-config.ts +37 -5
  316. package/src/resources/{customers → v1/customers}/commits.ts +100 -13
  317. package/src/resources/{customers → v1/customers}/credits.ts +79 -9
  318. package/src/resources/{customers → v1/customers}/customers.ts +229 -40
  319. package/src/resources/{customers → v1/customers}/index.ts +10 -8
  320. package/src/resources/{customers → v1/customers}/invoices.ts +131 -62
  321. package/src/resources/{customers → v1/customers}/named-schedules.ts +25 -4
  322. package/src/resources/{customers → v1/customers}/plans.ts +55 -9
  323. package/src/resources/v1/customers.ts +3 -0
  324. package/src/resources/{dashboards.ts → v1/dashboards.ts} +31 -5
  325. package/src/resources/v1/index.ts +151 -0
  326. package/src/resources/{invoices.ts → v1/invoices.ts} +18 -4
  327. package/src/resources/{plans.ts → v1/plans.ts} +49 -14
  328. package/src/resources/{pricing-units.ts → v1/pricing-units.ts} +13 -5
  329. package/src/resources/{services.ts → v1/services.ts} +8 -3
  330. package/src/resources/v1/usage.ts +429 -0
  331. package/src/resources/v1/v1.ts +364 -0
  332. package/src/resources/v1.ts +3 -0
  333. package/src/resources/v2/contracts.ts +7677 -0
  334. package/src/resources/v2/index.ts +18 -0
  335. package/src/resources/v2/v2.ts +43 -0
  336. package/src/resources/v2.ts +3 -0
  337. package/src/resources/webhooks.ts +7 -7
  338. package/src/resources.ts +1 -0
  339. package/src/shims/node.ts +3 -3
  340. package/src/shims/web.ts +3 -3
  341. package/src/uploads.ts +4 -4
  342. package/src/version.ts +1 -1
  343. package/version.d.ts +1 -1
  344. package/version.d.ts.map +1 -1
  345. package/version.js +1 -1
  346. package/version.js.map +1 -1
  347. package/version.mjs +1 -1
  348. package/version.mjs.map +1 -1
  349. package/resources/alerts.d.ts.map +0 -1
  350. package/resources/alerts.js +0 -21
  351. package/resources/alerts.js.map +0 -1
  352. package/resources/alerts.mjs +0 -17
  353. package/resources/alerts.mjs.map +0 -1
  354. package/resources/audit-logs.d.ts.map +0 -1
  355. package/resources/audit-logs.js.map +0 -1
  356. package/resources/audit-logs.mjs.map +0 -1
  357. package/resources/billable-metrics.d.ts.map +0 -1
  358. package/resources/billable-metrics.js +0 -43
  359. package/resources/billable-metrics.js.map +0 -1
  360. package/resources/billable-metrics.mjs +0 -38
  361. package/resources/billable-metrics.mjs.map +0 -1
  362. package/resources/contracts/contracts.d.ts.map +0 -1
  363. package/resources/contracts/contracts.js +0 -135
  364. package/resources/contracts/contracts.js.map +0 -1
  365. package/resources/contracts/contracts.mjs +0 -108
  366. package/resources/contracts/contracts.mjs.map +0 -1
  367. package/resources/contracts/index.d.ts +0 -5
  368. package/resources/contracts/index.d.ts.map +0 -1
  369. package/resources/contracts/index.js.map +0 -1
  370. package/resources/contracts/index.mjs.map +0 -1
  371. package/resources/contracts/named-schedules.d.ts.map +0 -1
  372. package/resources/contracts/named-schedules.js +0 -27
  373. package/resources/contracts/named-schedules.js.map +0 -1
  374. package/resources/contracts/named-schedules.mjs +0 -23
  375. package/resources/contracts/named-schedules.mjs.map +0 -1
  376. package/resources/contracts/products.d.ts.map +0 -1
  377. package/resources/contracts/products.js +0 -51
  378. package/resources/contracts/products.js.map +0 -1
  379. package/resources/contracts/products.mjs +0 -46
  380. package/resources/contracts/products.mjs.map +0 -1
  381. package/resources/contracts/rate-cards/index.d.ts.map +0 -1
  382. package/resources/contracts/rate-cards/index.js.map +0 -1
  383. package/resources/contracts/rate-cards/index.mjs.map +0 -1
  384. package/resources/contracts/rate-cards/named-schedules.d.ts.map +0 -1
  385. package/resources/contracts/rate-cards/named-schedules.js +0 -27
  386. package/resources/contracts/rate-cards/named-schedules.js.map +0 -1
  387. package/resources/contracts/rate-cards/named-schedules.mjs +0 -23
  388. package/resources/contracts/rate-cards/named-schedules.mjs.map +0 -1
  389. package/resources/contracts/rate-cards/product-orders.d.ts.map +0 -1
  390. package/resources/contracts/rate-cards/product-orders.js +0 -21
  391. package/resources/contracts/rate-cards/product-orders.js.map +0 -1
  392. package/resources/contracts/rate-cards/product-orders.mjs +0 -17
  393. package/resources/contracts/rate-cards/product-orders.mjs.map +0 -1
  394. package/resources/contracts/rate-cards/rate-cards.d.ts.map +0 -1
  395. package/resources/contracts/rate-cards/rate-cards.js.map +0 -1
  396. package/resources/contracts/rate-cards/rate-cards.mjs +0 -69
  397. package/resources/contracts/rate-cards/rate-cards.mjs.map +0 -1
  398. package/resources/contracts/rate-cards/rates.d.ts.map +0 -1
  399. package/resources/contracts/rate-cards/rates.js +0 -38
  400. package/resources/contracts/rate-cards/rates.js.map +0 -1
  401. package/resources/contracts/rate-cards/rates.mjs +0 -33
  402. package/resources/contracts/rate-cards/rates.mjs.map +0 -1
  403. package/resources/credit-grants.d.ts.map +0 -1
  404. package/resources/credit-grants.js +0 -52
  405. package/resources/credit-grants.js.map +0 -1
  406. package/resources/credit-grants.mjs +0 -47
  407. package/resources/credit-grants.mjs.map +0 -1
  408. package/resources/custom-fields.d.ts.map +0 -1
  409. package/resources/custom-fields.js.map +0 -1
  410. package/resources/custom-fields.mjs.map +0 -1
  411. package/resources/customers/alerts.d.ts.map +0 -1
  412. package/resources/customers/alerts.js +0 -33
  413. package/resources/customers/alerts.js.map +0 -1
  414. package/resources/customers/alerts.mjs +0 -29
  415. package/resources/customers/alerts.mjs.map +0 -1
  416. package/resources/customers/billing-config.d.ts.map +0 -1
  417. package/resources/customers/billing-config.js +0 -38
  418. package/resources/customers/billing-config.js.map +0 -1
  419. package/resources/customers/billing-config.mjs +0 -34
  420. package/resources/customers/billing-config.mjs.map +0 -1
  421. package/resources/customers/commits.d.ts.map +0 -1
  422. package/resources/customers/commits.js +0 -27
  423. package/resources/customers/commits.js.map +0 -1
  424. package/resources/customers/commits.mjs +0 -23
  425. package/resources/customers/commits.mjs.map +0 -1
  426. package/resources/customers/credits.d.ts.map +0 -1
  427. package/resources/customers/credits.js +0 -27
  428. package/resources/customers/credits.js.map +0 -1
  429. package/resources/customers/credits.mjs +0 -23
  430. package/resources/customers/credits.mjs.map +0 -1
  431. package/resources/customers/customers.d.ts.map +0 -1
  432. package/resources/customers/customers.js.map +0 -1
  433. package/resources/customers/customers.mjs +0 -126
  434. package/resources/customers/customers.mjs.map +0 -1
  435. package/resources/customers/index.d.ts.map +0 -1
  436. package/resources/customers/index.js.map +0 -1
  437. package/resources/customers/index.mjs.map +0 -1
  438. package/resources/customers/invoices.d.ts.map +0 -1
  439. package/resources/customers/invoices.js +0 -51
  440. package/resources/customers/invoices.js.map +0 -1
  441. package/resources/customers/invoices.mjs +0 -45
  442. package/resources/customers/invoices.mjs.map +0 -1
  443. package/resources/customers/named-schedules.d.ts.map +0 -1
  444. package/resources/customers/named-schedules.js +0 -27
  445. package/resources/customers/named-schedules.js.map +0 -1
  446. package/resources/customers/named-schedules.mjs +0 -23
  447. package/resources/customers/named-schedules.mjs.map +0 -1
  448. package/resources/customers/plans.d.ts.map +0 -1
  449. package/resources/customers/plans.js +0 -53
  450. package/resources/customers/plans.js.map +0 -1
  451. package/resources/customers/plans.mjs +0 -47
  452. package/resources/customers/plans.mjs.map +0 -1
  453. package/resources/dashboards.d.ts.map +0 -1
  454. package/resources/dashboards.js +0 -17
  455. package/resources/dashboards.js.map +0 -1
  456. package/resources/dashboards.mjs +0 -13
  457. package/resources/dashboards.mjs.map +0 -1
  458. package/resources/invoices.d.ts.map +0 -1
  459. package/resources/invoices.js +0 -21
  460. package/resources/invoices.js.map +0 -1
  461. package/resources/invoices.mjs +0 -17
  462. package/resources/invoices.mjs.map +0 -1
  463. package/resources/plans.d.ts.map +0 -1
  464. package/resources/plans.js.map +0 -1
  465. package/resources/plans.mjs +0 -47
  466. package/resources/plans.mjs.map +0 -1
  467. package/resources/pricing-units.d.ts.map +0 -1
  468. package/resources/pricing-units.js.map +0 -1
  469. package/resources/pricing-units.mjs.map +0 -1
  470. package/resources/services.d.ts.map +0 -1
  471. package/resources/services.js.map +0 -1
  472. package/resources/services.mjs.map +0 -1
  473. package/resources/usage.d.ts +0 -166
  474. package/resources/usage.d.ts.map +0 -1
  475. package/resources/usage.js +0 -49
  476. package/resources/usage.js.map +0 -1
  477. package/resources/usage.mjs +0 -44
  478. package/resources/usage.mjs.map +0 -1
  479. package/src/resources/usage.ts +0 -239
  480. /package/resources/{contracts → v1/contracts}/index.js +0 -0
  481. /package/resources/{contracts → v1/contracts}/index.mjs +0 -0
  482. /package/resources/{contracts → v1/contracts}/rate-cards/index.js +0 -0
  483. /package/resources/{contracts → v1/contracts}/rate-cards/index.mjs +0 -0
  484. /package/resources/{customers → v1/customers}/index.js +0 -0
  485. /package/resources/{customers → v1/customers}/index.mjs +0 -0
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Shared from './shared';
3
+ import * as Shared from "./shared.js";
4
4
 
5
5
  export interface BaseUsageFilter {
6
6
  group_key: string;
@@ -34,6 +34,12 @@ export interface Commit {
34
34
 
35
35
  applicable_product_tags?: Array<string>;
36
36
 
37
+ /**
38
+ * RFC 3339 timestamp indicating when the commit was archived. If not provided, the
39
+ * commit is not archived.
40
+ */
41
+ archived_at?: string;
42
+
37
43
  /**
38
44
  * The current balance of the credit or commit. This balance reflects the amount of
39
45
  * credit or commit that the customer has access to use at this moment - thus,
@@ -48,10 +54,15 @@ export interface Commit {
48
54
 
49
55
  contract?: Commit.Contract;
50
56
 
51
- custom_fields?: Record<string, string>;
57
+ custom_fields?: { [key: string]: string };
52
58
 
53
59
  description?: string;
54
60
 
61
+ /**
62
+ * Optional configuration for commit hierarchy access control
63
+ */
64
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
65
+
55
66
  /**
56
67
  * The contract that this commit will be billed on.
57
68
  */
@@ -73,6 +84,7 @@ export interface Commit {
73
84
  | Commit.PrepaidCommitExpirationLedgerEntry
74
85
  | Commit.PrepaidCommitCanceledLedgerEntry
75
86
  | Commit.PrepaidCommitCreditedLedgerEntry
87
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
76
88
  | Commit.PostpaidCommitInitialBalanceLedgerEntry
77
89
  | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
78
90
  | Commit.PostpaidCommitRolloverLedgerEntry
@@ -106,6 +118,13 @@ export interface Commit {
106
118
  */
107
119
  salesforce_opportunity_id?: string;
108
120
 
121
+ /**
122
+ * List of filters that determine what kind of customer usage draws down a commit
123
+ * or credit. A customer's usage needs to meet the condition of at least one of the
124
+ * specifiers to contribute to a commit's or credit's drawdown.
125
+ */
126
+ specifiers?: Array<Commit.Specifier>;
127
+
109
128
  /**
110
129
  * Prevents the creation of duplicates. If a request to create a commit or credit
111
130
  * is made with a uniqueness key that was previously used to create a commit or
@@ -126,6 +145,32 @@ export namespace Commit {
126
145
  id: string;
127
146
  }
128
147
 
148
+ /**
149
+ * Optional configuration for commit hierarchy access control
150
+ */
151
+ export interface HierarchyConfiguration {
152
+ child_access:
153
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
154
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
155
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
156
+ }
157
+
158
+ export namespace HierarchyConfiguration {
159
+ export interface CommitHierarchyChildAccessAll {
160
+ type: 'ALL';
161
+ }
162
+
163
+ export interface CommitHierarchyChildAccessNone {
164
+ type: 'NONE';
165
+ }
166
+
167
+ export interface CommitHierarchyChildAccessContractIDs {
168
+ contract_ids: Array<string>;
169
+
170
+ type: 'CONTRACT_IDS';
171
+ }
172
+ }
173
+
129
174
  /**
130
175
  * The contract that this commit will be billed on.
131
176
  */
@@ -201,6 +246,16 @@ export namespace Commit {
201
246
  type: 'PREPAID_COMMIT_CREDITED';
202
247
  }
203
248
 
249
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
250
+ amount: number;
251
+
252
+ segment_id: string;
253
+
254
+ timestamp: string;
255
+
256
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
257
+ }
258
+
204
259
  export interface PostpaidCommitInitialBalanceLedgerEntry {
205
260
  amount: number;
206
261
 
@@ -276,6 +331,23 @@ export namespace Commit {
276
331
 
277
332
  contract_id: string;
278
333
  }
334
+
335
+ export interface Specifier {
336
+ presentation_group_values?: { [key: string]: string };
337
+
338
+ pricing_group_values?: { [key: string]: string };
339
+
340
+ /**
341
+ * If provided, the specifier will only apply to the product with the specified ID.
342
+ */
343
+ product_id?: string;
344
+
345
+ /**
346
+ * If provided, the specifier will only apply to products with all the specified
347
+ * tags.
348
+ */
349
+ product_tags?: Array<string>;
350
+ }
279
351
  }
280
352
 
281
353
  export interface ContractWithoutAmendments {
@@ -304,6 +376,14 @@ export interface ContractWithoutAmendments {
304
376
 
305
377
  ending_before?: string;
306
378
 
379
+ /**
380
+ * Either a **parent** configuration with a list of children or a **child**
381
+ * configuration with a single parent.
382
+ */
383
+ hierarchy_configuration?:
384
+ | ContractWithoutAmendments.ParentHierarchyConfiguration
385
+ | ContractWithoutAmendments.ChildHierarchyConfiguration;
386
+
307
387
  name?: string;
308
388
 
309
389
  net_payment_terms_days?: number;
@@ -313,6 +393,8 @@ export interface ContractWithoutAmendments {
313
393
  */
314
394
  netsuite_sales_order_id?: string;
315
395
 
396
+ prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
397
+
316
398
  /**
317
399
  * This field's availability is dependent on your client's configuration.
318
400
  */
@@ -343,6 +425,8 @@ export interface ContractWithoutAmendments {
343
425
  */
344
426
  scheduled_charges_on_usage_invoices?: 'ALL';
345
427
 
428
+ spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
429
+
346
430
  /**
347
431
  * This field's availability is dependent on your client's configuration.
348
432
  */
@@ -366,7 +450,191 @@ export namespace ContractWithoutAmendments {
366
450
  */
367
451
  billing_anchor_date: string;
368
452
 
369
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
453
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
454
+ }
455
+
456
+ export interface ParentHierarchyConfiguration {
457
+ /**
458
+ * List of contracts that belong to this parent.
459
+ */
460
+ children: Array<ParentHierarchyConfiguration.Child>;
461
+ }
462
+
463
+ export namespace ParentHierarchyConfiguration {
464
+ export interface Child {
465
+ contract_id: string;
466
+
467
+ customer_id: string;
468
+ }
469
+ }
470
+
471
+ export interface ChildHierarchyConfiguration {
472
+ /**
473
+ * The single parent contract/customer for this child.
474
+ */
475
+ parent: ChildHierarchyConfiguration.Parent;
476
+ }
477
+
478
+ export namespace ChildHierarchyConfiguration {
479
+ /**
480
+ * The single parent contract/customer for this child.
481
+ */
482
+ export interface Parent {
483
+ contract_id: string;
484
+
485
+ customer_id: string;
486
+ }
487
+ }
488
+
489
+ export interface PrepaidBalanceThresholdConfiguration {
490
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
491
+
492
+ /**
493
+ * When set to false, the contract will not be evaluated against the
494
+ * threshold_amount. Toggling to true will result an immediate evaluation,
495
+ * regardless of prior state.
496
+ */
497
+ is_enabled: boolean;
498
+
499
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
500
+
501
+ /**
502
+ * Specify the amount the balance should be recharged to.
503
+ */
504
+ recharge_to_amount: number;
505
+
506
+ /**
507
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
508
+ * balance lowers to this amount, a threshold charge will be initiated.
509
+ */
510
+ threshold_amount: number;
511
+
512
+ /**
513
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
514
+ * commit amount will be in terms of this credit type instead of the fiat currency.
515
+ */
516
+ custom_credit_type_id?: string;
517
+ }
518
+
519
+ export namespace PrepaidBalanceThresholdConfiguration {
520
+ export interface Commit {
521
+ /**
522
+ * The commit product that will be used to generate the line item for commit
523
+ * payment.
524
+ */
525
+ product_id: string;
526
+
527
+ /**
528
+ * Which products the threshold commit applies to. If applicable_product_ids,
529
+ * applicable_product_tags or specifiers are not provided, the commit applies to
530
+ * all products.
531
+ */
532
+ applicable_product_ids?: Array<string>;
533
+
534
+ /**
535
+ * Which tags the threshold commit applies to. If applicable_product_ids,
536
+ * applicable_product_tags or specifiers are not provided, the commit applies to
537
+ * all products.
538
+ */
539
+ applicable_product_tags?: Array<string>;
540
+
541
+ description?: string;
542
+
543
+ /**
544
+ * Specify the name of the line item for the threshold charge. If left blank, it
545
+ * will default to the commit product name.
546
+ */
547
+ name?: string;
548
+
549
+ /**
550
+ * List of filters that determine what kind of customer usage draws down a commit
551
+ * or credit. A customer's usage needs to meet the condition of at least one of the
552
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
553
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
554
+ */
555
+ specifiers?: Array<Commit.Specifier>;
556
+ }
557
+
558
+ export namespace Commit {
559
+ export interface Specifier {
560
+ presentation_group_values?: { [key: string]: string };
561
+
562
+ pricing_group_values?: { [key: string]: string };
563
+
564
+ /**
565
+ * If provided, the specifier will only apply to the product with the specified ID.
566
+ */
567
+ product_id?: string;
568
+
569
+ /**
570
+ * If provided, the specifier will only apply to products with all the specified
571
+ * tags.
572
+ */
573
+ product_tags?: Array<string>;
574
+ }
575
+ }
576
+
577
+ export interface PaymentGateConfig {
578
+ /**
579
+ * Gate access to the commit balance based on successful collection of payment.
580
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
581
+ * facilitate payment using your own payment integration. Select NONE if you do not
582
+ * wish to payment gate the commit balance.
583
+ */
584
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
585
+
586
+ /**
587
+ * Only applicable if using PRECALCULATED as your tax type.
588
+ */
589
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
590
+
591
+ /**
592
+ * Only applicable if using STRIPE as your payment gate type.
593
+ */
594
+ stripe_config?: PaymentGateConfig.StripeConfig;
595
+
596
+ /**
597
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
598
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
599
+ * will default to NONE.
600
+ */
601
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
602
+ }
603
+
604
+ export namespace PaymentGateConfig {
605
+ /**
606
+ * Only applicable if using PRECALCULATED as your tax type.
607
+ */
608
+ export interface PrecalculatedTaxConfig {
609
+ /**
610
+ * Amount of tax to be applied. This should be in the same currency and
611
+ * denomination as the commit's invoice schedule
612
+ */
613
+ tax_amount: number;
614
+
615
+ /**
616
+ * Name of the tax to be applied. This may be used in an invoice line item
617
+ * description.
618
+ */
619
+ tax_name?: string;
620
+ }
621
+
622
+ /**
623
+ * Only applicable if using STRIPE as your payment gate type.
624
+ */
625
+ export interface StripeConfig {
626
+ /**
627
+ * If left blank, will default to INVOICE
628
+ */
629
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
630
+
631
+ /**
632
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
633
+ * your payment type.
634
+ */
635
+ invoice_metadata?: { [key: string]: string };
636
+ }
637
+ }
370
638
  }
371
639
 
372
640
  export interface RecurringCommit {
@@ -421,6 +689,11 @@ export namespace ContractWithoutAmendments {
421
689
  */
422
690
  ending_before?: string;
423
691
 
692
+ /**
693
+ * Optional configuration for recurring commit/credit hierarchy access control
694
+ */
695
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
696
+
424
697
  /**
425
698
  * The amount the customer should be billed for the commit. Not required.
426
699
  */
@@ -436,12 +709,34 @@ export namespace ContractWithoutAmendments {
436
709
  */
437
710
  netsuite_sales_order_id?: string;
438
711
 
712
+ /**
713
+ * Determines whether the first and last commit will be prorated. If not provided,
714
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
715
+ */
716
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
717
+
718
+ /**
719
+ * The frequency at which the recurring commits will be created. If not provided: -
720
+ * The commits will be created on the usage invoice frequency. If provided: - The
721
+ * period defined in the duration will correspond to this frequency. - Commits will
722
+ * be created aligned with the recurring commit's starting_at rather than the usage
723
+ * invoice dates.
724
+ */
725
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
726
+
439
727
  /**
440
728
  * Will be passed down to the individual commits. This controls how much of an
441
729
  * individual unexpired commit will roll over upon contract transition. Must be
442
730
  * between 0 and 1.
443
731
  */
444
732
  rollover_fraction?: number;
733
+
734
+ /**
735
+ * List of filters that determine what kind of customer usage draws down a commit
736
+ * or credit. A customer's usage needs to meet the condition of at least one of the
737
+ * specifiers to contribute to a commit's or credit's drawdown.
738
+ */
739
+ specifiers?: Array<RecurringCommit.Specifier>;
445
740
  }
446
741
 
447
742
  export namespace RecurringCommit {
@@ -451,9 +746,9 @@ export namespace ContractWithoutAmendments {
451
746
  export interface AccessAmount {
452
747
  credit_type_id: string;
453
748
 
454
- quantity: number;
455
-
456
749
  unit_price: number;
750
+
751
+ quantity?: number;
457
752
  }
458
753
 
459
754
  /**
@@ -475,6 +770,32 @@ export namespace ContractWithoutAmendments {
475
770
  id: string;
476
771
  }
477
772
 
773
+ /**
774
+ * Optional configuration for recurring commit/credit hierarchy access control
775
+ */
776
+ export interface HierarchyConfiguration {
777
+ child_access:
778
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
779
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
780
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
781
+ }
782
+
783
+ export namespace HierarchyConfiguration {
784
+ export interface CommitHierarchyChildAccessAll {
785
+ type: 'ALL';
786
+ }
787
+
788
+ export interface CommitHierarchyChildAccessNone {
789
+ type: 'NONE';
790
+ }
791
+
792
+ export interface CommitHierarchyChildAccessContractIDs {
793
+ contract_ids: Array<string>;
794
+
795
+ type: 'CONTRACT_IDS';
796
+ }
797
+ }
798
+
478
799
  /**
479
800
  * The amount the customer should be billed for the commit. Not required.
480
801
  */
@@ -485,6 +806,23 @@ export namespace ContractWithoutAmendments {
485
806
 
486
807
  unit_price: number;
487
808
  }
809
+
810
+ export interface Specifier {
811
+ presentation_group_values?: { [key: string]: string };
812
+
813
+ pricing_group_values?: { [key: string]: string };
814
+
815
+ /**
816
+ * If provided, the specifier will only apply to the product with the specified ID.
817
+ */
818
+ product_id?: string;
819
+
820
+ /**
821
+ * If provided, the specifier will only apply to products with all the specified
822
+ * tags.
823
+ */
824
+ product_tags?: Array<string>;
825
+ }
488
826
  }
489
827
 
490
828
  export interface RecurringCredit {
@@ -540,9 +878,9 @@ export namespace ContractWithoutAmendments {
540
878
  ending_before?: string;
541
879
 
542
880
  /**
543
- * The amount the customer should be billed for the commit. Not required.
881
+ * Optional configuration for recurring commit/credit hierarchy access control
544
882
  */
545
- invoice_amount?: RecurringCredit.InvoiceAmount;
883
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
546
884
 
547
885
  /**
548
886
  * Displayed on invoices. Will be passed through to the individual commits
@@ -554,12 +892,34 @@ export namespace ContractWithoutAmendments {
554
892
  */
555
893
  netsuite_sales_order_id?: string;
556
894
 
895
+ /**
896
+ * Determines whether the first and last commit will be prorated. If not provided,
897
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
898
+ */
899
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
900
+
901
+ /**
902
+ * The frequency at which the recurring commits will be created. If not provided: -
903
+ * The commits will be created on the usage invoice frequency. If provided: - The
904
+ * period defined in the duration will correspond to this frequency. - Commits will
905
+ * be created aligned with the recurring commit's starting_at rather than the usage
906
+ * invoice dates.
907
+ */
908
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
909
+
557
910
  /**
558
911
  * Will be passed down to the individual commits. This controls how much of an
559
912
  * individual unexpired commit will roll over upon contract transition. Must be
560
913
  * between 0 and 1.
561
914
  */
562
915
  rollover_fraction?: number;
916
+
917
+ /**
918
+ * List of filters that determine what kind of customer usage draws down a commit
919
+ * or credit. A customer's usage needs to meet the condition of at least one of the
920
+ * specifiers to contribute to a commit's or credit's drawdown.
921
+ */
922
+ specifiers?: Array<RecurringCredit.Specifier>;
563
923
  }
564
924
 
565
925
  export namespace RecurringCredit {
@@ -569,9 +929,9 @@ export namespace ContractWithoutAmendments {
569
929
  export interface AccessAmount {
570
930
  credit_type_id: string;
571
931
 
572
- quantity: number;
573
-
574
932
  unit_price: number;
933
+
934
+ quantity?: number;
575
935
  }
576
936
 
577
937
  /**
@@ -594,14 +954,46 @@ export namespace ContractWithoutAmendments {
594
954
  }
595
955
 
596
956
  /**
597
- * The amount the customer should be billed for the commit. Not required.
957
+ * Optional configuration for recurring commit/credit hierarchy access control
598
958
  */
599
- export interface InvoiceAmount {
600
- credit_type_id: string;
959
+ export interface HierarchyConfiguration {
960
+ child_access:
961
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
962
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
963
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
964
+ }
601
965
 
602
- quantity: number;
966
+ export namespace HierarchyConfiguration {
967
+ export interface CommitHierarchyChildAccessAll {
968
+ type: 'ALL';
969
+ }
603
970
 
604
- unit_price: number;
971
+ export interface CommitHierarchyChildAccessNone {
972
+ type: 'NONE';
973
+ }
974
+
975
+ export interface CommitHierarchyChildAccessContractIDs {
976
+ contract_ids: Array<string>;
977
+
978
+ type: 'CONTRACT_IDS';
979
+ }
980
+ }
981
+
982
+ export interface Specifier {
983
+ presentation_group_values?: { [key: string]: string };
984
+
985
+ pricing_group_values?: { [key: string]: string };
986
+
987
+ /**
988
+ * If provided, the specifier will only apply to the product with the specified ID.
989
+ */
990
+ product_id?: string;
991
+
992
+ /**
993
+ * If provided, the specifier will only apply to products with all the specified
994
+ * tags.
995
+ */
996
+ product_tags?: Array<string>;
605
997
  }
606
998
  }
607
999
 
@@ -633,6 +1025,105 @@ export namespace ContractWithoutAmendments {
633
1025
  reseller_contract_value?: number;
634
1026
  }
635
1027
 
1028
+ export interface SpendThresholdConfiguration {
1029
+ commit: SpendThresholdConfiguration.Commit;
1030
+
1031
+ /**
1032
+ * When set to false, the contract will not be evaluated against the
1033
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1034
+ * regardless of prior state.
1035
+ */
1036
+ is_enabled: boolean;
1037
+
1038
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1039
+
1040
+ /**
1041
+ * Specify the threshold amount for the contract. Each time the contract's usage
1042
+ * hits this amount, a threshold charge will be initiated.
1043
+ */
1044
+ threshold_amount: number;
1045
+ }
1046
+
1047
+ export namespace SpendThresholdConfiguration {
1048
+ export interface Commit {
1049
+ /**
1050
+ * The commit product that will be used to generate the line item for commit
1051
+ * payment.
1052
+ */
1053
+ product_id: string;
1054
+
1055
+ description?: string;
1056
+
1057
+ /**
1058
+ * Specify the name of the line item for the threshold charge. If left blank, it
1059
+ * will default to the commit product name.
1060
+ */
1061
+ name?: string;
1062
+ }
1063
+
1064
+ export interface PaymentGateConfig {
1065
+ /**
1066
+ * Gate access to the commit balance based on successful collection of payment.
1067
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1068
+ * facilitate payment using your own payment integration. Select NONE if you do not
1069
+ * wish to payment gate the commit balance.
1070
+ */
1071
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1072
+
1073
+ /**
1074
+ * Only applicable if using PRECALCULATED as your tax type.
1075
+ */
1076
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1077
+
1078
+ /**
1079
+ * Only applicable if using STRIPE as your payment gate type.
1080
+ */
1081
+ stripe_config?: PaymentGateConfig.StripeConfig;
1082
+
1083
+ /**
1084
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1085
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1086
+ * will default to NONE.
1087
+ */
1088
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1089
+ }
1090
+
1091
+ export namespace PaymentGateConfig {
1092
+ /**
1093
+ * Only applicable if using PRECALCULATED as your tax type.
1094
+ */
1095
+ export interface PrecalculatedTaxConfig {
1096
+ /**
1097
+ * Amount of tax to be applied. This should be in the same currency and
1098
+ * denomination as the commit's invoice schedule
1099
+ */
1100
+ tax_amount: number;
1101
+
1102
+ /**
1103
+ * Name of the tax to be applied. This may be used in an invoice line item
1104
+ * description.
1105
+ */
1106
+ tax_name?: string;
1107
+ }
1108
+
1109
+ /**
1110
+ * Only applicable if using STRIPE as your payment gate type.
1111
+ */
1112
+ export interface StripeConfig {
1113
+ /**
1114
+ * If left blank, will default to INVOICE
1115
+ */
1116
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1117
+
1118
+ /**
1119
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1120
+ * your payment type.
1121
+ */
1122
+ invoice_metadata?: { [key: string]: string };
1123
+ }
1124
+ }
1125
+ }
1126
+
636
1127
  export interface UsageFilter {
637
1128
  current: Shared.BaseUsageFilter | null;
638
1129
 
@@ -684,10 +1175,15 @@ export interface Credit {
684
1175
 
685
1176
  contract?: Credit.Contract;
686
1177
 
687
- custom_fields?: Record<string, string>;
1178
+ custom_fields?: { [key: string]: string };
688
1179
 
689
1180
  description?: string;
690
1181
 
1182
+ /**
1183
+ * Optional configuration for credit hierarchy access control
1184
+ */
1185
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
1186
+
691
1187
  /**
692
1188
  * A list of ordered events that impact the balance of a credit. For example, an
693
1189
  * invoice deduction or an expiration.
@@ -699,6 +1195,7 @@ export interface Credit {
699
1195
  | Credit.CreditCanceledLedgerEntry
700
1196
  | Credit.CreditCreditedLedgerEntry
701
1197
  | Credit.CreditManualLedgerEntry
1198
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
702
1199
  >;
703
1200
 
704
1201
  name?: string;
@@ -721,6 +1218,13 @@ export interface Credit {
721
1218
  */
722
1219
  salesforce_opportunity_id?: string;
723
1220
 
1221
+ /**
1222
+ * List of filters that determine what kind of customer usage draws down a commit
1223
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1224
+ * specifiers to contribute to a commit's or credit's drawdown.
1225
+ */
1226
+ specifiers?: Array<Credit.Specifier>;
1227
+
724
1228
  /**
725
1229
  * Prevents the creation of duplicates. If a request to create a commit or credit
726
1230
  * is made with a uniqueness key that was previously used to create a commit or
@@ -741,6 +1245,32 @@ export namespace Credit {
741
1245
  id: string;
742
1246
  }
743
1247
 
1248
+ /**
1249
+ * Optional configuration for credit hierarchy access control
1250
+ */
1251
+ export interface HierarchyConfiguration {
1252
+ child_access:
1253
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1254
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1255
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1256
+ }
1257
+
1258
+ export namespace HierarchyConfiguration {
1259
+ export interface CommitHierarchyChildAccessAll {
1260
+ type: 'ALL';
1261
+ }
1262
+
1263
+ export interface CommitHierarchyChildAccessNone {
1264
+ type: 'NONE';
1265
+ }
1266
+
1267
+ export interface CommitHierarchyChildAccessContractIDs {
1268
+ contract_ids: Array<string>;
1269
+
1270
+ type: 'CONTRACT_IDS';
1271
+ }
1272
+ }
1273
+
744
1274
  export interface CreditSegmentStartLedgerEntry {
745
1275
  amount: number;
746
1276
 
@@ -806,6 +1336,33 @@ export namespace Credit {
806
1336
 
807
1337
  type: 'CREDIT_MANUAL';
808
1338
  }
1339
+
1340
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
1341
+ amount: number;
1342
+
1343
+ segment_id: string;
1344
+
1345
+ timestamp: string;
1346
+
1347
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1348
+ }
1349
+
1350
+ export interface Specifier {
1351
+ presentation_group_values?: { [key: string]: string };
1352
+
1353
+ pricing_group_values?: { [key: string]: string };
1354
+
1355
+ /**
1356
+ * If provided, the specifier will only apply to the product with the specified ID.
1357
+ */
1358
+ product_id?: string;
1359
+
1360
+ /**
1361
+ * If provided, the specifier will only apply to products with all the specified
1362
+ * tags.
1363
+ */
1364
+ product_tags?: Array<string>;
1365
+ }
809
1366
  }
810
1367
 
811
1368
  export interface CreditTypeData {
@@ -821,7 +1378,7 @@ export interface Discount {
821
1378
 
822
1379
  schedule: SchedulePointInTime;
823
1380
 
824
- custom_fields?: Record<string, string>;
1381
+ custom_fields?: { [key: string]: string };
825
1382
 
826
1383
  name?: string;
827
1384
 
@@ -921,16 +1478,18 @@ export interface Override {
921
1478
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
922
1479
  * processors.
923
1480
  */
924
- value?: Record<string, unknown>;
1481
+ value?: { [key: string]: unknown };
925
1482
  }
926
1483
 
927
1484
  export namespace Override {
928
1485
  export interface OverrideSpecifier {
1486
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1487
+
929
1488
  commit_ids?: Array<string>;
930
1489
 
931
- presentation_group_values?: Record<string, string | null>;
1490
+ presentation_group_values?: { [key: string]: string | null };
932
1491
 
933
- pricing_group_values?: Record<string, string>;
1492
+ pricing_group_values?: { [key: string]: string };
934
1493
 
935
1494
  product_id?: string;
936
1495
 
@@ -956,7 +1515,7 @@ export namespace Override {
956
1515
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
957
1516
  * processors.
958
1517
  */
959
- custom_rate?: Record<string, unknown>;
1518
+ custom_rate?: { [key: string]: unknown };
960
1519
 
961
1520
  /**
962
1521
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1041,7 +1600,7 @@ export interface ProService {
1041
1600
  */
1042
1601
  unit_price: number;
1043
1602
 
1044
- custom_fields?: Record<string, string>;
1603
+ custom_fields?: { [key: string]: string };
1045
1604
 
1046
1605
  description?: string;
1047
1606
 
@@ -1060,7 +1619,7 @@ export interface Rate {
1060
1619
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1061
1620
  * processors.
1062
1621
  */
1063
- custom_rate?: Record<string, unknown>;
1622
+ custom_rate?: { [key: string]: unknown };
1064
1623
 
1065
1624
  /**
1066
1625
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1078,7 +1637,7 @@ export interface Rate {
1078
1637
  * if pricing groups are used, this will contain the values used to calculate the
1079
1638
  * price
1080
1639
  */
1081
- pricing_group_values?: Record<string, string>;
1640
+ pricing_group_values?: { [key: string]: string };
1082
1641
 
1083
1642
  /**
1084
1643
  * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
@@ -1105,7 +1664,9 @@ export interface ScheduledCharge {
1105
1664
 
1106
1665
  schedule: SchedulePointInTime;
1107
1666
 
1108
- custom_fields?: Record<string, string>;
1667
+ archived_at?: string;
1668
+
1669
+ custom_fields?: { [key: string]: string };
1109
1670
 
1110
1671
  /**
1111
1672
  * displayed on invoices
@@ -1156,13 +1717,13 @@ export namespace SchedulePointInTime {
1156
1717
 
1157
1718
  amount: number;
1158
1719
 
1159
- invoice_id: string;
1160
-
1161
1720
  quantity: number;
1162
1721
 
1163
1722
  timestamp: string;
1164
1723
 
1165
1724
  unit_price: number;
1725
+
1726
+ invoice_id?: string | null;
1166
1727
  }
1167
1728
  }
1168
1729