@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,16 +1,16 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
5
- import * as Shared from '../shared';
6
- import * as NamedSchedulesAPI from './named-schedules';
3
+ import { APIResource } from "../../../resource.js";
4
+ import * as Core from "../../../core.js";
5
+ import * as Shared from "../../shared.js";
6
+ import * as NamedSchedulesAPI from "./named-schedules.js";
7
7
  import {
8
8
  NamedScheduleRetrieveParams,
9
9
  NamedScheduleRetrieveResponse,
10
10
  NamedScheduleUpdateParams,
11
11
  NamedSchedules,
12
- } from './named-schedules';
13
- import * as ProductsAPI from './products';
12
+ } from "./named-schedules.js";
13
+ import * as ProductsAPI from "./products.js";
14
14
  import {
15
15
  ProductArchiveParams,
16
16
  ProductArchiveResponse,
@@ -27,10 +27,12 @@ import {
27
27
  Products,
28
28
  QuantityConversion,
29
29
  QuantityRounding,
30
- } from './products';
31
- import * as InvoicesAPI from '../customers/invoices';
32
- import * as RateCardsAPI from './rate-cards/rate-cards';
30
+ } from "./products.js";
31
+ import * as InvoicesAPI from "../customers/invoices.js";
32
+ import * as RateCardsAPI from "./rate-cards/rate-cards.js";
33
33
  import {
34
+ RateCardArchiveParams,
35
+ RateCardArchiveResponse,
34
36
  RateCardCreateParams,
35
37
  RateCardCreateResponse,
36
38
  RateCardListParams,
@@ -43,7 +45,7 @@ import {
43
45
  RateCardUpdateParams,
44
46
  RateCardUpdateResponse,
45
47
  RateCards,
46
- } from './rate-cards/rate-cards';
48
+ } from "./rate-cards/rate-cards.js";
47
49
 
48
50
  export class Contracts extends APIResource {
49
51
  products: ProductsAPI.Products = new ProductsAPI.Products(this._client);
@@ -52,36 +54,78 @@ export class Contracts extends APIResource {
52
54
 
53
55
  /**
54
56
  * Create a new contract
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const contract = await client.v1.contracts.create({
61
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
62
+ * starting_at: '2020-01-01T00:00:00.000Z',
63
+ * billing_provider_configuration: {
64
+ * billing_provider: 'stripe',
65
+ * delivery_method: 'direct_to_billing_provider',
66
+ * },
67
+ * rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
68
+ * });
69
+ * ```
55
70
  */
56
71
  create(body: ContractCreateParams, options?: Core.RequestOptions): Core.APIPromise<ContractCreateResponse> {
57
- return this._client.post('/contracts/create', { body, ...options });
72
+ return this._client.post('/v1/contracts/create', { body, ...options });
58
73
  }
59
74
 
60
75
  /**
61
- * Get a specific contract
76
+ * This is the v1 endpoint to get a contract. New clients should implement using
77
+ * the v2 endpoint.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const contract = await client.v1.contracts.retrieve({
82
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
83
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
84
+ * });
85
+ * ```
62
86
  */
63
87
  retrieve(
64
88
  body: ContractRetrieveParams,
65
89
  options?: Core.RequestOptions,
66
90
  ): Core.APIPromise<ContractRetrieveResponse> {
67
- return this._client.post('/contracts/get', { body, ...options });
91
+ return this._client.post('/v1/contracts/get', { body, ...options });
68
92
  }
69
93
 
70
94
  /**
71
- * List all contracts for a customer
95
+ * This is the v1 endpoint to list all contracts for a customer. New clients should
96
+ * implement using the v2 endpoint.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const contracts = await client.v1.contracts.list({
101
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
102
+ * });
103
+ * ```
72
104
  */
73
105
  list(body: ContractListParams, options?: Core.RequestOptions): Core.APIPromise<ContractListResponse> {
74
- return this._client.post('/contracts/list', { body, ...options });
106
+ return this._client.post('/v1/contracts/list', { body, ...options });
75
107
  }
76
108
 
77
109
  /**
78
110
  * Add a manual balance entry
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * await client.v1.contracts.addManualBalanceEntry({
115
+ * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
116
+ * amount: -1000,
117
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
118
+ * reason: 'Reason for entry',
119
+ * segment_id: '66368e29-3f97-4d15-a6e9-120897f0070a',
120
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
121
+ * });
122
+ * ```
79
123
  */
80
124
  addManualBalanceEntry(
81
125
  body: ContractAddManualBalanceEntryParams,
82
126
  options?: Core.RequestOptions,
83
127
  ): Core.APIPromise<void> {
84
- return this._client.post('/contracts/addManualBalanceLedgerEntry', {
128
+ return this._client.post('/v1/contracts/addManualBalanceLedgerEntry', {
85
129
  body,
86
130
  ...options,
87
131
  headers: { Accept: '*/*', ...options?.headers },
@@ -89,73 +133,203 @@ export class Contracts extends APIResource {
89
133
  }
90
134
 
91
135
  /**
92
- * Amend a contract
136
+ * Amendments will be replaced by Contract editing. New clients should implement
137
+ * using the editContract endpoint. Read more about the migration to contract
138
+ * editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
139
+ * reach out to your Metronome representative for more details. Once contract
140
+ * editing is enabled, access to this endpoint will be removed.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const response = await client.v1.contracts.amend({
145
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
146
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
147
+ * starting_at: '2020-01-01T00:00:00.000Z',
148
+ * });
149
+ * ```
93
150
  */
94
151
  amend(body: ContractAmendParams, options?: Core.RequestOptions): Core.APIPromise<ContractAmendResponse> {
95
- return this._client.post('/contracts/amend', { body, ...options });
152
+ return this._client.post('/v1/contracts/amend', { body, ...options });
96
153
  }
97
154
 
98
155
  /**
99
156
  * Archive a contract
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * const response = await client.v1.contracts.archive({
161
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
162
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
163
+ * void_invoices: true,
164
+ * });
165
+ * ```
100
166
  */
101
167
  archive(
102
168
  body: ContractArchiveParams,
103
169
  options?: Core.RequestOptions,
104
170
  ): Core.APIPromise<ContractArchiveResponse> {
105
- return this._client.post('/contracts/archive', { body, ...options });
171
+ return this._client.post('/v1/contracts/archive', { body, ...options });
106
172
  }
107
173
 
108
174
  /**
109
175
  * Creates historical usage invoices for a contract
176
+ *
177
+ * @example
178
+ * ```ts
179
+ * const response =
180
+ * await client.v1.contracts.createHistoricalInvoices({
181
+ * invoices: [
182
+ * {
183
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
184
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
185
+ * credit_type_id:
186
+ * '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
187
+ * inclusive_start_date: '2020-01-01T00:00:00.000Z',
188
+ * exclusive_end_date: '2020-02-01T00:00:00.000Z',
189
+ * issue_date: '2020-02-01T00:00:00.000Z',
190
+ * usage_line_items: [
191
+ * {
192
+ * product_id:
193
+ * 'f14d6729-6a44-4b13-9908-9387f1918790',
194
+ * inclusive_start_date:
195
+ * '2020-01-01T00:00:00.000Z',
196
+ * exclusive_end_date: '2020-02-01T00:00:00.000Z',
197
+ * quantity: 100,
198
+ * },
199
+ * ],
200
+ * },
201
+ * ],
202
+ * preview: false,
203
+ * });
204
+ * ```
110
205
  */
111
206
  createHistoricalInvoices(
112
207
  body: ContractCreateHistoricalInvoicesParams,
113
208
  options?: Core.RequestOptions,
114
209
  ): Core.APIPromise<ContractCreateHistoricalInvoicesResponse> {
115
- return this._client.post('/contracts/createHistoricalInvoices', { body, ...options });
210
+ return this._client.post('/v1/contracts/createHistoricalInvoices', { body, ...options });
116
211
  }
117
212
 
118
213
  /**
119
214
  * List balances (commits and credits).
215
+ *
216
+ * @example
217
+ * ```ts
218
+ * const response = await client.v1.contracts.listBalances({
219
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
220
+ * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
221
+ * include_ledgers: true,
222
+ * });
223
+ * ```
120
224
  */
121
225
  listBalances(
122
226
  body: ContractListBalancesParams,
123
227
  options?: Core.RequestOptions,
124
228
  ): Core.APIPromise<ContractListBalancesResponse> {
125
- return this._client.post('/contracts/customerBalances/list', { body, ...options });
229
+ return this._client.post('/v1/contracts/customerBalances/list', { body, ...options });
126
230
  }
127
231
 
128
232
  /**
129
233
  * Get the rate schedule for the rate card on a given contract.
234
+ *
235
+ * @example
236
+ * ```ts
237
+ * const response =
238
+ * await client.v1.contracts.retrieveRateSchedule({
239
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
240
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
241
+ * at: '2020-01-01T00:00:00.000Z',
242
+ * selectors: [
243
+ * {
244
+ * product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
245
+ * partial_pricing_group_values: {
246
+ * region: 'us-west-2',
247
+ * cloud: 'aws',
248
+ * },
249
+ * },
250
+ * ],
251
+ * });
252
+ * ```
130
253
  */
131
254
  retrieveRateSchedule(
132
255
  params: ContractRetrieveRateScheduleParams,
133
256
  options?: Core.RequestOptions,
134
257
  ): Core.APIPromise<ContractRetrieveRateScheduleResponse> {
135
258
  const { limit, next_page, ...body } = params;
136
- return this._client.post('/contracts/getContractRateSchedule', {
259
+ return this._client.post('/v1/contracts/getContractRateSchedule', {
137
260
  query: { limit, next_page },
138
261
  body,
139
262
  ...options,
140
263
  });
141
264
  }
142
265
 
266
+ /**
267
+ * Fetch the quantity and price for a subscription over time. End-point does not
268
+ * return future scheduled changes.
269
+ *
270
+ * @example
271
+ * ```ts
272
+ * const response =
273
+ * await client.v1.contracts.retrieveSubscriptionQuantityHistory(
274
+ * {
275
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
276
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
277
+ * subscription_id:
278
+ * '1a824d53-bde6-4d82-96d7-6347ff227d5c',
279
+ * },
280
+ * );
281
+ * ```
282
+ */
283
+ retrieveSubscriptionQuantityHistory(
284
+ body: ContractRetrieveSubscriptionQuantityHistoryParams,
285
+ options?: Core.RequestOptions,
286
+ ): Core.APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse> {
287
+ return this._client.post('/v1/contracts/getSubscriptionQuantityHistory', { body, ...options });
288
+ }
289
+
143
290
  /**
144
291
  * Create a new scheduled invoice for Professional Services terms on a contract.
145
292
  * This endpoint's availability is dependent on your client's configuration.
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * const response =
297
+ * await client.v1.contracts.scheduleProServicesInvoice({
298
+ * contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
299
+ * customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
300
+ * issued_at: '2019-12-27T18:11:19.117Z',
301
+ * line_items: [
302
+ * {
303
+ * professional_service_id:
304
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
305
+ * },
306
+ * ],
307
+ * });
308
+ * ```
146
309
  */
147
310
  scheduleProServicesInvoice(
148
311
  body: ContractScheduleProServicesInvoiceParams,
149
312
  options?: Core.RequestOptions,
150
313
  ): Core.APIPromise<ContractScheduleProServicesInvoiceResponse> {
151
- return this._client.post('/contracts/scheduleProServicesInvoice', { body, ...options });
314
+ return this._client.post('/v1/contracts/scheduleProServicesInvoice', { body, ...options });
152
315
  }
153
316
 
154
317
  /**
155
318
  * Set usage filter for a contract
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * await client.v1.contracts.setUsageFilter({
323
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
324
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
325
+ * group_key: 'business_subscription_id',
326
+ * group_values: ['ID-1', 'ID-2'],
327
+ * starting_at: '2020-01-01T00:00:00.000Z',
328
+ * });
329
+ * ```
156
330
  */
157
331
  setUsageFilter(body: ContractSetUsageFilterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
158
- return this._client.post('/contracts/setUsageFilter', {
332
+ return this._client.post('/v1/contracts/setUsageFilter', {
159
333
  body,
160
334
  ...options,
161
335
  headers: { Accept: '*/*', ...options?.headers },
@@ -164,12 +338,21 @@ export class Contracts extends APIResource {
164
338
 
165
339
  /**
166
340
  * Update the end date of a contract
341
+ *
342
+ * @example
343
+ * ```ts
344
+ * const response = await client.v1.contracts.updateEndDate({
345
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
346
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
347
+ * ending_before: '2020-01-01T00:00:00.000Z',
348
+ * });
349
+ * ```
167
350
  */
168
351
  updateEndDate(
169
352
  body: ContractUpdateEndDateParams,
170
353
  options?: Core.RequestOptions,
171
354
  ): Core.APIPromise<ContractUpdateEndDateResponse> {
172
- return this._client.post('/contracts/updateEndDate', { body, ...options });
355
+ return this._client.post('/v1/contracts/updateEndDate', { body, ...options });
173
356
  }
174
357
  }
175
358
 
@@ -199,13 +382,20 @@ export namespace ContractRetrieveResponse {
199
382
  */
200
383
  archived_at?: string;
201
384
 
202
- custom_fields?: Record<string, string>;
385
+ custom_fields?: { [key: string]: string };
203
386
 
204
387
  /**
205
388
  * The billing provider configuration associated with a contract.
206
389
  */
207
390
  customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
208
391
 
392
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
393
+
394
+ /**
395
+ * Priority of the contract.
396
+ */
397
+ priority?: number;
398
+
209
399
  /**
210
400
  * Determines which scheduled and commit charges to consolidate onto the Contract's
211
401
  * usage invoice. The charge's `timestamp` must match the usage invoice's
@@ -215,6 +405,13 @@ export namespace ContractRetrieveResponse {
215
405
  */
216
406
  scheduled_charges_on_usage_invoices?: 'ALL';
217
407
 
408
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
409
+
410
+ /**
411
+ * List of subscriptions on the contract.
412
+ */
413
+ subscriptions?: Array<Data.Subscription>;
414
+
218
415
  /**
219
416
  * Prevents the creation of duplicates. If a request to create a record is made
220
417
  * with a previously used uniqueness key, a new record will not be created and the
@@ -308,6 +505,322 @@ export namespace ContractRetrieveResponse {
308
505
  | 'gcp_marketplace';
309
506
 
310
507
  delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
508
+
509
+ id?: string;
510
+
511
+ /**
512
+ * Configuration for the billing provider. The structure of this object is specific
513
+ * to the billing provider.
514
+ */
515
+ configuration?: { [key: string]: unknown };
516
+ }
517
+
518
+ export interface PrepaidBalanceThresholdConfiguration {
519
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
520
+
521
+ /**
522
+ * When set to false, the contract will not be evaluated against the
523
+ * threshold_amount. Toggling to true will result an immediate evaluation,
524
+ * regardless of prior state.
525
+ */
526
+ is_enabled: boolean;
527
+
528
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
529
+
530
+ /**
531
+ * Specify the amount the balance should be recharged to.
532
+ */
533
+ recharge_to_amount: number;
534
+
535
+ /**
536
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
537
+ * balance lowers to this amount, a threshold charge will be initiated.
538
+ */
539
+ threshold_amount: number;
540
+
541
+ /**
542
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
543
+ * commit amount will be in terms of this credit type instead of the fiat currency.
544
+ */
545
+ custom_credit_type_id?: string;
546
+ }
547
+
548
+ export namespace PrepaidBalanceThresholdConfiguration {
549
+ export interface Commit {
550
+ /**
551
+ * The commit product that will be used to generate the line item for commit
552
+ * payment.
553
+ */
554
+ product_id: string;
555
+
556
+ /**
557
+ * Which products the threshold commit applies to. If applicable_product_ids,
558
+ * applicable_product_tags or specifiers are not provided, the commit applies to
559
+ * all products.
560
+ */
561
+ applicable_product_ids?: Array<string>;
562
+
563
+ /**
564
+ * Which tags the threshold commit applies to. If applicable_product_ids,
565
+ * applicable_product_tags or specifiers are not provided, the commit applies to
566
+ * all products.
567
+ */
568
+ applicable_product_tags?: Array<string>;
569
+
570
+ description?: string;
571
+
572
+ /**
573
+ * Specify the name of the line item for the threshold charge. If left blank, it
574
+ * will default to the commit product name.
575
+ */
576
+ name?: string;
577
+
578
+ /**
579
+ * List of filters that determine what kind of customer usage draws down a commit
580
+ * or credit. A customer's usage needs to meet the condition of at least one of the
581
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
582
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
583
+ */
584
+ specifiers?: Array<Commit.Specifier>;
585
+ }
586
+
587
+ export namespace Commit {
588
+ export interface Specifier {
589
+ presentation_group_values?: { [key: string]: string };
590
+
591
+ pricing_group_values?: { [key: string]: string };
592
+
593
+ /**
594
+ * If provided, the specifier will only apply to the product with the specified ID.
595
+ */
596
+ product_id?: string;
597
+
598
+ /**
599
+ * If provided, the specifier will only apply to products with all the specified
600
+ * tags.
601
+ */
602
+ product_tags?: Array<string>;
603
+ }
604
+ }
605
+
606
+ export interface PaymentGateConfig {
607
+ /**
608
+ * Gate access to the commit balance based on successful collection of payment.
609
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
610
+ * facilitate payment using your own payment integration. Select NONE if you do not
611
+ * wish to payment gate the commit balance.
612
+ */
613
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
614
+
615
+ /**
616
+ * Only applicable if using PRECALCULATED as your tax type.
617
+ */
618
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
619
+
620
+ /**
621
+ * Only applicable if using STRIPE as your payment gate type.
622
+ */
623
+ stripe_config?: PaymentGateConfig.StripeConfig;
624
+
625
+ /**
626
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
627
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
628
+ * will default to NONE.
629
+ */
630
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
631
+ }
632
+
633
+ export namespace PaymentGateConfig {
634
+ /**
635
+ * Only applicable if using PRECALCULATED as your tax type.
636
+ */
637
+ export interface PrecalculatedTaxConfig {
638
+ /**
639
+ * Amount of tax to be applied. This should be in the same currency and
640
+ * denomination as the commit's invoice schedule
641
+ */
642
+ tax_amount: number;
643
+
644
+ /**
645
+ * Name of the tax to be applied. This may be used in an invoice line item
646
+ * description.
647
+ */
648
+ tax_name?: string;
649
+ }
650
+
651
+ /**
652
+ * Only applicable if using STRIPE as your payment gate type.
653
+ */
654
+ export interface StripeConfig {
655
+ /**
656
+ * If left blank, will default to INVOICE
657
+ */
658
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
659
+
660
+ /**
661
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
662
+ * your payment type.
663
+ */
664
+ invoice_metadata?: { [key: string]: string };
665
+ }
666
+ }
667
+ }
668
+
669
+ export interface SpendThresholdConfiguration {
670
+ commit: SpendThresholdConfiguration.Commit;
671
+
672
+ /**
673
+ * When set to false, the contract will not be evaluated against the
674
+ * threshold_amount. Toggling to true will result an immediate evaluation,
675
+ * regardless of prior state.
676
+ */
677
+ is_enabled: boolean;
678
+
679
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
680
+
681
+ /**
682
+ * Specify the threshold amount for the contract. Each time the contract's usage
683
+ * hits this amount, a threshold charge will be initiated.
684
+ */
685
+ threshold_amount: number;
686
+ }
687
+
688
+ export namespace SpendThresholdConfiguration {
689
+ export interface Commit {
690
+ /**
691
+ * The commit product that will be used to generate the line item for commit
692
+ * payment.
693
+ */
694
+ product_id: string;
695
+
696
+ description?: string;
697
+
698
+ /**
699
+ * Specify the name of the line item for the threshold charge. If left blank, it
700
+ * will default to the commit product name.
701
+ */
702
+ name?: string;
703
+ }
704
+
705
+ export interface PaymentGateConfig {
706
+ /**
707
+ * Gate access to the commit balance based on successful collection of payment.
708
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
709
+ * facilitate payment using your own payment integration. Select NONE if you do not
710
+ * wish to payment gate the commit balance.
711
+ */
712
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
713
+
714
+ /**
715
+ * Only applicable if using PRECALCULATED as your tax type.
716
+ */
717
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
718
+
719
+ /**
720
+ * Only applicable if using STRIPE as your payment gate type.
721
+ */
722
+ stripe_config?: PaymentGateConfig.StripeConfig;
723
+
724
+ /**
725
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
726
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
727
+ * will default to NONE.
728
+ */
729
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
730
+ }
731
+
732
+ export namespace PaymentGateConfig {
733
+ /**
734
+ * Only applicable if using PRECALCULATED as your tax type.
735
+ */
736
+ export interface PrecalculatedTaxConfig {
737
+ /**
738
+ * Amount of tax to be applied. This should be in the same currency and
739
+ * denomination as the commit's invoice schedule
740
+ */
741
+ tax_amount: number;
742
+
743
+ /**
744
+ * Name of the tax to be applied. This may be used in an invoice line item
745
+ * description.
746
+ */
747
+ tax_name?: string;
748
+ }
749
+
750
+ /**
751
+ * Only applicable if using STRIPE as your payment gate type.
752
+ */
753
+ export interface StripeConfig {
754
+ /**
755
+ * If left blank, will default to INVOICE
756
+ */
757
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
758
+
759
+ /**
760
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
761
+ * your payment type.
762
+ */
763
+ invoice_metadata?: { [key: string]: string };
764
+ }
765
+ }
766
+ }
767
+
768
+ export interface Subscription {
769
+ collection_schedule: 'ADVANCE' | 'ARREARS';
770
+
771
+ proration: Subscription.Proration;
772
+
773
+ /**
774
+ * List of quantity schedule items for the subscription. Only includes the current
775
+ * quantity and future quantity changes.
776
+ */
777
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
778
+
779
+ starting_at: string;
780
+
781
+ subscription_rate: Subscription.SubscriptionRate;
782
+
783
+ id?: string;
784
+
785
+ custom_fields?: { [key: string]: string };
786
+
787
+ description?: string;
788
+
789
+ ending_before?: string;
790
+
791
+ fiat_credit_type_id?: string;
792
+
793
+ name?: string;
794
+ }
795
+
796
+ export namespace Subscription {
797
+ export interface Proration {
798
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
799
+
800
+ is_prorated: boolean;
801
+ }
802
+
803
+ export interface QuantitySchedule {
804
+ quantity: number;
805
+
806
+ starting_at: string;
807
+
808
+ ending_before?: string;
809
+ }
810
+
811
+ export interface SubscriptionRate {
812
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
813
+
814
+ product: SubscriptionRate.Product;
815
+ }
816
+
817
+ export namespace SubscriptionRate {
818
+ export interface Product {
819
+ id: string;
820
+
821
+ name: string;
822
+ }
823
+ }
311
824
  }
312
825
  }
313
826
  }
@@ -334,13 +847,20 @@ export namespace ContractListResponse {
334
847
  */
335
848
  archived_at?: string;
336
849
 
337
- custom_fields?: Record<string, string>;
850
+ custom_fields?: { [key: string]: string };
338
851
 
339
852
  /**
340
853
  * The billing provider configuration associated with a contract.
341
854
  */
342
855
  customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
343
856
 
857
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
858
+
859
+ /**
860
+ * Priority of the contract.
861
+ */
862
+ priority?: number;
863
+
344
864
  /**
345
865
  * Determines which scheduled and commit charges to consolidate onto the Contract's
346
866
  * usage invoice. The charge's `timestamp` must match the usage invoice's
@@ -350,6 +870,13 @@ export namespace ContractListResponse {
350
870
  */
351
871
  scheduled_charges_on_usage_invoices?: 'ALL';
352
872
 
873
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
874
+
875
+ /**
876
+ * List of subscriptions on the contract.
877
+ */
878
+ subscriptions?: Array<Data.Subscription>;
879
+
353
880
  /**
354
881
  * Prevents the creation of duplicates. If a request to create a record is made
355
882
  * with a previously used uniqueness key, a new record will not be created and the
@@ -442,7 +969,323 @@ export namespace ContractListResponse {
442
969
  | 'workday'
443
970
  | 'gcp_marketplace';
444
971
 
445
- delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
972
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
973
+
974
+ id?: string;
975
+
976
+ /**
977
+ * Configuration for the billing provider. The structure of this object is specific
978
+ * to the billing provider.
979
+ */
980
+ configuration?: { [key: string]: unknown };
981
+ }
982
+
983
+ export interface PrepaidBalanceThresholdConfiguration {
984
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
985
+
986
+ /**
987
+ * When set to false, the contract will not be evaluated against the
988
+ * threshold_amount. Toggling to true will result an immediate evaluation,
989
+ * regardless of prior state.
990
+ */
991
+ is_enabled: boolean;
992
+
993
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
994
+
995
+ /**
996
+ * Specify the amount the balance should be recharged to.
997
+ */
998
+ recharge_to_amount: number;
999
+
1000
+ /**
1001
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
1002
+ * balance lowers to this amount, a threshold charge will be initiated.
1003
+ */
1004
+ threshold_amount: number;
1005
+
1006
+ /**
1007
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1008
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1009
+ */
1010
+ custom_credit_type_id?: string;
1011
+ }
1012
+
1013
+ export namespace PrepaidBalanceThresholdConfiguration {
1014
+ export interface Commit {
1015
+ /**
1016
+ * The commit product that will be used to generate the line item for commit
1017
+ * payment.
1018
+ */
1019
+ product_id: string;
1020
+
1021
+ /**
1022
+ * Which products the threshold commit applies to. If applicable_product_ids,
1023
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1024
+ * all products.
1025
+ */
1026
+ applicable_product_ids?: Array<string>;
1027
+
1028
+ /**
1029
+ * Which tags the threshold commit applies to. If applicable_product_ids,
1030
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1031
+ * all products.
1032
+ */
1033
+ applicable_product_tags?: Array<string>;
1034
+
1035
+ description?: string;
1036
+
1037
+ /**
1038
+ * Specify the name of the line item for the threshold charge. If left blank, it
1039
+ * will default to the commit product name.
1040
+ */
1041
+ name?: string;
1042
+
1043
+ /**
1044
+ * List of filters that determine what kind of customer usage draws down a commit
1045
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1046
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1047
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1048
+ */
1049
+ specifiers?: Array<Commit.Specifier>;
1050
+ }
1051
+
1052
+ export namespace Commit {
1053
+ export interface Specifier {
1054
+ presentation_group_values?: { [key: string]: string };
1055
+
1056
+ pricing_group_values?: { [key: string]: string };
1057
+
1058
+ /**
1059
+ * If provided, the specifier will only apply to the product with the specified ID.
1060
+ */
1061
+ product_id?: string;
1062
+
1063
+ /**
1064
+ * If provided, the specifier will only apply to products with all the specified
1065
+ * tags.
1066
+ */
1067
+ product_tags?: Array<string>;
1068
+ }
1069
+ }
1070
+
1071
+ export interface PaymentGateConfig {
1072
+ /**
1073
+ * Gate access to the commit balance based on successful collection of payment.
1074
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1075
+ * facilitate payment using your own payment integration. Select NONE if you do not
1076
+ * wish to payment gate the commit balance.
1077
+ */
1078
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1079
+
1080
+ /**
1081
+ * Only applicable if using PRECALCULATED as your tax type.
1082
+ */
1083
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1084
+
1085
+ /**
1086
+ * Only applicable if using STRIPE as your payment gate type.
1087
+ */
1088
+ stripe_config?: PaymentGateConfig.StripeConfig;
1089
+
1090
+ /**
1091
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1092
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1093
+ * will default to NONE.
1094
+ */
1095
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1096
+ }
1097
+
1098
+ export namespace PaymentGateConfig {
1099
+ /**
1100
+ * Only applicable if using PRECALCULATED as your tax type.
1101
+ */
1102
+ export interface PrecalculatedTaxConfig {
1103
+ /**
1104
+ * Amount of tax to be applied. This should be in the same currency and
1105
+ * denomination as the commit's invoice schedule
1106
+ */
1107
+ tax_amount: number;
1108
+
1109
+ /**
1110
+ * Name of the tax to be applied. This may be used in an invoice line item
1111
+ * description.
1112
+ */
1113
+ tax_name?: string;
1114
+ }
1115
+
1116
+ /**
1117
+ * Only applicable if using STRIPE as your payment gate type.
1118
+ */
1119
+ export interface StripeConfig {
1120
+ /**
1121
+ * If left blank, will default to INVOICE
1122
+ */
1123
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1124
+
1125
+ /**
1126
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1127
+ * your payment type.
1128
+ */
1129
+ invoice_metadata?: { [key: string]: string };
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ export interface SpendThresholdConfiguration {
1135
+ commit: SpendThresholdConfiguration.Commit;
1136
+
1137
+ /**
1138
+ * When set to false, the contract will not be evaluated against the
1139
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1140
+ * regardless of prior state.
1141
+ */
1142
+ is_enabled: boolean;
1143
+
1144
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1145
+
1146
+ /**
1147
+ * Specify the threshold amount for the contract. Each time the contract's usage
1148
+ * hits this amount, a threshold charge will be initiated.
1149
+ */
1150
+ threshold_amount: number;
1151
+ }
1152
+
1153
+ export namespace SpendThresholdConfiguration {
1154
+ export interface Commit {
1155
+ /**
1156
+ * The commit product that will be used to generate the line item for commit
1157
+ * payment.
1158
+ */
1159
+ product_id: string;
1160
+
1161
+ description?: string;
1162
+
1163
+ /**
1164
+ * Specify the name of the line item for the threshold charge. If left blank, it
1165
+ * will default to the commit product name.
1166
+ */
1167
+ name?: string;
1168
+ }
1169
+
1170
+ export interface PaymentGateConfig {
1171
+ /**
1172
+ * Gate access to the commit balance based on successful collection of payment.
1173
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1174
+ * facilitate payment using your own payment integration. Select NONE if you do not
1175
+ * wish to payment gate the commit balance.
1176
+ */
1177
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1178
+
1179
+ /**
1180
+ * Only applicable if using PRECALCULATED as your tax type.
1181
+ */
1182
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1183
+
1184
+ /**
1185
+ * Only applicable if using STRIPE as your payment gate type.
1186
+ */
1187
+ stripe_config?: PaymentGateConfig.StripeConfig;
1188
+
1189
+ /**
1190
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1191
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1192
+ * will default to NONE.
1193
+ */
1194
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1195
+ }
1196
+
1197
+ export namespace PaymentGateConfig {
1198
+ /**
1199
+ * Only applicable if using PRECALCULATED as your tax type.
1200
+ */
1201
+ export interface PrecalculatedTaxConfig {
1202
+ /**
1203
+ * Amount of tax to be applied. This should be in the same currency and
1204
+ * denomination as the commit's invoice schedule
1205
+ */
1206
+ tax_amount: number;
1207
+
1208
+ /**
1209
+ * Name of the tax to be applied. This may be used in an invoice line item
1210
+ * description.
1211
+ */
1212
+ tax_name?: string;
1213
+ }
1214
+
1215
+ /**
1216
+ * Only applicable if using STRIPE as your payment gate type.
1217
+ */
1218
+ export interface StripeConfig {
1219
+ /**
1220
+ * If left blank, will default to INVOICE
1221
+ */
1222
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1223
+
1224
+ /**
1225
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1226
+ * your payment type.
1227
+ */
1228
+ invoice_metadata?: { [key: string]: string };
1229
+ }
1230
+ }
1231
+ }
1232
+
1233
+ export interface Subscription {
1234
+ collection_schedule: 'ADVANCE' | 'ARREARS';
1235
+
1236
+ proration: Subscription.Proration;
1237
+
1238
+ /**
1239
+ * List of quantity schedule items for the subscription. Only includes the current
1240
+ * quantity and future quantity changes.
1241
+ */
1242
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
1243
+
1244
+ starting_at: string;
1245
+
1246
+ subscription_rate: Subscription.SubscriptionRate;
1247
+
1248
+ id?: string;
1249
+
1250
+ custom_fields?: { [key: string]: string };
1251
+
1252
+ description?: string;
1253
+
1254
+ ending_before?: string;
1255
+
1256
+ fiat_credit_type_id?: string;
1257
+
1258
+ name?: string;
1259
+ }
1260
+
1261
+ export namespace Subscription {
1262
+ export interface Proration {
1263
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1264
+
1265
+ is_prorated: boolean;
1266
+ }
1267
+
1268
+ export interface QuantitySchedule {
1269
+ quantity: number;
1270
+
1271
+ starting_at: string;
1272
+
1273
+ ending_before?: string;
1274
+ }
1275
+
1276
+ export interface SubscriptionRate {
1277
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1278
+
1279
+ product: SubscriptionRate.Product;
1280
+ }
1281
+
1282
+ export namespace SubscriptionRate {
1283
+ export interface Product {
1284
+ id: string;
1285
+
1286
+ name: string;
1287
+ }
1288
+ }
446
1289
  }
447
1290
  }
448
1291
  }
@@ -477,7 +1320,7 @@ export namespace ContractRetrieveRateScheduleResponse {
477
1320
 
478
1321
  list_rate: Shared.Rate;
479
1322
 
480
- product_custom_fields: Record<string, string>;
1323
+ product_custom_fields: { [key: string]: string };
481
1324
 
482
1325
  product_id: string;
483
1326
 
@@ -489,6 +1332,8 @@ export namespace ContractRetrieveRateScheduleResponse {
489
1332
 
490
1333
  starting_at: string;
491
1334
 
1335
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1336
+
492
1337
  /**
493
1338
  * A distinct rate on the rate card. You can choose to use this rate rather than
494
1339
  * list rate when consuming a credit or commit.
@@ -499,7 +1344,7 @@ export namespace ContractRetrieveRateScheduleResponse {
499
1344
 
500
1345
  override_rate?: Shared.Rate;
501
1346
 
502
- pricing_group_values?: Record<string, string>;
1347
+ pricing_group_values?: { [key: string]: string };
503
1348
  }
504
1349
 
505
1350
  export namespace Data {
@@ -523,6 +1368,38 @@ export namespace ContractRetrieveRateScheduleResponse {
523
1368
  }
524
1369
  }
525
1370
 
1371
+ export interface ContractRetrieveSubscriptionQuantityHistoryResponse {
1372
+ data: ContractRetrieveSubscriptionQuantityHistoryResponse.Data;
1373
+ }
1374
+
1375
+ export namespace ContractRetrieveSubscriptionQuantityHistoryResponse {
1376
+ export interface Data {
1377
+ fiat_credit_type_id?: string;
1378
+
1379
+ history?: Array<Data.History>;
1380
+
1381
+ subscription_id?: string;
1382
+ }
1383
+
1384
+ export namespace Data {
1385
+ export interface History {
1386
+ data: Array<History.Data>;
1387
+
1388
+ starting_at: string;
1389
+ }
1390
+
1391
+ export namespace History {
1392
+ export interface Data {
1393
+ quantity: number;
1394
+
1395
+ total: number;
1396
+
1397
+ unit_price: number;
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+
526
1403
  export interface ContractScheduleProServicesInvoiceResponse {
527
1404
  data: Array<InvoicesAPI.Invoice>;
528
1405
  }
@@ -540,7 +1417,8 @@ export interface ContractCreateParams {
540
1417
  starting_at: string;
541
1418
 
542
1419
  /**
543
- * The billing provider configuration associated with a contract.
1420
+ * The billing provider configuration associated with a contract. Provide either an
1421
+ * ID or the provider and delivery method.
544
1422
  */
545
1423
  billing_provider_configuration?: ContractCreateParams.BillingProviderConfiguration;
546
1424
 
@@ -548,7 +1426,7 @@ export interface ContractCreateParams {
548
1426
 
549
1427
  credits?: Array<ContractCreateParams.Credit>;
550
1428
 
551
- custom_fields?: Record<string, string>;
1429
+ custom_fields?: { [key: string]: string };
552
1430
 
553
1431
  /**
554
1432
  * This field's availability is dependent on your client's configuration.
@@ -560,6 +1438,8 @@ export interface ContractCreateParams {
560
1438
  */
561
1439
  ending_before?: string;
562
1440
 
1441
+ hierarchy_configuration?: ContractCreateParams.HierarchyConfiguration;
1442
+
563
1443
  /**
564
1444
  * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
565
1445
  * prices automatically. EXPLICIT prioritization requires specifying priorities for
@@ -579,6 +1459,13 @@ export interface ContractCreateParams {
579
1459
 
580
1460
  overrides?: Array<ContractCreateParams.Override>;
581
1461
 
1462
+ prepaid_balance_threshold_configuration?: ContractCreateParams.PrepaidBalanceThresholdConfiguration;
1463
+
1464
+ /**
1465
+ * Priority of the contract.
1466
+ */
1467
+ priority?: number;
1468
+
582
1469
  /**
583
1470
  * This field's availability is dependent on your client's configuration.
584
1471
  */
@@ -617,6 +1504,15 @@ export interface ContractCreateParams {
617
1504
  */
618
1505
  scheduled_charges_on_usage_invoices?: 'ALL';
619
1506
 
1507
+ spend_threshold_configuration?: ContractCreateParams.SpendThresholdConfiguration;
1508
+
1509
+ /**
1510
+ * Optional list of
1511
+ * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
1512
+ * to add to the contract.
1513
+ */
1514
+ subscriptions?: Array<ContractCreateParams.Subscription>;
1515
+
620
1516
  /**
621
1517
  * This field's availability is dependent on your client's configuration.
622
1518
  */
@@ -638,16 +1534,25 @@ export interface ContractCreateParams {
638
1534
 
639
1535
  export namespace ContractCreateParams {
640
1536
  /**
641
- * The billing provider configuration associated with a contract.
1537
+ * The billing provider configuration associated with a contract. Provide either an
1538
+ * ID or the provider and delivery method.
642
1539
  */
643
1540
  export interface BillingProviderConfiguration {
1541
+ /**
1542
+ * Do not specify if using billing_provider_configuration_id.
1543
+ */
644
1544
  billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite';
645
1545
 
646
1546
  /**
647
- * The Metronome ID of the billing provider configuration
1547
+ * The Metronome ID of the billing provider configuration. Use when a customer has
1548
+ * multiple configurations with the same billing provider and delivery method.
1549
+ * Otherwise, specify the billing_provider and delivery_method.
648
1550
  */
649
1551
  billing_provider_configuration_id?: string;
650
1552
 
1553
+ /**
1554
+ * Do not specify if using billing_provider_configuration_id.
1555
+ */
651
1556
  delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
652
1557
  }
653
1558
 
@@ -669,24 +1574,31 @@ export namespace ContractCreateParams {
669
1574
  amount?: number;
670
1575
 
671
1576
  /**
672
- * Which products the commit applies to. If both applicable_product_ids and
673
- * applicable_product_tags are not provided, the commit applies to all products.
1577
+ * Which products the commit applies to. If applicable_product_ids,
1578
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1579
+ * all products.
674
1580
  */
675
1581
  applicable_product_ids?: Array<string>;
676
1582
 
677
1583
  /**
678
- * Which tags the commit applies to. If both applicable_product_ids and
679
- * applicable_product_tags are not provided, the commit applies to all products.
1584
+ * Which tags the commit applies to. If applicable_product_ids,
1585
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1586
+ * all products.
680
1587
  */
681
1588
  applicable_product_tags?: Array<string>;
682
1589
 
683
- custom_fields?: Record<string, string>;
1590
+ custom_fields?: { [key: string]: string };
684
1591
 
685
1592
  /**
686
1593
  * Used only in UI/API. It is not exposed to end customers.
687
1594
  */
688
1595
  description?: string;
689
1596
 
1597
+ /**
1598
+ * Optional configuration for commit hierarchy access control
1599
+ */
1600
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
1601
+
690
1602
  /**
691
1603
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
692
1604
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -705,6 +1617,11 @@ export namespace ContractCreateParams {
705
1617
  */
706
1618
  netsuite_sales_order_id?: string;
707
1619
 
1620
+ /**
1621
+ * optionally payment gate this commit
1622
+ */
1623
+ payment_gate_config?: Commit.PaymentGateConfig;
1624
+
708
1625
  /**
709
1626
  * If multiple commits are applicable, the one with the lower priority will apply
710
1627
  * first.
@@ -718,6 +1635,14 @@ export namespace ContractCreateParams {
718
1635
  */
719
1636
  rollover_fraction?: number;
720
1637
 
1638
+ /**
1639
+ * List of filters that determine what kind of customer usage draws down a commit
1640
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1641
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1642
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1643
+ */
1644
+ specifiers?: Array<Commit.Specifier>;
1645
+
721
1646
  /**
722
1647
  * A temporary ID for the commit that can be used to reference the commit for
723
1648
  * commit specific overrides.
@@ -756,6 +1681,32 @@ export namespace ContractCreateParams {
756
1681
  }
757
1682
  }
758
1683
 
1684
+ /**
1685
+ * Optional configuration for commit hierarchy access control
1686
+ */
1687
+ export interface HierarchyConfiguration {
1688
+ child_access:
1689
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1690
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1691
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1692
+ }
1693
+
1694
+ export namespace HierarchyConfiguration {
1695
+ export interface CommitHierarchyChildAccessAll {
1696
+ type: 'ALL';
1697
+ }
1698
+
1699
+ export interface CommitHierarchyChildAccessNone {
1700
+ type: 'NONE';
1701
+ }
1702
+
1703
+ export interface CommitHierarchyChildAccessContractIDs {
1704
+ contract_ids: Array<string>;
1705
+
1706
+ type: 'CONTRACT_IDS';
1707
+ }
1708
+ }
1709
+
759
1710
  /**
760
1711
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
761
1712
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -852,6 +1803,88 @@ export namespace ContractCreateParams {
852
1803
  unit_price?: number;
853
1804
  }
854
1805
  }
1806
+
1807
+ /**
1808
+ * optionally payment gate this commit
1809
+ */
1810
+ export interface PaymentGateConfig {
1811
+ /**
1812
+ * Gate access to the commit balance based on successful collection of payment.
1813
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1814
+ * facilitate payment using your own payment integration. Select NONE if you do not
1815
+ * wish to payment gate the commit balance.
1816
+ */
1817
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1818
+
1819
+ /**
1820
+ * Only applicable if using PRECALCULATED as your tax type.
1821
+ */
1822
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1823
+
1824
+ /**
1825
+ * Only applicable if using STRIPE as your payment gate type.
1826
+ */
1827
+ stripe_config?: PaymentGateConfig.StripeConfig;
1828
+
1829
+ /**
1830
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1831
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1832
+ * will default to NONE.
1833
+ */
1834
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1835
+ }
1836
+
1837
+ export namespace PaymentGateConfig {
1838
+ /**
1839
+ * Only applicable if using PRECALCULATED as your tax type.
1840
+ */
1841
+ export interface PrecalculatedTaxConfig {
1842
+ /**
1843
+ * Amount of tax to be applied. This should be in the same currency and
1844
+ * denomination as the commit's invoice schedule
1845
+ */
1846
+ tax_amount: number;
1847
+
1848
+ /**
1849
+ * Name of the tax to be applied. This may be used in an invoice line item
1850
+ * description.
1851
+ */
1852
+ tax_name?: string;
1853
+ }
1854
+
1855
+ /**
1856
+ * Only applicable if using STRIPE as your payment gate type.
1857
+ */
1858
+ export interface StripeConfig {
1859
+ /**
1860
+ * If left blank, will default to INVOICE
1861
+ */
1862
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1863
+
1864
+ /**
1865
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1866
+ * your payment type.
1867
+ */
1868
+ invoice_metadata?: { [key: string]: string };
1869
+ }
1870
+ }
1871
+
1872
+ export interface Specifier {
1873
+ presentation_group_values?: { [key: string]: string };
1874
+
1875
+ pricing_group_values?: { [key: string]: string };
1876
+
1877
+ /**
1878
+ * If provided, the specifier will only apply to the product with the specified ID.
1879
+ */
1880
+ product_id?: string;
1881
+
1882
+ /**
1883
+ * If provided, the specifier will only apply to products with all the specified
1884
+ * tags.
1885
+ */
1886
+ product_tags?: Array<string>;
1887
+ }
855
1888
  }
856
1889
 
857
1890
  export interface Credit {
@@ -874,13 +1907,18 @@ export namespace ContractCreateParams {
874
1907
  */
875
1908
  applicable_product_tags?: Array<string>;
876
1909
 
877
- custom_fields?: Record<string, string>;
1910
+ custom_fields?: { [key: string]: string };
878
1911
 
879
1912
  /**
880
1913
  * Used only in UI/API. It is not exposed to end customers.
881
1914
  */
882
1915
  description?: string;
883
1916
 
1917
+ /**
1918
+ * Optional configuration for credit hierarchy access control
1919
+ */
1920
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
1921
+
884
1922
  /**
885
1923
  * displayed on invoices
886
1924
  */
@@ -898,6 +1936,14 @@ export namespace ContractCreateParams {
898
1936
  priority?: number;
899
1937
 
900
1938
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1939
+
1940
+ /**
1941
+ * List of filters that determine what kind of customer usage draws down a commit
1942
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1943
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1944
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1945
+ */
1946
+ specifiers?: Array<Credit.Specifier>;
901
1947
  }
902
1948
 
903
1949
  export namespace Credit {
@@ -928,6 +1974,49 @@ export namespace ContractCreateParams {
928
1974
  starting_at: string;
929
1975
  }
930
1976
  }
1977
+
1978
+ /**
1979
+ * Optional configuration for credit hierarchy access control
1980
+ */
1981
+ export interface HierarchyConfiguration {
1982
+ child_access:
1983
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1984
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1985
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1986
+ }
1987
+
1988
+ export namespace HierarchyConfiguration {
1989
+ export interface CommitHierarchyChildAccessAll {
1990
+ type: 'ALL';
1991
+ }
1992
+
1993
+ export interface CommitHierarchyChildAccessNone {
1994
+ type: 'NONE';
1995
+ }
1996
+
1997
+ export interface CommitHierarchyChildAccessContractIDs {
1998
+ contract_ids: Array<string>;
1999
+
2000
+ type: 'CONTRACT_IDS';
2001
+ }
2002
+ }
2003
+
2004
+ export interface Specifier {
2005
+ presentation_group_values?: { [key: string]: string };
2006
+
2007
+ pricing_group_values?: { [key: string]: string };
2008
+
2009
+ /**
2010
+ * If provided, the specifier will only apply to the product with the specified ID.
2011
+ */
2012
+ product_id?: string;
2013
+
2014
+ /**
2015
+ * If provided, the specifier will only apply to products with all the specified
2016
+ * tags.
2017
+ */
2018
+ product_tags?: Array<string>;
2019
+ }
931
2020
  }
932
2021
 
933
2022
  export interface Discount {
@@ -938,7 +2027,7 @@ export namespace ContractCreateParams {
938
2027
  */
939
2028
  schedule: Discount.Schedule;
940
2029
 
941
- custom_fields?: Record<string, string>;
2030
+ custom_fields?: { [key: string]: string };
942
2031
 
943
2032
  /**
944
2033
  * displayed on invoices
@@ -1047,6 +2136,18 @@ export namespace ContractCreateParams {
1047
2136
  }
1048
2137
  }
1049
2138
 
2139
+ export interface HierarchyConfiguration {
2140
+ parent: HierarchyConfiguration.Parent;
2141
+ }
2142
+
2143
+ export namespace HierarchyConfiguration {
2144
+ export interface Parent {
2145
+ contract_id: string;
2146
+
2147
+ customer_id: string;
2148
+ }
2149
+ }
2150
+
1050
2151
  export interface Override {
1051
2152
  /**
1052
2153
  * RFC 3339 timestamp indicating when the override will start applying (inclusive)
@@ -1124,6 +2225,8 @@ export namespace ContractCreateParams {
1124
2225
 
1125
2226
  export namespace Override {
1126
2227
  export interface OverrideSpecifier {
2228
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2229
+
1127
2230
  /**
1128
2231
  * Can only be used for commit specific overrides. Must be used in conjunction with
1129
2232
  * one of product_id, product_tags, pricing_group_values, or
@@ -1136,13 +2239,13 @@ export namespace ContractCreateParams {
1136
2239
  * A map of group names to values. The override will only apply to line items with
1137
2240
  * the specified presentation group values.
1138
2241
  */
1139
- presentation_group_values?: Record<string, string>;
2242
+ presentation_group_values?: { [key: string]: string };
1140
2243
 
1141
2244
  /**
1142
2245
  * A map of pricing group names to values. The override will only apply to products
1143
2246
  * with the specified pricing group values.
1144
2247
  */
1145
- pricing_group_values?: Record<string, string>;
2248
+ pricing_group_values?: { [key: string]: string };
1146
2249
 
1147
2250
  /**
1148
2251
  * If provided, the override will only apply to the product with the specified ID.
@@ -1184,7 +2287,7 @@ export namespace ContractCreateParams {
1184
2287
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1185
2288
  * processors.
1186
2289
  */
1187
- custom_rate?: Record<string, unknown>;
2290
+ custom_rate?: { [key: string]: unknown };
1188
2291
 
1189
2292
  /**
1190
2293
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1216,6 +2319,157 @@ export namespace ContractCreateParams {
1216
2319
  }
1217
2320
  }
1218
2321
 
2322
+ export interface PrepaidBalanceThresholdConfiguration {
2323
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
2324
+
2325
+ /**
2326
+ * When set to false, the contract will not be evaluated against the
2327
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2328
+ * regardless of prior state.
2329
+ */
2330
+ is_enabled: boolean;
2331
+
2332
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
2333
+
2334
+ /**
2335
+ * Specify the amount the balance should be recharged to.
2336
+ */
2337
+ recharge_to_amount: number;
2338
+
2339
+ /**
2340
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
2341
+ * balance lowers to this amount, a threshold charge will be initiated.
2342
+ */
2343
+ threshold_amount: number;
2344
+
2345
+ /**
2346
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2347
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2348
+ */
2349
+ custom_credit_type_id?: string;
2350
+ }
2351
+
2352
+ export namespace PrepaidBalanceThresholdConfiguration {
2353
+ export interface Commit {
2354
+ /**
2355
+ * The commit product that will be used to generate the line item for commit
2356
+ * payment.
2357
+ */
2358
+ product_id: string;
2359
+
2360
+ /**
2361
+ * Which products the threshold commit applies to. If applicable_product_ids,
2362
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2363
+ * all products.
2364
+ */
2365
+ applicable_product_ids?: Array<string>;
2366
+
2367
+ /**
2368
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2369
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2370
+ * all products.
2371
+ */
2372
+ applicable_product_tags?: Array<string>;
2373
+
2374
+ description?: string;
2375
+
2376
+ /**
2377
+ * Specify the name of the line item for the threshold charge. If left blank, it
2378
+ * will default to the commit product name.
2379
+ */
2380
+ name?: string;
2381
+
2382
+ /**
2383
+ * List of filters that determine what kind of customer usage draws down a commit
2384
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2385
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2386
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2387
+ */
2388
+ specifiers?: Array<Commit.Specifier>;
2389
+ }
2390
+
2391
+ export namespace Commit {
2392
+ export interface Specifier {
2393
+ presentation_group_values?: { [key: string]: string };
2394
+
2395
+ pricing_group_values?: { [key: string]: string };
2396
+
2397
+ /**
2398
+ * If provided, the specifier will only apply to the product with the specified ID.
2399
+ */
2400
+ product_id?: string;
2401
+
2402
+ /**
2403
+ * If provided, the specifier will only apply to products with all the specified
2404
+ * tags.
2405
+ */
2406
+ product_tags?: Array<string>;
2407
+ }
2408
+ }
2409
+
2410
+ export interface PaymentGateConfig {
2411
+ /**
2412
+ * Gate access to the commit balance based on successful collection of payment.
2413
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2414
+ * facilitate payment using your own payment integration. Select NONE if you do not
2415
+ * wish to payment gate the commit balance.
2416
+ */
2417
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2418
+
2419
+ /**
2420
+ * Only applicable if using PRECALCULATED as your tax type.
2421
+ */
2422
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2423
+
2424
+ /**
2425
+ * Only applicable if using STRIPE as your payment gate type.
2426
+ */
2427
+ stripe_config?: PaymentGateConfig.StripeConfig;
2428
+
2429
+ /**
2430
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2431
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2432
+ * will default to NONE.
2433
+ */
2434
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2435
+ }
2436
+
2437
+ export namespace PaymentGateConfig {
2438
+ /**
2439
+ * Only applicable if using PRECALCULATED as your tax type.
2440
+ */
2441
+ export interface PrecalculatedTaxConfig {
2442
+ /**
2443
+ * Amount of tax to be applied. This should be in the same currency and
2444
+ * denomination as the commit's invoice schedule
2445
+ */
2446
+ tax_amount: number;
2447
+
2448
+ /**
2449
+ * Name of the tax to be applied. This may be used in an invoice line item
2450
+ * description.
2451
+ */
2452
+ tax_name?: string;
2453
+ }
2454
+
2455
+ /**
2456
+ * Only applicable if using STRIPE as your payment gate type.
2457
+ */
2458
+ export interface StripeConfig {
2459
+ /**
2460
+ * If left blank, will default to INVOICE
2461
+ */
2462
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2463
+
2464
+ /**
2465
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2466
+ * your payment type.
2467
+ */
2468
+ invoice_metadata?: { [key: string]: string };
2469
+ }
2470
+ }
2471
+ }
2472
+
1219
2473
  export interface ProfessionalService {
1220
2474
  /**
1221
2475
  * Maximum amount for the term.
@@ -1236,7 +2490,7 @@ export namespace ContractCreateParams {
1236
2490
  */
1237
2491
  unit_price: number;
1238
2492
 
1239
- custom_fields?: Record<string, string>;
2493
+ custom_fields?: { [key: string]: string };
1240
2494
 
1241
2495
  description?: string;
1242
2496
 
@@ -1253,7 +2507,9 @@ export namespace ContractCreateParams {
1253
2507
  access_amount: RecurringCommit.AccessAmount;
1254
2508
 
1255
2509
  /**
1256
- * The amount of time the created commits will be valid for.
2510
+ * Defines the length of the access schedule for each created commit/credit. The
2511
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2512
+ * length of a period is determined by the recurrence_frequency.
1257
2513
  */
1258
2514
  commit_duration: RecurringCommit.CommitDuration;
1259
2515
 
@@ -1289,6 +2545,11 @@ export namespace ContractCreateParams {
1289
2545
  */
1290
2546
  ending_before?: string;
1291
2547
 
2548
+ /**
2549
+ * Optional configuration for recurring commit/credit hierarchy access control
2550
+ */
2551
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
2552
+
1292
2553
  /**
1293
2554
  * The amount the customer should be billed for the commit. Not required.
1294
2555
  */
@@ -1304,11 +2565,26 @@ export namespace ContractCreateParams {
1304
2565
  */
1305
2566
  netsuite_sales_order_id?: string;
1306
2567
 
2568
+ /**
2569
+ * Determines whether the first and last commit will be prorated. If not provided,
2570
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2571
+ */
2572
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2573
+
1307
2574
  /**
1308
2575
  * Whether the created commits will use the commit rate or list rate
1309
2576
  */
1310
2577
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1311
2578
 
2579
+ /**
2580
+ * The frequency at which the recurring commits will be created. If not provided: -
2581
+ * The commits will be created on the usage invoice frequency. If provided: - The
2582
+ * period defined in the duration will correspond to this frequency. - Commits will
2583
+ * be created aligned with the recurring commit's starting_at rather than the usage
2584
+ * invoice dates.
2585
+ */
2586
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2587
+
1312
2588
  /**
1313
2589
  * Will be passed down to the individual commits. This controls how much of an
1314
2590
  * individual unexpired commit will roll over upon contract transition. Must be
@@ -1316,6 +2592,14 @@ export namespace ContractCreateParams {
1316
2592
  */
1317
2593
  rollover_fraction?: number;
1318
2594
 
2595
+ /**
2596
+ * List of filters that determine what kind of customer usage draws down a commit
2597
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2598
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2599
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2600
+ */
2601
+ specifiers?: Array<RecurringCommit.Specifier>;
2602
+
1319
2603
  /**
1320
2604
  * A temporary ID that can be used to reference the recurring commit for commit
1321
2605
  * specific overrides.
@@ -1330,18 +2614,50 @@ export namespace ContractCreateParams {
1330
2614
  export interface AccessAmount {
1331
2615
  credit_type_id: string;
1332
2616
 
1333
- quantity: number;
1334
-
1335
2617
  unit_price: number;
2618
+
2619
+ /**
2620
+ * This field is currently required. Upcoming recurring commit/credit configuration
2621
+ * options will allow it to be optional.
2622
+ */
2623
+ quantity?: number;
1336
2624
  }
1337
2625
 
1338
2626
  /**
1339
- * The amount of time the created commits will be valid for.
2627
+ * Defines the length of the access schedule for each created commit/credit. The
2628
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2629
+ * length of a period is determined by the recurrence_frequency.
1340
2630
  */
1341
2631
  export interface CommitDuration {
1342
- unit: 'PERIODS';
2632
+ value: number;
2633
+
2634
+ unit?: 'PERIODS';
2635
+ }
2636
+
2637
+ /**
2638
+ * Optional configuration for recurring commit/credit hierarchy access control
2639
+ */
2640
+ export interface HierarchyConfiguration {
2641
+ child_access:
2642
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
2643
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
2644
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2645
+ }
2646
+
2647
+ export namespace HierarchyConfiguration {
2648
+ export interface CommitHierarchyChildAccessAll {
2649
+ type: 'ALL';
2650
+ }
2651
+
2652
+ export interface CommitHierarchyChildAccessNone {
2653
+ type: 'NONE';
2654
+ }
1343
2655
 
1344
- value: number;
2656
+ export interface CommitHierarchyChildAccessContractIDs {
2657
+ contract_ids: Array<string>;
2658
+
2659
+ type: 'CONTRACT_IDS';
2660
+ }
1345
2661
  }
1346
2662
 
1347
2663
  /**
@@ -1354,6 +2670,23 @@ export namespace ContractCreateParams {
1354
2670
 
1355
2671
  unit_price: number;
1356
2672
  }
2673
+
2674
+ export interface Specifier {
2675
+ presentation_group_values?: { [key: string]: string };
2676
+
2677
+ pricing_group_values?: { [key: string]: string };
2678
+
2679
+ /**
2680
+ * If provided, the specifier will only apply to the product with the specified ID.
2681
+ */
2682
+ product_id?: string;
2683
+
2684
+ /**
2685
+ * If provided, the specifier will only apply to products with all the specified
2686
+ * tags.
2687
+ */
2688
+ product_tags?: Array<string>;
2689
+ }
1357
2690
  }
1358
2691
 
1359
2692
  export interface RecurringCredit {
@@ -1363,7 +2696,9 @@ export namespace ContractCreateParams {
1363
2696
  access_amount: RecurringCredit.AccessAmount;
1364
2697
 
1365
2698
  /**
1366
- * The amount of time the created commits will be valid for.
2699
+ * Defines the length of the access schedule for each created commit/credit. The
2700
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2701
+ * length of a period is determined by the recurrence_frequency.
1367
2702
  */
1368
2703
  commit_duration: RecurringCredit.CommitDuration;
1369
2704
 
@@ -1400,9 +2735,9 @@ export namespace ContractCreateParams {
1400
2735
  ending_before?: string;
1401
2736
 
1402
2737
  /**
1403
- * The amount the customer should be billed for the commit. Not required.
2738
+ * Optional configuration for recurring commit/credit hierarchy access control
1404
2739
  */
1405
- invoice_amount?: RecurringCredit.InvoiceAmount;
2740
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1406
2741
 
1407
2742
  /**
1408
2743
  * displayed on invoices. will be passed through to the individual commits
@@ -1414,11 +2749,26 @@ export namespace ContractCreateParams {
1414
2749
  */
1415
2750
  netsuite_sales_order_id?: string;
1416
2751
 
2752
+ /**
2753
+ * Determines whether the first and last commit will be prorated. If not provided,
2754
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2755
+ */
2756
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2757
+
1417
2758
  /**
1418
2759
  * Whether the created commits will use the commit rate or list rate
1419
2760
  */
1420
2761
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1421
2762
 
2763
+ /**
2764
+ * The frequency at which the recurring commits will be created. If not provided: -
2765
+ * The commits will be created on the usage invoice frequency. If provided: - The
2766
+ * period defined in the duration will correspond to this frequency. - Commits will
2767
+ * be created aligned with the recurring commit's starting_at rather than the usage
2768
+ * invoice dates.
2769
+ */
2770
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2771
+
1422
2772
  /**
1423
2773
  * Will be passed down to the individual commits. This controls how much of an
1424
2774
  * individual unexpired commit will roll over upon contract transition. Must be
@@ -1426,6 +2776,14 @@ export namespace ContractCreateParams {
1426
2776
  */
1427
2777
  rollover_fraction?: number;
1428
2778
 
2779
+ /**
2780
+ * List of filters that determine what kind of customer usage draws down a commit
2781
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2782
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2783
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2784
+ */
2785
+ specifiers?: Array<RecurringCredit.Specifier>;
2786
+
1429
2787
  /**
1430
2788
  * A temporary ID that can be used to reference the recurring commit for commit
1431
2789
  * specific overrides.
@@ -1440,29 +2798,67 @@ export namespace ContractCreateParams {
1440
2798
  export interface AccessAmount {
1441
2799
  credit_type_id: string;
1442
2800
 
1443
- quantity: number;
1444
-
1445
2801
  unit_price: number;
2802
+
2803
+ /**
2804
+ * This field is currently required. Upcoming recurring commit/credit configuration
2805
+ * options will allow it to be optional.
2806
+ */
2807
+ quantity?: number;
1446
2808
  }
1447
2809
 
1448
2810
  /**
1449
- * The amount of time the created commits will be valid for.
2811
+ * Defines the length of the access schedule for each created commit/credit. The
2812
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2813
+ * length of a period is determined by the recurrence_frequency.
1450
2814
  */
1451
2815
  export interface CommitDuration {
1452
- unit: 'PERIODS';
1453
-
1454
2816
  value: number;
2817
+
2818
+ unit?: 'PERIODS';
1455
2819
  }
1456
2820
 
1457
2821
  /**
1458
- * The amount the customer should be billed for the commit. Not required.
2822
+ * Optional configuration for recurring commit/credit hierarchy access control
1459
2823
  */
1460
- export interface InvoiceAmount {
1461
- credit_type_id: string;
2824
+ export interface HierarchyConfiguration {
2825
+ child_access:
2826
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
2827
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
2828
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2829
+ }
1462
2830
 
1463
- quantity: number;
2831
+ export namespace HierarchyConfiguration {
2832
+ export interface CommitHierarchyChildAccessAll {
2833
+ type: 'ALL';
2834
+ }
1464
2835
 
1465
- unit_price: number;
2836
+ export interface CommitHierarchyChildAccessNone {
2837
+ type: 'NONE';
2838
+ }
2839
+
2840
+ export interface CommitHierarchyChildAccessContractIDs {
2841
+ contract_ids: Array<string>;
2842
+
2843
+ type: 'CONTRACT_IDS';
2844
+ }
2845
+ }
2846
+
2847
+ export interface Specifier {
2848
+ presentation_group_values?: { [key: string]: string };
2849
+
2850
+ pricing_group_values?: { [key: string]: string };
2851
+
2852
+ /**
2853
+ * If provided, the specifier will only apply to the product with the specified ID.
2854
+ */
2855
+ product_id?: string;
2856
+
2857
+ /**
2858
+ * If provided, the specifier will only apply to products with all the specified
2859
+ * tags.
2860
+ */
2861
+ product_tags?: Array<string>;
1466
2862
  }
1467
2863
  }
1468
2864
 
@@ -1625,6 +3021,166 @@ export namespace ContractCreateParams {
1625
3021
  }
1626
3022
  }
1627
3023
 
3024
+ export interface SpendThresholdConfiguration {
3025
+ commit: SpendThresholdConfiguration.Commit;
3026
+
3027
+ /**
3028
+ * When set to false, the contract will not be evaluated against the
3029
+ * threshold_amount. Toggling to true will result an immediate evaluation,
3030
+ * regardless of prior state.
3031
+ */
3032
+ is_enabled: boolean;
3033
+
3034
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
3035
+
3036
+ /**
3037
+ * Specify the threshold amount for the contract. Each time the contract's usage
3038
+ * hits this amount, a threshold charge will be initiated.
3039
+ */
3040
+ threshold_amount: number;
3041
+ }
3042
+
3043
+ export namespace SpendThresholdConfiguration {
3044
+ export interface Commit {
3045
+ /**
3046
+ * The commit product that will be used to generate the line item for commit
3047
+ * payment.
3048
+ */
3049
+ product_id: string;
3050
+
3051
+ description?: string;
3052
+
3053
+ /**
3054
+ * Specify the name of the line item for the threshold charge. If left blank, it
3055
+ * will default to the commit product name.
3056
+ */
3057
+ name?: string;
3058
+ }
3059
+
3060
+ export interface PaymentGateConfig {
3061
+ /**
3062
+ * Gate access to the commit balance based on successful collection of payment.
3063
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3064
+ * facilitate payment using your own payment integration. Select NONE if you do not
3065
+ * wish to payment gate the commit balance.
3066
+ */
3067
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3068
+
3069
+ /**
3070
+ * Only applicable if using PRECALCULATED as your tax type.
3071
+ */
3072
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3073
+
3074
+ /**
3075
+ * Only applicable if using STRIPE as your payment gate type.
3076
+ */
3077
+ stripe_config?: PaymentGateConfig.StripeConfig;
3078
+
3079
+ /**
3080
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3081
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3082
+ * will default to NONE.
3083
+ */
3084
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3085
+ }
3086
+
3087
+ export namespace PaymentGateConfig {
3088
+ /**
3089
+ * Only applicable if using PRECALCULATED as your tax type.
3090
+ */
3091
+ export interface PrecalculatedTaxConfig {
3092
+ /**
3093
+ * Amount of tax to be applied. This should be in the same currency and
3094
+ * denomination as the commit's invoice schedule
3095
+ */
3096
+ tax_amount: number;
3097
+
3098
+ /**
3099
+ * Name of the tax to be applied. This may be used in an invoice line item
3100
+ * description.
3101
+ */
3102
+ tax_name?: string;
3103
+ }
3104
+
3105
+ /**
3106
+ * Only applicable if using STRIPE as your payment gate type.
3107
+ */
3108
+ export interface StripeConfig {
3109
+ /**
3110
+ * If left blank, will default to INVOICE
3111
+ */
3112
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3113
+
3114
+ /**
3115
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3116
+ * your payment type.
3117
+ */
3118
+ invoice_metadata?: { [key: string]: string };
3119
+ }
3120
+ }
3121
+ }
3122
+
3123
+ export interface Subscription {
3124
+ collection_schedule: 'ADVANCE' | 'ARREARS';
3125
+
3126
+ /**
3127
+ * The initial quantity for the subscription. It must be non-negative value.
3128
+ */
3129
+ initial_quantity: number;
3130
+
3131
+ proration: Subscription.Proration;
3132
+
3133
+ subscription_rate: Subscription.SubscriptionRate;
3134
+
3135
+ custom_fields?: { [key: string]: string };
3136
+
3137
+ description?: string;
3138
+
3139
+ /**
3140
+ * Exclusive end time for the subscription. If not provided, subscription inherits
3141
+ * contract end date.
3142
+ */
3143
+ ending_before?: string;
3144
+
3145
+ name?: string;
3146
+
3147
+ /**
3148
+ * Inclusive start time for the subscription. If not provided, defaults to contract
3149
+ * start date
3150
+ */
3151
+ starting_at?: string;
3152
+ }
3153
+
3154
+ export namespace Subscription {
3155
+ export interface Proration {
3156
+ /**
3157
+ * Indicates how mid-period quantity adjustments are invoiced. If BILL_IMMEDIATELY
3158
+ * is selected, the quantity increase will be billed on the scheduled date. If
3159
+ * BILL_ON_NEXT_COLLECTION_DATE is selected, the quantity increase will be billed
3160
+ * for in-arrears at the end of the period.
3161
+ */
3162
+ invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
3163
+
3164
+ /**
3165
+ * Indicates if the partial period will be prorated or charged a full amount.
3166
+ */
3167
+ is_prorated?: boolean;
3168
+ }
3169
+
3170
+ export interface SubscriptionRate {
3171
+ /**
3172
+ * Frequency to bill subscription with. Together with product_id, must match
3173
+ * existing rate on the rate card.
3174
+ */
3175
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3176
+
3177
+ /**
3178
+ * Must be subscription type product
3179
+ */
3180
+ product_id: string;
3181
+ }
3182
+ }
3183
+
1628
3184
  export interface Transition {
1629
3185
  from_contract_id: string;
1630
3186
 
@@ -1647,7 +3203,7 @@ export namespace ContractCreateParams {
1647
3203
  }
1648
3204
 
1649
3205
  export interface UsageStatementSchedule {
1650
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
3206
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1651
3207
 
1652
3208
  /**
1653
3209
  * Required when using CUSTOM_DATE. This option lets you set a historical billing
@@ -1784,7 +3340,7 @@ export interface ContractAmendParams {
1784
3340
 
1785
3341
  credits?: Array<ContractAmendParams.Credit>;
1786
3342
 
1787
- custom_fields?: Record<string, string>;
3343
+ custom_fields?: { [key: string]: string };
1788
3344
 
1789
3345
  /**
1790
3346
  * This field's availability is dependent on your client's configuration.
@@ -1840,24 +3396,31 @@ export namespace ContractAmendParams {
1840
3396
  amount?: number;
1841
3397
 
1842
3398
  /**
1843
- * Which products the commit applies to. If both applicable_product_ids and
1844
- * applicable_product_tags are not provided, the commit applies to all products.
3399
+ * Which products the commit applies to. If applicable_product_ids,
3400
+ * applicable_product_tags or specifiers are not provided, the commit applies to
3401
+ * all products.
1845
3402
  */
1846
3403
  applicable_product_ids?: Array<string>;
1847
3404
 
1848
3405
  /**
1849
- * Which tags the commit applies to. If both applicable_product_ids and
1850
- * applicable_product_tags are not provided, the commit applies to all products.
3406
+ * Which tags the commit applies to. If applicable_product_ids,
3407
+ * applicable_product_tags or specifiers are not provided, the commit applies to
3408
+ * all products.
1851
3409
  */
1852
3410
  applicable_product_tags?: Array<string>;
1853
3411
 
1854
- custom_fields?: Record<string, string>;
3412
+ custom_fields?: { [key: string]: string };
1855
3413
 
1856
3414
  /**
1857
3415
  * Used only in UI/API. It is not exposed to end customers.
1858
3416
  */
1859
3417
  description?: string;
1860
3418
 
3419
+ /**
3420
+ * Optional configuration for commit hierarchy access control
3421
+ */
3422
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
3423
+
1861
3424
  /**
1862
3425
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
1863
3426
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -1876,6 +3439,11 @@ export namespace ContractAmendParams {
1876
3439
  */
1877
3440
  netsuite_sales_order_id?: string;
1878
3441
 
3442
+ /**
3443
+ * optionally payment gate this commit
3444
+ */
3445
+ payment_gate_config?: Commit.PaymentGateConfig;
3446
+
1879
3447
  /**
1880
3448
  * If multiple commits are applicable, the one with the lower priority will apply
1881
3449
  * first.
@@ -1889,6 +3457,14 @@ export namespace ContractAmendParams {
1889
3457
  */
1890
3458
  rollover_fraction?: number;
1891
3459
 
3460
+ /**
3461
+ * List of filters that determine what kind of customer usage draws down a commit
3462
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3463
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3464
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3465
+ */
3466
+ specifiers?: Array<Commit.Specifier>;
3467
+
1892
3468
  /**
1893
3469
  * A temporary ID for the commit that can be used to reference the commit for
1894
3470
  * commit specific overrides.
@@ -1927,6 +3503,32 @@ export namespace ContractAmendParams {
1927
3503
  }
1928
3504
  }
1929
3505
 
3506
+ /**
3507
+ * Optional configuration for commit hierarchy access control
3508
+ */
3509
+ export interface HierarchyConfiguration {
3510
+ child_access:
3511
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
3512
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
3513
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3514
+ }
3515
+
3516
+ export namespace HierarchyConfiguration {
3517
+ export interface CommitHierarchyChildAccessAll {
3518
+ type: 'ALL';
3519
+ }
3520
+
3521
+ export interface CommitHierarchyChildAccessNone {
3522
+ type: 'NONE';
3523
+ }
3524
+
3525
+ export interface CommitHierarchyChildAccessContractIDs {
3526
+ contract_ids: Array<string>;
3527
+
3528
+ type: 'CONTRACT_IDS';
3529
+ }
3530
+ }
3531
+
1930
3532
  /**
1931
3533
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
1932
3534
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -2023,6 +3625,88 @@ export namespace ContractAmendParams {
2023
3625
  unit_price?: number;
2024
3626
  }
2025
3627
  }
3628
+
3629
+ /**
3630
+ * optionally payment gate this commit
3631
+ */
3632
+ export interface PaymentGateConfig {
3633
+ /**
3634
+ * Gate access to the commit balance based on successful collection of payment.
3635
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3636
+ * facilitate payment using your own payment integration. Select NONE if you do not
3637
+ * wish to payment gate the commit balance.
3638
+ */
3639
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3640
+
3641
+ /**
3642
+ * Only applicable if using PRECALCULATED as your tax type.
3643
+ */
3644
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3645
+
3646
+ /**
3647
+ * Only applicable if using STRIPE as your payment gate type.
3648
+ */
3649
+ stripe_config?: PaymentGateConfig.StripeConfig;
3650
+
3651
+ /**
3652
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3653
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3654
+ * will default to NONE.
3655
+ */
3656
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3657
+ }
3658
+
3659
+ export namespace PaymentGateConfig {
3660
+ /**
3661
+ * Only applicable if using PRECALCULATED as your tax type.
3662
+ */
3663
+ export interface PrecalculatedTaxConfig {
3664
+ /**
3665
+ * Amount of tax to be applied. This should be in the same currency and
3666
+ * denomination as the commit's invoice schedule
3667
+ */
3668
+ tax_amount: number;
3669
+
3670
+ /**
3671
+ * Name of the tax to be applied. This may be used in an invoice line item
3672
+ * description.
3673
+ */
3674
+ tax_name?: string;
3675
+ }
3676
+
3677
+ /**
3678
+ * Only applicable if using STRIPE as your payment gate type.
3679
+ */
3680
+ export interface StripeConfig {
3681
+ /**
3682
+ * If left blank, will default to INVOICE
3683
+ */
3684
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3685
+
3686
+ /**
3687
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3688
+ * your payment type.
3689
+ */
3690
+ invoice_metadata?: { [key: string]: string };
3691
+ }
3692
+ }
3693
+
3694
+ export interface Specifier {
3695
+ presentation_group_values?: { [key: string]: string };
3696
+
3697
+ pricing_group_values?: { [key: string]: string };
3698
+
3699
+ /**
3700
+ * If provided, the specifier will only apply to the product with the specified ID.
3701
+ */
3702
+ product_id?: string;
3703
+
3704
+ /**
3705
+ * If provided, the specifier will only apply to products with all the specified
3706
+ * tags.
3707
+ */
3708
+ product_tags?: Array<string>;
3709
+ }
2026
3710
  }
2027
3711
 
2028
3712
  export interface Credit {
@@ -2045,13 +3729,18 @@ export namespace ContractAmendParams {
2045
3729
  */
2046
3730
  applicable_product_tags?: Array<string>;
2047
3731
 
2048
- custom_fields?: Record<string, string>;
3732
+ custom_fields?: { [key: string]: string };
2049
3733
 
2050
3734
  /**
2051
3735
  * Used only in UI/API. It is not exposed to end customers.
2052
3736
  */
2053
3737
  description?: string;
2054
3738
 
3739
+ /**
3740
+ * Optional configuration for credit hierarchy access control
3741
+ */
3742
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
3743
+
2055
3744
  /**
2056
3745
  * displayed on invoices
2057
3746
  */
@@ -2069,6 +3758,14 @@ export namespace ContractAmendParams {
2069
3758
  priority?: number;
2070
3759
 
2071
3760
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
3761
+
3762
+ /**
3763
+ * List of filters that determine what kind of customer usage draws down a commit
3764
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3765
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3766
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3767
+ */
3768
+ specifiers?: Array<Credit.Specifier>;
2072
3769
  }
2073
3770
 
2074
3771
  export namespace Credit {
@@ -2099,6 +3796,49 @@ export namespace ContractAmendParams {
2099
3796
  starting_at: string;
2100
3797
  }
2101
3798
  }
3799
+
3800
+ /**
3801
+ * Optional configuration for credit hierarchy access control
3802
+ */
3803
+ export interface HierarchyConfiguration {
3804
+ child_access:
3805
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
3806
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
3807
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3808
+ }
3809
+
3810
+ export namespace HierarchyConfiguration {
3811
+ export interface CommitHierarchyChildAccessAll {
3812
+ type: 'ALL';
3813
+ }
3814
+
3815
+ export interface CommitHierarchyChildAccessNone {
3816
+ type: 'NONE';
3817
+ }
3818
+
3819
+ export interface CommitHierarchyChildAccessContractIDs {
3820
+ contract_ids: Array<string>;
3821
+
3822
+ type: 'CONTRACT_IDS';
3823
+ }
3824
+ }
3825
+
3826
+ export interface Specifier {
3827
+ presentation_group_values?: { [key: string]: string };
3828
+
3829
+ pricing_group_values?: { [key: string]: string };
3830
+
3831
+ /**
3832
+ * If provided, the specifier will only apply to the product with the specified ID.
3833
+ */
3834
+ product_id?: string;
3835
+
3836
+ /**
3837
+ * If provided, the specifier will only apply to products with all the specified
3838
+ * tags.
3839
+ */
3840
+ product_tags?: Array<string>;
3841
+ }
2102
3842
  }
2103
3843
 
2104
3844
  export interface Discount {
@@ -2109,7 +3849,7 @@ export namespace ContractAmendParams {
2109
3849
  */
2110
3850
  schedule: Discount.Schedule;
2111
3851
 
2112
- custom_fields?: Record<string, string>;
3852
+ custom_fields?: { [key: string]: string };
2113
3853
 
2114
3854
  /**
2115
3855
  * displayed on invoices
@@ -2295,6 +4035,8 @@ export namespace ContractAmendParams {
2295
4035
 
2296
4036
  export namespace Override {
2297
4037
  export interface OverrideSpecifier {
4038
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
4039
+
2298
4040
  /**
2299
4041
  * Can only be used for commit specific overrides. Must be used in conjunction with
2300
4042
  * one of product_id, product_tags, pricing_group_values, or
@@ -2307,13 +4049,13 @@ export namespace ContractAmendParams {
2307
4049
  * A map of group names to values. The override will only apply to line items with
2308
4050
  * the specified presentation group values.
2309
4051
  */
2310
- presentation_group_values?: Record<string, string>;
4052
+ presentation_group_values?: { [key: string]: string };
2311
4053
 
2312
4054
  /**
2313
4055
  * A map of pricing group names to values. The override will only apply to products
2314
4056
  * with the specified pricing group values.
2315
4057
  */
2316
- pricing_group_values?: Record<string, string>;
4058
+ pricing_group_values?: { [key: string]: string };
2317
4059
 
2318
4060
  /**
2319
4061
  * If provided, the override will only apply to the product with the specified ID.
@@ -2355,7 +4097,7 @@ export namespace ContractAmendParams {
2355
4097
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2356
4098
  * processors.
2357
4099
  */
2358
- custom_rate?: Record<string, unknown>;
4100
+ custom_rate?: { [key: string]: unknown };
2359
4101
 
2360
4102
  /**
2361
4103
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -2407,7 +4149,7 @@ export namespace ContractAmendParams {
2407
4149
  */
2408
4150
  unit_price: number;
2409
4151
 
2410
- custom_fields?: Record<string, string>;
4152
+ custom_fields?: { [key: string]: string };
2411
4153
 
2412
4154
  description?: string;
2413
4155
 
@@ -2627,7 +4369,7 @@ export namespace ContractCreateHistoricalInvoicesParams {
2627
4369
 
2628
4370
  breakdown_granularity?: 'HOUR' | 'DAY';
2629
4371
 
2630
- custom_fields?: Record<string, string>;
4372
+ custom_fields?: { [key: string]: string };
2631
4373
  }
2632
4374
 
2633
4375
  export namespace Invoice {
@@ -2638,9 +4380,9 @@ export namespace ContractCreateHistoricalInvoicesParams {
2638
4380
 
2639
4381
  product_id: string;
2640
4382
 
2641
- presentation_group_values?: Record<string, string>;
4383
+ presentation_group_values?: { [key: string]: string };
2642
4384
 
2643
- pricing_group_values?: Record<string, string>;
4385
+ pricing_group_values?: { [key: string]: string };
2644
4386
 
2645
4387
  quantity?: number;
2646
4388
 
@@ -2675,7 +4417,7 @@ export interface ContractListBalancesParams {
2675
4417
  effective_before?: string;
2676
4418
 
2677
4419
  /**
2678
- * Include credits from archived contracts.
4420
+ * Include archived credits and credits from archived contracts.
2679
4421
  */
2680
4422
  include_archived?: boolean;
2681
4423
 
@@ -2696,6 +4438,11 @@ export interface ContractListBalancesParams {
2696
4438
  */
2697
4439
  include_ledgers?: boolean;
2698
4440
 
4441
+ /**
4442
+ * The maximum number of commits to return. Defaults to 25.
4443
+ */
4444
+ limit?: number;
4445
+
2699
4446
  /**
2700
4447
  * The next page token from a previous response.
2701
4448
  */
@@ -2744,17 +4491,23 @@ export interface ContractRetrieveRateScheduleParams {
2744
4491
 
2745
4492
  export namespace ContractRetrieveRateScheduleParams {
2746
4493
  export interface Selector {
4494
+ /**
4495
+ * Subscription rates matching the billing frequency will be included in the
4496
+ * response.
4497
+ */
4498
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
4499
+
2747
4500
  /**
2748
4501
  * List of pricing group key value pairs, rates containing the matching key / value
2749
4502
  * pairs will be included in the response.
2750
4503
  */
2751
- partial_pricing_group_values?: Record<string, string>;
4504
+ partial_pricing_group_values?: { [key: string]: string };
2752
4505
 
2753
4506
  /**
2754
4507
  * List of pricing group key value pairs, rates matching all of the key / value
2755
4508
  * pairs will be included in the response.
2756
4509
  */
2757
- pricing_group_values?: Record<string, string>;
4510
+ pricing_group_values?: { [key: string]: string };
2758
4511
 
2759
4512
  /**
2760
4513
  * Rates matching the product id will be included in the response.
@@ -2769,6 +4522,14 @@ export namespace ContractRetrieveRateScheduleParams {
2769
4522
  }
2770
4523
  }
2771
4524
 
4525
+ export interface ContractRetrieveSubscriptionQuantityHistoryParams {
4526
+ contract_id: string;
4527
+
4528
+ customer_id: string;
4529
+
4530
+ subscription_id: string;
4531
+ }
4532
+
2772
4533
  export interface ContractScheduleProServicesInvoiceParams {
2773
4534
  contract_id: string;
2774
4535
 
@@ -2895,6 +4656,7 @@ export declare namespace Contracts {
2895
4656
  type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
2896
4657
  type ContractListBalancesResponse as ContractListBalancesResponse,
2897
4658
  type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
4659
+ type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
2898
4660
  type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
2899
4661
  type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse,
2900
4662
  type ContractCreateParams as ContractCreateParams,
@@ -2906,6 +4668,7 @@ export declare namespace Contracts {
2906
4668
  type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
2907
4669
  type ContractListBalancesParams as ContractListBalancesParams,
2908
4670
  type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
4671
+ type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
2909
4672
  type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams,
2910
4673
  type ContractSetUsageFilterParams as ContractSetUsageFilterParams,
2911
4674
  type ContractUpdateEndDateParams as ContractUpdateEndDateParams,
@@ -2935,12 +4698,14 @@ export declare namespace Contracts {
2935
4698
  type RateCardRetrieveResponse as RateCardRetrieveResponse,
2936
4699
  type RateCardUpdateResponse as RateCardUpdateResponse,
2937
4700
  type RateCardListResponse as RateCardListResponse,
4701
+ type RateCardArchiveResponse as RateCardArchiveResponse,
2938
4702
  type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse,
2939
4703
  RateCardListResponsesCursorPage as RateCardListResponsesCursorPage,
2940
4704
  type RateCardCreateParams as RateCardCreateParams,
2941
4705
  type RateCardRetrieveParams as RateCardRetrieveParams,
2942
4706
  type RateCardUpdateParams as RateCardUpdateParams,
2943
4707
  type RateCardListParams as RateCardListParams,
4708
+ type RateCardArchiveParams as RateCardArchiveParams,
2944
4709
  type RateCardRetrieveRateScheduleParams as RateCardRetrieveRateScheduleParams,
2945
4710
  };
2946
4711