@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,64 +1,239 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
3
- import * as Shared from "../shared.js";
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ import * as Shared from "../../shared.js";
4
4
  import * as NamedSchedulesAPI from "./named-schedules.js";
5
5
  import { NamedScheduleRetrieveParams, NamedScheduleRetrieveResponse, NamedScheduleUpdateParams, NamedSchedules } from "./named-schedules.js";
6
6
  import * as ProductsAPI from "./products.js";
7
7
  import { ProductArchiveParams, ProductArchiveResponse, ProductCreateParams, ProductCreateResponse, ProductListItemState, ProductListParams, ProductListResponse, ProductListResponsesCursorPage, ProductRetrieveParams, ProductRetrieveResponse, ProductUpdateParams, ProductUpdateResponse, Products, QuantityConversion, QuantityRounding } from "./products.js";
8
8
  import * as InvoicesAPI from "../customers/invoices.js";
9
9
  import * as RateCardsAPI from "./rate-cards/rate-cards.js";
10
- import { RateCardCreateParams, RateCardCreateResponse, RateCardListParams, RateCardListResponse, RateCardListResponsesCursorPage, RateCardRetrieveParams, RateCardRetrieveRateScheduleParams, RateCardRetrieveRateScheduleResponse, RateCardRetrieveResponse, RateCardUpdateParams, RateCardUpdateResponse, RateCards } from "./rate-cards/rate-cards.js";
10
+ import { RateCardArchiveParams, RateCardArchiveResponse, RateCardCreateParams, RateCardCreateResponse, RateCardListParams, RateCardListResponse, RateCardListResponsesCursorPage, RateCardRetrieveParams, RateCardRetrieveRateScheduleParams, RateCardRetrieveRateScheduleResponse, RateCardRetrieveResponse, RateCardUpdateParams, RateCardUpdateResponse, RateCards } from "./rate-cards/rate-cards.js";
11
11
  export declare class Contracts extends APIResource {
12
12
  products: ProductsAPI.Products;
13
13
  rateCards: RateCardsAPI.RateCards;
14
14
  namedSchedules: NamedSchedulesAPI.NamedSchedules;
15
15
  /**
16
16
  * Create a new contract
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const contract = await client.v1.contracts.create({
21
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
22
+ * starting_at: '2020-01-01T00:00:00.000Z',
23
+ * billing_provider_configuration: {
24
+ * billing_provider: 'stripe',
25
+ * delivery_method: 'direct_to_billing_provider',
26
+ * },
27
+ * rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
28
+ * });
29
+ * ```
17
30
  */
18
31
  create(body: ContractCreateParams, options?: Core.RequestOptions): Core.APIPromise<ContractCreateResponse>;
19
32
  /**
20
- * Get a specific contract
33
+ * This is the v1 endpoint to get a contract. New clients should implement using
34
+ * the v2 endpoint.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const contract = await client.v1.contracts.retrieve({
39
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
40
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
41
+ * });
42
+ * ```
21
43
  */
22
44
  retrieve(body: ContractRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<ContractRetrieveResponse>;
23
45
  /**
24
- * List all contracts for a customer
46
+ * This is the v1 endpoint to list all contracts for a customer. New clients should
47
+ * implement using the v2 endpoint.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const contracts = await client.v1.contracts.list({
52
+ * customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
53
+ * });
54
+ * ```
25
55
  */
26
56
  list(body: ContractListParams, options?: Core.RequestOptions): Core.APIPromise<ContractListResponse>;
27
57
  /**
28
58
  * Add a manual balance entry
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await client.v1.contracts.addManualBalanceEntry({
63
+ * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
64
+ * amount: -1000,
65
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
66
+ * reason: 'Reason for entry',
67
+ * segment_id: '66368e29-3f97-4d15-a6e9-120897f0070a',
68
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
69
+ * });
70
+ * ```
29
71
  */
30
72
  addManualBalanceEntry(body: ContractAddManualBalanceEntryParams, options?: Core.RequestOptions): Core.APIPromise<void>;
31
73
  /**
32
- * Amend a contract
74
+ * Amendments will be replaced by Contract editing. New clients should implement
75
+ * using the editContract endpoint. Read more about the migration to contract
76
+ * editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
77
+ * reach out to your Metronome representative for more details. Once contract
78
+ * editing is enabled, access to this endpoint will be removed.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const response = await client.v1.contracts.amend({
83
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
84
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
85
+ * starting_at: '2020-01-01T00:00:00.000Z',
86
+ * });
87
+ * ```
33
88
  */
34
89
  amend(body: ContractAmendParams, options?: Core.RequestOptions): Core.APIPromise<ContractAmendResponse>;
35
90
  /**
36
91
  * Archive a contract
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const response = await client.v1.contracts.archive({
96
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
97
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
98
+ * void_invoices: true,
99
+ * });
100
+ * ```
37
101
  */
38
102
  archive(body: ContractArchiveParams, options?: Core.RequestOptions): Core.APIPromise<ContractArchiveResponse>;
39
103
  /**
40
104
  * Creates historical usage invoices for a contract
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const response =
109
+ * await client.v1.contracts.createHistoricalInvoices({
110
+ * invoices: [
111
+ * {
112
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
113
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
114
+ * credit_type_id:
115
+ * '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
116
+ * inclusive_start_date: '2020-01-01T00:00:00.000Z',
117
+ * exclusive_end_date: '2020-02-01T00:00:00.000Z',
118
+ * issue_date: '2020-02-01T00:00:00.000Z',
119
+ * usage_line_items: [
120
+ * {
121
+ * product_id:
122
+ * 'f14d6729-6a44-4b13-9908-9387f1918790',
123
+ * inclusive_start_date:
124
+ * '2020-01-01T00:00:00.000Z',
125
+ * exclusive_end_date: '2020-02-01T00:00:00.000Z',
126
+ * quantity: 100,
127
+ * },
128
+ * ],
129
+ * },
130
+ * ],
131
+ * preview: false,
132
+ * });
133
+ * ```
41
134
  */
42
135
  createHistoricalInvoices(body: ContractCreateHistoricalInvoicesParams, options?: Core.RequestOptions): Core.APIPromise<ContractCreateHistoricalInvoicesResponse>;
43
136
  /**
44
137
  * List balances (commits and credits).
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const response = await client.v1.contracts.listBalances({
142
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
143
+ * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
144
+ * include_ledgers: true,
145
+ * });
146
+ * ```
45
147
  */
46
148
  listBalances(body: ContractListBalancesParams, options?: Core.RequestOptions): Core.APIPromise<ContractListBalancesResponse>;
47
149
  /**
48
150
  * Get the rate schedule for the rate card on a given contract.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const response =
155
+ * await client.v1.contracts.retrieveRateSchedule({
156
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
157
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
158
+ * at: '2020-01-01T00:00:00.000Z',
159
+ * selectors: [
160
+ * {
161
+ * product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
162
+ * partial_pricing_group_values: {
163
+ * region: 'us-west-2',
164
+ * cloud: 'aws',
165
+ * },
166
+ * },
167
+ * ],
168
+ * });
169
+ * ```
49
170
  */
50
171
  retrieveRateSchedule(params: ContractRetrieveRateScheduleParams, options?: Core.RequestOptions): Core.APIPromise<ContractRetrieveRateScheduleResponse>;
172
+ /**
173
+ * Fetch the quantity and price for a subscription over time. End-point does not
174
+ * return future scheduled changes.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * const response =
179
+ * await client.v1.contracts.retrieveSubscriptionQuantityHistory(
180
+ * {
181
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
182
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
183
+ * subscription_id:
184
+ * '1a824d53-bde6-4d82-96d7-6347ff227d5c',
185
+ * },
186
+ * );
187
+ * ```
188
+ */
189
+ retrieveSubscriptionQuantityHistory(body: ContractRetrieveSubscriptionQuantityHistoryParams, options?: Core.RequestOptions): Core.APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse>;
51
190
  /**
52
191
  * Create a new scheduled invoice for Professional Services terms on a contract.
53
192
  * This endpoint's availability is dependent on your client's configuration.
193
+ *
194
+ * @example
195
+ * ```ts
196
+ * const response =
197
+ * await client.v1.contracts.scheduleProServicesInvoice({
198
+ * contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
199
+ * customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
200
+ * issued_at: '2019-12-27T18:11:19.117Z',
201
+ * line_items: [
202
+ * {
203
+ * professional_service_id:
204
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
205
+ * },
206
+ * ],
207
+ * });
208
+ * ```
54
209
  */
55
210
  scheduleProServicesInvoice(body: ContractScheduleProServicesInvoiceParams, options?: Core.RequestOptions): Core.APIPromise<ContractScheduleProServicesInvoiceResponse>;
56
211
  /**
57
212
  * Set usage filter for a contract
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * await client.v1.contracts.setUsageFilter({
217
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
218
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
219
+ * group_key: 'business_subscription_id',
220
+ * group_values: ['ID-1', 'ID-2'],
221
+ * starting_at: '2020-01-01T00:00:00.000Z',
222
+ * });
223
+ * ```
58
224
  */
59
225
  setUsageFilter(body: ContractSetUsageFilterParams, options?: Core.RequestOptions): Core.APIPromise<void>;
60
226
  /**
61
227
  * Update the end date of a contract
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * const response = await client.v1.contracts.updateEndDate({
232
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
233
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
234
+ * ending_before: '2020-01-01T00:00:00.000Z',
235
+ * });
236
+ * ```
62
237
  */
63
238
  updateEndDate(body: ContractUpdateEndDateParams, options?: Core.RequestOptions): Core.APIPromise<ContractUpdateEndDateResponse>;
64
239
  }
@@ -80,11 +255,18 @@ export declare namespace ContractRetrieveResponse {
80
255
  * the contract is not archived.
81
256
  */
82
257
  archived_at?: string;
83
- custom_fields?: Record<string, string>;
258
+ custom_fields?: {
259
+ [key: string]: string;
260
+ };
84
261
  /**
85
262
  * The billing provider configuration associated with a contract.
86
263
  */
87
264
  customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
265
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
266
+ /**
267
+ * Priority of the contract.
268
+ */
269
+ priority?: number;
88
270
  /**
89
271
  * Determines which scheduled and commit charges to consolidate onto the Contract's
90
272
  * usage invoice. The charge's `timestamp` must match the usage invoice's
@@ -93,6 +275,11 @@ export declare namespace ContractRetrieveResponse {
93
275
  * on a separate invoice from usage charges.
94
276
  */
95
277
  scheduled_charges_on_usage_invoices?: 'ALL';
278
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
279
+ /**
280
+ * List of subscriptions on the contract.
281
+ */
282
+ subscriptions?: Array<Data.Subscription>;
96
283
  /**
97
284
  * Prevents the creation of duplicates. If a request to create a record is made
98
285
  * with a previously used uniqueness key, a new record will not be created and the
@@ -152,6 +339,273 @@ export declare namespace ContractRetrieveResponse {
152
339
  interface CustomerBillingProviderConfiguration {
153
340
  billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
154
341
  delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
342
+ id?: string;
343
+ /**
344
+ * Configuration for the billing provider. The structure of this object is specific
345
+ * to the billing provider.
346
+ */
347
+ configuration?: {
348
+ [key: string]: unknown;
349
+ };
350
+ }
351
+ interface PrepaidBalanceThresholdConfiguration {
352
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
353
+ /**
354
+ * When set to false, the contract will not be evaluated against the
355
+ * threshold_amount. Toggling to true will result an immediate evaluation,
356
+ * regardless of prior state.
357
+ */
358
+ is_enabled: boolean;
359
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
360
+ /**
361
+ * Specify the amount the balance should be recharged to.
362
+ */
363
+ recharge_to_amount: number;
364
+ /**
365
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
366
+ * balance lowers to this amount, a threshold charge will be initiated.
367
+ */
368
+ threshold_amount: number;
369
+ /**
370
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
371
+ * commit amount will be in terms of this credit type instead of the fiat currency.
372
+ */
373
+ custom_credit_type_id?: string;
374
+ }
375
+ namespace PrepaidBalanceThresholdConfiguration {
376
+ interface Commit {
377
+ /**
378
+ * The commit product that will be used to generate the line item for commit
379
+ * payment.
380
+ */
381
+ product_id: string;
382
+ /**
383
+ * Which products the threshold commit applies to. If applicable_product_ids,
384
+ * applicable_product_tags or specifiers are not provided, the commit applies to
385
+ * all products.
386
+ */
387
+ applicable_product_ids?: Array<string>;
388
+ /**
389
+ * Which tags the threshold commit applies to. If applicable_product_ids,
390
+ * applicable_product_tags or specifiers are not provided, the commit applies to
391
+ * all products.
392
+ */
393
+ applicable_product_tags?: Array<string>;
394
+ description?: string;
395
+ /**
396
+ * Specify the name of the line item for the threshold charge. If left blank, it
397
+ * will default to the commit product name.
398
+ */
399
+ name?: string;
400
+ /**
401
+ * List of filters that determine what kind of customer usage draws down a commit
402
+ * or credit. A customer's usage needs to meet the condition of at least one of the
403
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
404
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
405
+ */
406
+ specifiers?: Array<Commit.Specifier>;
407
+ }
408
+ namespace Commit {
409
+ interface Specifier {
410
+ presentation_group_values?: {
411
+ [key: string]: string;
412
+ };
413
+ pricing_group_values?: {
414
+ [key: string]: string;
415
+ };
416
+ /**
417
+ * If provided, the specifier will only apply to the product with the specified ID.
418
+ */
419
+ product_id?: string;
420
+ /**
421
+ * If provided, the specifier will only apply to products with all the specified
422
+ * tags.
423
+ */
424
+ product_tags?: Array<string>;
425
+ }
426
+ }
427
+ interface PaymentGateConfig {
428
+ /**
429
+ * Gate access to the commit balance based on successful collection of payment.
430
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
431
+ * facilitate payment using your own payment integration. Select NONE if you do not
432
+ * wish to payment gate the commit balance.
433
+ */
434
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
435
+ /**
436
+ * Only applicable if using PRECALCULATED as your tax type.
437
+ */
438
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
439
+ /**
440
+ * Only applicable if using STRIPE as your payment gate type.
441
+ */
442
+ stripe_config?: PaymentGateConfig.StripeConfig;
443
+ /**
444
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
445
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
446
+ * will default to NONE.
447
+ */
448
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
449
+ }
450
+ namespace PaymentGateConfig {
451
+ /**
452
+ * Only applicable if using PRECALCULATED as your tax type.
453
+ */
454
+ interface PrecalculatedTaxConfig {
455
+ /**
456
+ * Amount of tax to be applied. This should be in the same currency and
457
+ * denomination as the commit's invoice schedule
458
+ */
459
+ tax_amount: number;
460
+ /**
461
+ * Name of the tax to be applied. This may be used in an invoice line item
462
+ * description.
463
+ */
464
+ tax_name?: string;
465
+ }
466
+ /**
467
+ * Only applicable if using STRIPE as your payment gate type.
468
+ */
469
+ interface StripeConfig {
470
+ /**
471
+ * If left blank, will default to INVOICE
472
+ */
473
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
474
+ /**
475
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
476
+ * your payment type.
477
+ */
478
+ invoice_metadata?: {
479
+ [key: string]: string;
480
+ };
481
+ }
482
+ }
483
+ }
484
+ interface SpendThresholdConfiguration {
485
+ commit: SpendThresholdConfiguration.Commit;
486
+ /**
487
+ * When set to false, the contract will not be evaluated against the
488
+ * threshold_amount. Toggling to true will result an immediate evaluation,
489
+ * regardless of prior state.
490
+ */
491
+ is_enabled: boolean;
492
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
493
+ /**
494
+ * Specify the threshold amount for the contract. Each time the contract's usage
495
+ * hits this amount, a threshold charge will be initiated.
496
+ */
497
+ threshold_amount: number;
498
+ }
499
+ namespace SpendThresholdConfiguration {
500
+ interface Commit {
501
+ /**
502
+ * The commit product that will be used to generate the line item for commit
503
+ * payment.
504
+ */
505
+ product_id: string;
506
+ description?: string;
507
+ /**
508
+ * Specify the name of the line item for the threshold charge. If left blank, it
509
+ * will default to the commit product name.
510
+ */
511
+ name?: string;
512
+ }
513
+ interface PaymentGateConfig {
514
+ /**
515
+ * Gate access to the commit balance based on successful collection of payment.
516
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
517
+ * facilitate payment using your own payment integration. Select NONE if you do not
518
+ * wish to payment gate the commit balance.
519
+ */
520
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
521
+ /**
522
+ * Only applicable if using PRECALCULATED as your tax type.
523
+ */
524
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
525
+ /**
526
+ * Only applicable if using STRIPE as your payment gate type.
527
+ */
528
+ stripe_config?: PaymentGateConfig.StripeConfig;
529
+ /**
530
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
531
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
532
+ * will default to NONE.
533
+ */
534
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
535
+ }
536
+ namespace PaymentGateConfig {
537
+ /**
538
+ * Only applicable if using PRECALCULATED as your tax type.
539
+ */
540
+ interface PrecalculatedTaxConfig {
541
+ /**
542
+ * Amount of tax to be applied. This should be in the same currency and
543
+ * denomination as the commit's invoice schedule
544
+ */
545
+ tax_amount: number;
546
+ /**
547
+ * Name of the tax to be applied. This may be used in an invoice line item
548
+ * description.
549
+ */
550
+ tax_name?: string;
551
+ }
552
+ /**
553
+ * Only applicable if using STRIPE as your payment gate type.
554
+ */
555
+ interface StripeConfig {
556
+ /**
557
+ * If left blank, will default to INVOICE
558
+ */
559
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
560
+ /**
561
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
562
+ * your payment type.
563
+ */
564
+ invoice_metadata?: {
565
+ [key: string]: string;
566
+ };
567
+ }
568
+ }
569
+ }
570
+ interface Subscription {
571
+ collection_schedule: 'ADVANCE' | 'ARREARS';
572
+ proration: Subscription.Proration;
573
+ /**
574
+ * List of quantity schedule items for the subscription. Only includes the current
575
+ * quantity and future quantity changes.
576
+ */
577
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
578
+ starting_at: string;
579
+ subscription_rate: Subscription.SubscriptionRate;
580
+ id?: string;
581
+ custom_fields?: {
582
+ [key: string]: string;
583
+ };
584
+ description?: string;
585
+ ending_before?: string;
586
+ fiat_credit_type_id?: string;
587
+ name?: string;
588
+ }
589
+ namespace Subscription {
590
+ interface Proration {
591
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
592
+ is_prorated: boolean;
593
+ }
594
+ interface QuantitySchedule {
595
+ quantity: number;
596
+ starting_at: string;
597
+ ending_before?: string;
598
+ }
599
+ interface SubscriptionRate {
600
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
601
+ product: SubscriptionRate.Product;
602
+ }
603
+ namespace SubscriptionRate {
604
+ interface Product {
605
+ id: string;
606
+ name: string;
607
+ }
608
+ }
155
609
  }
156
610
  }
157
611
  }
@@ -170,11 +624,18 @@ export declare namespace ContractListResponse {
170
624
  * the contract is not archived.
171
625
  */
172
626
  archived_at?: string;
173
- custom_fields?: Record<string, string>;
627
+ custom_fields?: {
628
+ [key: string]: string;
629
+ };
174
630
  /**
175
631
  * The billing provider configuration associated with a contract.
176
632
  */
177
633
  customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
634
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
635
+ /**
636
+ * Priority of the contract.
637
+ */
638
+ priority?: number;
178
639
  /**
179
640
  * Determines which scheduled and commit charges to consolidate onto the Contract's
180
641
  * usage invoice. The charge's `timestamp` must match the usage invoice's
@@ -183,6 +644,11 @@ export declare namespace ContractListResponse {
183
644
  * on a separate invoice from usage charges.
184
645
  */
185
646
  scheduled_charges_on_usage_invoices?: 'ALL';
647
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
648
+ /**
649
+ * List of subscriptions on the contract.
650
+ */
651
+ subscriptions?: Array<Data.Subscription>;
186
652
  /**
187
653
  * Prevents the creation of duplicates. If a request to create a record is made
188
654
  * with a previously used uniqueness key, a new record will not be created and the
@@ -242,6 +708,273 @@ export declare namespace ContractListResponse {
242
708
  interface CustomerBillingProviderConfiguration {
243
709
  billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
244
710
  delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
711
+ id?: string;
712
+ /**
713
+ * Configuration for the billing provider. The structure of this object is specific
714
+ * to the billing provider.
715
+ */
716
+ configuration?: {
717
+ [key: string]: unknown;
718
+ };
719
+ }
720
+ interface PrepaidBalanceThresholdConfiguration {
721
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
722
+ /**
723
+ * When set to false, the contract will not be evaluated against the
724
+ * threshold_amount. Toggling to true will result an immediate evaluation,
725
+ * regardless of prior state.
726
+ */
727
+ is_enabled: boolean;
728
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
729
+ /**
730
+ * Specify the amount the balance should be recharged to.
731
+ */
732
+ recharge_to_amount: number;
733
+ /**
734
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
735
+ * balance lowers to this amount, a threshold charge will be initiated.
736
+ */
737
+ threshold_amount: number;
738
+ /**
739
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
740
+ * commit amount will be in terms of this credit type instead of the fiat currency.
741
+ */
742
+ custom_credit_type_id?: string;
743
+ }
744
+ namespace PrepaidBalanceThresholdConfiguration {
745
+ interface Commit {
746
+ /**
747
+ * The commit product that will be used to generate the line item for commit
748
+ * payment.
749
+ */
750
+ product_id: string;
751
+ /**
752
+ * Which products the threshold commit applies to. If applicable_product_ids,
753
+ * applicable_product_tags or specifiers are not provided, the commit applies to
754
+ * all products.
755
+ */
756
+ applicable_product_ids?: Array<string>;
757
+ /**
758
+ * Which tags the threshold commit applies to. If applicable_product_ids,
759
+ * applicable_product_tags or specifiers are not provided, the commit applies to
760
+ * all products.
761
+ */
762
+ applicable_product_tags?: Array<string>;
763
+ description?: string;
764
+ /**
765
+ * Specify the name of the line item for the threshold charge. If left blank, it
766
+ * will default to the commit product name.
767
+ */
768
+ name?: string;
769
+ /**
770
+ * List of filters that determine what kind of customer usage draws down a commit
771
+ * or credit. A customer's usage needs to meet the condition of at least one of the
772
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
773
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
774
+ */
775
+ specifiers?: Array<Commit.Specifier>;
776
+ }
777
+ namespace Commit {
778
+ interface Specifier {
779
+ presentation_group_values?: {
780
+ [key: string]: string;
781
+ };
782
+ pricing_group_values?: {
783
+ [key: string]: string;
784
+ };
785
+ /**
786
+ * If provided, the specifier will only apply to the product with the specified ID.
787
+ */
788
+ product_id?: string;
789
+ /**
790
+ * If provided, the specifier will only apply to products with all the specified
791
+ * tags.
792
+ */
793
+ product_tags?: Array<string>;
794
+ }
795
+ }
796
+ interface PaymentGateConfig {
797
+ /**
798
+ * Gate access to the commit balance based on successful collection of payment.
799
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
800
+ * facilitate payment using your own payment integration. Select NONE if you do not
801
+ * wish to payment gate the commit balance.
802
+ */
803
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
804
+ /**
805
+ * Only applicable if using PRECALCULATED as your tax type.
806
+ */
807
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
808
+ /**
809
+ * Only applicable if using STRIPE as your payment gate type.
810
+ */
811
+ stripe_config?: PaymentGateConfig.StripeConfig;
812
+ /**
813
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
814
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
815
+ * will default to NONE.
816
+ */
817
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
818
+ }
819
+ namespace PaymentGateConfig {
820
+ /**
821
+ * Only applicable if using PRECALCULATED as your tax type.
822
+ */
823
+ interface PrecalculatedTaxConfig {
824
+ /**
825
+ * Amount of tax to be applied. This should be in the same currency and
826
+ * denomination as the commit's invoice schedule
827
+ */
828
+ tax_amount: number;
829
+ /**
830
+ * Name of the tax to be applied. This may be used in an invoice line item
831
+ * description.
832
+ */
833
+ tax_name?: string;
834
+ }
835
+ /**
836
+ * Only applicable if using STRIPE as your payment gate type.
837
+ */
838
+ interface StripeConfig {
839
+ /**
840
+ * If left blank, will default to INVOICE
841
+ */
842
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
843
+ /**
844
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
845
+ * your payment type.
846
+ */
847
+ invoice_metadata?: {
848
+ [key: string]: string;
849
+ };
850
+ }
851
+ }
852
+ }
853
+ interface SpendThresholdConfiguration {
854
+ commit: SpendThresholdConfiguration.Commit;
855
+ /**
856
+ * When set to false, the contract will not be evaluated against the
857
+ * threshold_amount. Toggling to true will result an immediate evaluation,
858
+ * regardless of prior state.
859
+ */
860
+ is_enabled: boolean;
861
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
862
+ /**
863
+ * Specify the threshold amount for the contract. Each time the contract's usage
864
+ * hits this amount, a threshold charge will be initiated.
865
+ */
866
+ threshold_amount: number;
867
+ }
868
+ namespace SpendThresholdConfiguration {
869
+ interface Commit {
870
+ /**
871
+ * The commit product that will be used to generate the line item for commit
872
+ * payment.
873
+ */
874
+ product_id: string;
875
+ description?: string;
876
+ /**
877
+ * Specify the name of the line item for the threshold charge. If left blank, it
878
+ * will default to the commit product name.
879
+ */
880
+ name?: string;
881
+ }
882
+ interface PaymentGateConfig {
883
+ /**
884
+ * Gate access to the commit balance based on successful collection of payment.
885
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
886
+ * facilitate payment using your own payment integration. Select NONE if you do not
887
+ * wish to payment gate the commit balance.
888
+ */
889
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
890
+ /**
891
+ * Only applicable if using PRECALCULATED as your tax type.
892
+ */
893
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
894
+ /**
895
+ * Only applicable if using STRIPE as your payment gate type.
896
+ */
897
+ stripe_config?: PaymentGateConfig.StripeConfig;
898
+ /**
899
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
900
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
901
+ * will default to NONE.
902
+ */
903
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
904
+ }
905
+ namespace PaymentGateConfig {
906
+ /**
907
+ * Only applicable if using PRECALCULATED as your tax type.
908
+ */
909
+ interface PrecalculatedTaxConfig {
910
+ /**
911
+ * Amount of tax to be applied. This should be in the same currency and
912
+ * denomination as the commit's invoice schedule
913
+ */
914
+ tax_amount: number;
915
+ /**
916
+ * Name of the tax to be applied. This may be used in an invoice line item
917
+ * description.
918
+ */
919
+ tax_name?: string;
920
+ }
921
+ /**
922
+ * Only applicable if using STRIPE as your payment gate type.
923
+ */
924
+ interface StripeConfig {
925
+ /**
926
+ * If left blank, will default to INVOICE
927
+ */
928
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
929
+ /**
930
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
931
+ * your payment type.
932
+ */
933
+ invoice_metadata?: {
934
+ [key: string]: string;
935
+ };
936
+ }
937
+ }
938
+ }
939
+ interface Subscription {
940
+ collection_schedule: 'ADVANCE' | 'ARREARS';
941
+ proration: Subscription.Proration;
942
+ /**
943
+ * List of quantity schedule items for the subscription. Only includes the current
944
+ * quantity and future quantity changes.
945
+ */
946
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
947
+ starting_at: string;
948
+ subscription_rate: Subscription.SubscriptionRate;
949
+ id?: string;
950
+ custom_fields?: {
951
+ [key: string]: string;
952
+ };
953
+ description?: string;
954
+ ending_before?: string;
955
+ fiat_credit_type_id?: string;
956
+ name?: string;
957
+ }
958
+ namespace Subscription {
959
+ interface Proration {
960
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
961
+ is_prorated: boolean;
962
+ }
963
+ interface QuantitySchedule {
964
+ quantity: number;
965
+ starting_at: string;
966
+ ending_before?: string;
967
+ }
968
+ interface SubscriptionRate {
969
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
970
+ product: SubscriptionRate.Product;
971
+ }
972
+ namespace SubscriptionRate {
973
+ interface Product {
974
+ id: string;
975
+ name: string;
976
+ }
977
+ }
245
978
  }
246
979
  }
247
980
  }
@@ -266,12 +999,15 @@ export declare namespace ContractRetrieveRateScheduleResponse {
266
999
  interface Data {
267
1000
  entitled: boolean;
268
1001
  list_rate: Shared.Rate;
269
- product_custom_fields: Record<string, string>;
1002
+ product_custom_fields: {
1003
+ [key: string]: string;
1004
+ };
270
1005
  product_id: string;
271
1006
  product_name: string;
272
1007
  product_tags: Array<string>;
273
1008
  rate_card_id: string;
274
1009
  starting_at: string;
1010
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
275
1011
  /**
276
1012
  * A distinct rate on the rate card. You can choose to use this rate rather than
277
1013
  * list rate when consuming a credit or commit.
@@ -279,7 +1015,9 @@ export declare namespace ContractRetrieveRateScheduleResponse {
279
1015
  commit_rate?: Data.CommitRate;
280
1016
  ending_before?: string;
281
1017
  override_rate?: Shared.Rate;
282
- pricing_group_values?: Record<string, string>;
1018
+ pricing_group_values?: {
1019
+ [key: string]: string;
1020
+ };
283
1021
  }
284
1022
  namespace Data {
285
1023
  /**
@@ -299,6 +1037,29 @@ export declare namespace ContractRetrieveRateScheduleResponse {
299
1037
  }
300
1038
  }
301
1039
  }
1040
+ export interface ContractRetrieveSubscriptionQuantityHistoryResponse {
1041
+ data: ContractRetrieveSubscriptionQuantityHistoryResponse.Data;
1042
+ }
1043
+ export declare namespace ContractRetrieveSubscriptionQuantityHistoryResponse {
1044
+ interface Data {
1045
+ fiat_credit_type_id?: string;
1046
+ history?: Array<Data.History>;
1047
+ subscription_id?: string;
1048
+ }
1049
+ namespace Data {
1050
+ interface History {
1051
+ data: Array<History.Data>;
1052
+ starting_at: string;
1053
+ }
1054
+ namespace History {
1055
+ interface Data {
1056
+ quantity: number;
1057
+ total: number;
1058
+ unit_price: number;
1059
+ }
1060
+ }
1061
+ }
1062
+ }
302
1063
  export interface ContractScheduleProServicesInvoiceResponse {
303
1064
  data: Array<InvoicesAPI.Invoice>;
304
1065
  }
@@ -312,12 +1073,15 @@ export interface ContractCreateParams {
312
1073
  */
313
1074
  starting_at: string;
314
1075
  /**
315
- * The billing provider configuration associated with a contract.
1076
+ * The billing provider configuration associated with a contract. Provide either an
1077
+ * ID or the provider and delivery method.
316
1078
  */
317
1079
  billing_provider_configuration?: ContractCreateParams.BillingProviderConfiguration;
318
1080
  commits?: Array<ContractCreateParams.Commit>;
319
1081
  credits?: Array<ContractCreateParams.Credit>;
320
- custom_fields?: Record<string, string>;
1082
+ custom_fields?: {
1083
+ [key: string]: string;
1084
+ };
321
1085
  /**
322
1086
  * This field's availability is dependent on your client's configuration.
323
1087
  */
@@ -326,6 +1090,7 @@ export interface ContractCreateParams {
326
1090
  * exclusive contract end time
327
1091
  */
328
1092
  ending_before?: string;
1093
+ hierarchy_configuration?: ContractCreateParams.HierarchyConfiguration;
329
1094
  /**
330
1095
  * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
331
1096
  * prices automatically. EXPLICIT prioritization requires specifying priorities for
@@ -340,6 +1105,11 @@ export interface ContractCreateParams {
340
1105
  */
341
1106
  netsuite_sales_order_id?: string;
342
1107
  overrides?: Array<ContractCreateParams.Override>;
1108
+ prepaid_balance_threshold_configuration?: ContractCreateParams.PrepaidBalanceThresholdConfiguration;
1109
+ /**
1110
+ * Priority of the contract.
1111
+ */
1112
+ priority?: number;
343
1113
  /**
344
1114
  * This field's availability is dependent on your client's configuration.
345
1115
  */
@@ -369,6 +1139,13 @@ export interface ContractCreateParams {
369
1139
  * on a separate invoice from usage charges.
370
1140
  */
371
1141
  scheduled_charges_on_usage_invoices?: 'ALL';
1142
+ spend_threshold_configuration?: ContractCreateParams.SpendThresholdConfiguration;
1143
+ /**
1144
+ * Optional list of
1145
+ * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
1146
+ * to add to the contract.
1147
+ */
1148
+ subscriptions?: Array<ContractCreateParams.Subscription>;
372
1149
  /**
373
1150
  * This field's availability is dependent on your client's configuration.
374
1151
  */
@@ -385,14 +1162,23 @@ export interface ContractCreateParams {
385
1162
  }
386
1163
  export declare namespace ContractCreateParams {
387
1164
  /**
388
- * The billing provider configuration associated with a contract.
1165
+ * The billing provider configuration associated with a contract. Provide either an
1166
+ * ID or the provider and delivery method.
389
1167
  */
390
1168
  interface BillingProviderConfiguration {
1169
+ /**
1170
+ * Do not specify if using billing_provider_configuration_id.
1171
+ */
391
1172
  billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite';
392
1173
  /**
393
- * The Metronome ID of the billing provider configuration
1174
+ * The Metronome ID of the billing provider configuration. Use when a customer has
1175
+ * multiple configurations with the same billing provider and delivery method.
1176
+ * Otherwise, specify the billing_provider and delivery_method.
394
1177
  */
395
1178
  billing_provider_configuration_id?: string;
1179
+ /**
1180
+ * Do not specify if using billing_provider_configuration_id.
1181
+ */
396
1182
  delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
397
1183
  }
398
1184
  interface Commit {
@@ -409,20 +1195,28 @@ export declare namespace ContractCreateParams {
409
1195
  */
410
1196
  amount?: number;
411
1197
  /**
412
- * Which products the commit applies to. If both applicable_product_ids and
413
- * applicable_product_tags are not provided, the commit applies to all products.
1198
+ * Which products the commit applies to. If applicable_product_ids,
1199
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1200
+ * all products.
414
1201
  */
415
1202
  applicable_product_ids?: Array<string>;
416
1203
  /**
417
- * Which tags the commit applies to. If both applicable_product_ids and
418
- * applicable_product_tags are not provided, the commit applies to all products.
1204
+ * Which tags the commit applies to. If applicable_product_ids,
1205
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1206
+ * all products.
419
1207
  */
420
1208
  applicable_product_tags?: Array<string>;
421
- custom_fields?: Record<string, string>;
1209
+ custom_fields?: {
1210
+ [key: string]: string;
1211
+ };
422
1212
  /**
423
1213
  * Used only in UI/API. It is not exposed to end customers.
424
1214
  */
425
1215
  description?: string;
1216
+ /**
1217
+ * Optional configuration for commit hierarchy access control
1218
+ */
1219
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
426
1220
  /**
427
1221
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
428
1222
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -438,6 +1232,10 @@ export declare namespace ContractCreateParams {
438
1232
  * This field's availability is dependent on your client's configuration.
439
1233
  */
440
1234
  netsuite_sales_order_id?: string;
1235
+ /**
1236
+ * optionally payment gate this commit
1237
+ */
1238
+ payment_gate_config?: Commit.PaymentGateConfig;
441
1239
  /**
442
1240
  * If multiple commits are applicable, the one with the lower priority will apply
443
1241
  * first.
@@ -448,6 +1246,13 @@ export declare namespace ContractCreateParams {
448
1246
  * Fraction of unused segments that will be rolled over. Must be between 0 and 1.
449
1247
  */
450
1248
  rollover_fraction?: number;
1249
+ /**
1250
+ * List of filters that determine what kind of customer usage draws down a commit
1251
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1252
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1253
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1254
+ */
1255
+ specifiers?: Array<Commit.Specifier>;
451
1256
  /**
452
1257
  * A temporary ID for the commit that can be used to reference the commit for
453
1258
  * commit specific overrides.
@@ -480,6 +1285,24 @@ export declare namespace ContractCreateParams {
480
1285
  starting_at: string;
481
1286
  }
482
1287
  }
1288
+ /**
1289
+ * Optional configuration for commit hierarchy access control
1290
+ */
1291
+ interface HierarchyConfiguration {
1292
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1293
+ }
1294
+ namespace HierarchyConfiguration {
1295
+ interface CommitHierarchyChildAccessAll {
1296
+ type: 'ALL';
1297
+ }
1298
+ interface CommitHierarchyChildAccessNone {
1299
+ type: 'NONE';
1300
+ }
1301
+ interface CommitHierarchyChildAccessContractIDs {
1302
+ contract_ids: Array<string>;
1303
+ type: 'CONTRACT_IDS';
1304
+ }
1305
+ }
483
1306
  /**
484
1307
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
485
1308
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -563,6 +1386,82 @@ export declare namespace ContractCreateParams {
563
1386
  unit_price?: number;
564
1387
  }
565
1388
  }
1389
+ /**
1390
+ * optionally payment gate this commit
1391
+ */
1392
+ interface PaymentGateConfig {
1393
+ /**
1394
+ * Gate access to the commit balance based on successful collection of payment.
1395
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1396
+ * facilitate payment using your own payment integration. Select NONE if you do not
1397
+ * wish to payment gate the commit balance.
1398
+ */
1399
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1400
+ /**
1401
+ * Only applicable if using PRECALCULATED as your tax type.
1402
+ */
1403
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1404
+ /**
1405
+ * Only applicable if using STRIPE as your payment gate type.
1406
+ */
1407
+ stripe_config?: PaymentGateConfig.StripeConfig;
1408
+ /**
1409
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1410
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1411
+ * will default to NONE.
1412
+ */
1413
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1414
+ }
1415
+ namespace PaymentGateConfig {
1416
+ /**
1417
+ * Only applicable if using PRECALCULATED as your tax type.
1418
+ */
1419
+ interface PrecalculatedTaxConfig {
1420
+ /**
1421
+ * Amount of tax to be applied. This should be in the same currency and
1422
+ * denomination as the commit's invoice schedule
1423
+ */
1424
+ tax_amount: number;
1425
+ /**
1426
+ * Name of the tax to be applied. This may be used in an invoice line item
1427
+ * description.
1428
+ */
1429
+ tax_name?: string;
1430
+ }
1431
+ /**
1432
+ * Only applicable if using STRIPE as your payment gate type.
1433
+ */
1434
+ interface StripeConfig {
1435
+ /**
1436
+ * If left blank, will default to INVOICE
1437
+ */
1438
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1439
+ /**
1440
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1441
+ * your payment type.
1442
+ */
1443
+ invoice_metadata?: {
1444
+ [key: string]: string;
1445
+ };
1446
+ }
1447
+ }
1448
+ interface Specifier {
1449
+ presentation_group_values?: {
1450
+ [key: string]: string;
1451
+ };
1452
+ pricing_group_values?: {
1453
+ [key: string]: string;
1454
+ };
1455
+ /**
1456
+ * If provided, the specifier will only apply to the product with the specified ID.
1457
+ */
1458
+ product_id?: string;
1459
+ /**
1460
+ * If provided, the specifier will only apply to products with all the specified
1461
+ * tags.
1462
+ */
1463
+ product_tags?: Array<string>;
1464
+ }
566
1465
  }
567
1466
  interface Credit {
568
1467
  /**
@@ -580,11 +1479,17 @@ export declare namespace ContractCreateParams {
580
1479
  * applicable_product_tags are not provided, the credit applies to all products.
581
1480
  */
582
1481
  applicable_product_tags?: Array<string>;
583
- custom_fields?: Record<string, string>;
1482
+ custom_fields?: {
1483
+ [key: string]: string;
1484
+ };
584
1485
  /**
585
1486
  * Used only in UI/API. It is not exposed to end customers.
586
1487
  */
587
1488
  description?: string;
1489
+ /**
1490
+ * Optional configuration for credit hierarchy access control
1491
+ */
1492
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
588
1493
  /**
589
1494
  * displayed on invoices
590
1495
  */
@@ -599,6 +1504,13 @@ export declare namespace ContractCreateParams {
599
1504
  */
600
1505
  priority?: number;
601
1506
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1507
+ /**
1508
+ * List of filters that determine what kind of customer usage draws down a commit
1509
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1510
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1511
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1512
+ */
1513
+ specifiers?: Array<Credit.Specifier>;
602
1514
  }
603
1515
  namespace Credit {
604
1516
  /**
@@ -624,6 +1536,41 @@ export declare namespace ContractCreateParams {
624
1536
  starting_at: string;
625
1537
  }
626
1538
  }
1539
+ /**
1540
+ * Optional configuration for credit hierarchy access control
1541
+ */
1542
+ interface HierarchyConfiguration {
1543
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1544
+ }
1545
+ namespace HierarchyConfiguration {
1546
+ interface CommitHierarchyChildAccessAll {
1547
+ type: 'ALL';
1548
+ }
1549
+ interface CommitHierarchyChildAccessNone {
1550
+ type: 'NONE';
1551
+ }
1552
+ interface CommitHierarchyChildAccessContractIDs {
1553
+ contract_ids: Array<string>;
1554
+ type: 'CONTRACT_IDS';
1555
+ }
1556
+ }
1557
+ interface Specifier {
1558
+ presentation_group_values?: {
1559
+ [key: string]: string;
1560
+ };
1561
+ pricing_group_values?: {
1562
+ [key: string]: string;
1563
+ };
1564
+ /**
1565
+ * If provided, the specifier will only apply to the product with the specified ID.
1566
+ */
1567
+ product_id?: string;
1568
+ /**
1569
+ * If provided, the specifier will only apply to products with all the specified
1570
+ * tags.
1571
+ */
1572
+ product_tags?: Array<string>;
1573
+ }
627
1574
  }
628
1575
  interface Discount {
629
1576
  product_id: string;
@@ -631,7 +1578,9 @@ export declare namespace ContractCreateParams {
631
1578
  * Must provide either schedule_items or recurring_schedule.
632
1579
  */
633
1580
  schedule: Discount.Schedule;
634
- custom_fields?: Record<string, string>;
1581
+ custom_fields?: {
1582
+ [key: string]: string;
1583
+ };
635
1584
  /**
636
1585
  * displayed on invoices
637
1586
  */
@@ -723,6 +1672,15 @@ export declare namespace ContractCreateParams {
723
1672
  }
724
1673
  }
725
1674
  }
1675
+ interface HierarchyConfiguration {
1676
+ parent: HierarchyConfiguration.Parent;
1677
+ }
1678
+ namespace HierarchyConfiguration {
1679
+ interface Parent {
1680
+ contract_id: string;
1681
+ customer_id: string;
1682
+ }
1683
+ }
726
1684
  interface Override {
727
1685
  /**
728
1686
  * RFC 3339 timestamp indicating when the override will start applying (inclusive)
@@ -787,6 +1745,7 @@ export declare namespace ContractCreateParams {
787
1745
  }
788
1746
  namespace Override {
789
1747
  interface OverrideSpecifier {
1748
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
790
1749
  /**
791
1750
  * Can only be used for commit specific overrides. Must be used in conjunction with
792
1751
  * one of product_id, product_tags, pricing_group_values, or
@@ -798,12 +1757,16 @@ export declare namespace ContractCreateParams {
798
1757
  * A map of group names to values. The override will only apply to line items with
799
1758
  * the specified presentation group values.
800
1759
  */
801
- presentation_group_values?: Record<string, string>;
1760
+ presentation_group_values?: {
1761
+ [key: string]: string;
1762
+ };
802
1763
  /**
803
1764
  * A map of pricing group names to values. The override will only apply to products
804
1765
  * with the specified pricing group values.
805
1766
  */
806
- pricing_group_values?: Record<string, string>;
1767
+ pricing_group_values?: {
1768
+ [key: string]: string;
1769
+ };
807
1770
  /**
808
1771
  * If provided, the override will only apply to the product with the specified ID.
809
1772
  */
@@ -838,7 +1801,9 @@ export declare namespace ContractCreateParams {
838
1801
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
839
1802
  * processors.
840
1803
  */
841
- custom_rate?: Record<string, unknown>;
1804
+ custom_rate?: {
1805
+ [key: string]: unknown;
1806
+ };
842
1807
  /**
843
1808
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
844
1809
  * set to true.
@@ -863,6 +1828,139 @@ export declare namespace ContractCreateParams {
863
1828
  size?: number;
864
1829
  }
865
1830
  }
1831
+ interface PrepaidBalanceThresholdConfiguration {
1832
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1833
+ /**
1834
+ * When set to false, the contract will not be evaluated against the
1835
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1836
+ * regardless of prior state.
1837
+ */
1838
+ is_enabled: boolean;
1839
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
1840
+ /**
1841
+ * Specify the amount the balance should be recharged to.
1842
+ */
1843
+ recharge_to_amount: number;
1844
+ /**
1845
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
1846
+ * balance lowers to this amount, a threshold charge will be initiated.
1847
+ */
1848
+ threshold_amount: number;
1849
+ /**
1850
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1851
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1852
+ */
1853
+ custom_credit_type_id?: string;
1854
+ }
1855
+ namespace PrepaidBalanceThresholdConfiguration {
1856
+ interface Commit {
1857
+ /**
1858
+ * The commit product that will be used to generate the line item for commit
1859
+ * payment.
1860
+ */
1861
+ product_id: string;
1862
+ /**
1863
+ * Which products the threshold commit applies to. If applicable_product_ids,
1864
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1865
+ * all products.
1866
+ */
1867
+ applicable_product_ids?: Array<string>;
1868
+ /**
1869
+ * Which tags the threshold commit applies to. If applicable_product_ids,
1870
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1871
+ * all products.
1872
+ */
1873
+ applicable_product_tags?: Array<string>;
1874
+ description?: string;
1875
+ /**
1876
+ * Specify the name of the line item for the threshold charge. If left blank, it
1877
+ * will default to the commit product name.
1878
+ */
1879
+ name?: string;
1880
+ /**
1881
+ * List of filters that determine what kind of customer usage draws down a commit
1882
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1883
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1884
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1885
+ */
1886
+ specifiers?: Array<Commit.Specifier>;
1887
+ }
1888
+ namespace Commit {
1889
+ interface Specifier {
1890
+ presentation_group_values?: {
1891
+ [key: string]: string;
1892
+ };
1893
+ pricing_group_values?: {
1894
+ [key: string]: string;
1895
+ };
1896
+ /**
1897
+ * If provided, the specifier will only apply to the product with the specified ID.
1898
+ */
1899
+ product_id?: string;
1900
+ /**
1901
+ * If provided, the specifier will only apply to products with all the specified
1902
+ * tags.
1903
+ */
1904
+ product_tags?: Array<string>;
1905
+ }
1906
+ }
1907
+ interface PaymentGateConfig {
1908
+ /**
1909
+ * Gate access to the commit balance based on successful collection of payment.
1910
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1911
+ * facilitate payment using your own payment integration. Select NONE if you do not
1912
+ * wish to payment gate the commit balance.
1913
+ */
1914
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1915
+ /**
1916
+ * Only applicable if using PRECALCULATED as your tax type.
1917
+ */
1918
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1919
+ /**
1920
+ * Only applicable if using STRIPE as your payment gate type.
1921
+ */
1922
+ stripe_config?: PaymentGateConfig.StripeConfig;
1923
+ /**
1924
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1925
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1926
+ * will default to NONE.
1927
+ */
1928
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1929
+ }
1930
+ namespace PaymentGateConfig {
1931
+ /**
1932
+ * Only applicable if using PRECALCULATED as your tax type.
1933
+ */
1934
+ interface PrecalculatedTaxConfig {
1935
+ /**
1936
+ * Amount of tax to be applied. This should be in the same currency and
1937
+ * denomination as the commit's invoice schedule
1938
+ */
1939
+ tax_amount: number;
1940
+ /**
1941
+ * Name of the tax to be applied. This may be used in an invoice line item
1942
+ * description.
1943
+ */
1944
+ tax_name?: string;
1945
+ }
1946
+ /**
1947
+ * Only applicable if using STRIPE as your payment gate type.
1948
+ */
1949
+ interface StripeConfig {
1950
+ /**
1951
+ * If left blank, will default to INVOICE
1952
+ */
1953
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1954
+ /**
1955
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1956
+ * your payment type.
1957
+ */
1958
+ invoice_metadata?: {
1959
+ [key: string]: string;
1960
+ };
1961
+ }
1962
+ }
1963
+ }
866
1964
  interface ProfessionalService {
867
1965
  /**
868
1966
  * Maximum amount for the term.
@@ -879,7 +1977,9 @@ export declare namespace ContractCreateParams {
879
1977
  * amount and must be specified.
880
1978
  */
881
1979
  unit_price: number;
882
- custom_fields?: Record<string, string>;
1980
+ custom_fields?: {
1981
+ [key: string]: string;
1982
+ };
883
1983
  description?: string;
884
1984
  /**
885
1985
  * This field's availability is dependent on your client's configuration.
@@ -892,7 +1992,9 @@ export declare namespace ContractCreateParams {
892
1992
  */
893
1993
  access_amount: RecurringCommit.AccessAmount;
894
1994
  /**
895
- * The amount of time the created commits will be valid for.
1995
+ * Defines the length of the access schedule for each created commit/credit. The
1996
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1997
+ * length of a period is determined by the recurrence_frequency.
896
1998
  */
897
1999
  commit_duration: RecurringCommit.CommitDuration;
898
2000
  /**
@@ -920,6 +2022,10 @@ export declare namespace ContractCreateParams {
920
2022
  * Determines when the contract will stop creating recurring commits. optional
921
2023
  */
922
2024
  ending_before?: string;
2025
+ /**
2026
+ * Optional configuration for recurring commit/credit hierarchy access control
2027
+ */
2028
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
923
2029
  /**
924
2030
  * The amount the customer should be billed for the commit. Not required.
925
2031
  */
@@ -932,16 +2038,36 @@ export declare namespace ContractCreateParams {
932
2038
  * Will be passed down to the individual commits
933
2039
  */
934
2040
  netsuite_sales_order_id?: string;
2041
+ /**
2042
+ * Determines whether the first and last commit will be prorated. If not provided,
2043
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2044
+ */
2045
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
935
2046
  /**
936
2047
  * Whether the created commits will use the commit rate or list rate
937
2048
  */
938
2049
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2050
+ /**
2051
+ * The frequency at which the recurring commits will be created. If not provided: -
2052
+ * The commits will be created on the usage invoice frequency. If provided: - The
2053
+ * period defined in the duration will correspond to this frequency. - Commits will
2054
+ * be created aligned with the recurring commit's starting_at rather than the usage
2055
+ * invoice dates.
2056
+ */
2057
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
939
2058
  /**
940
2059
  * Will be passed down to the individual commits. This controls how much of an
941
2060
  * individual unexpired commit will roll over upon contract transition. Must be
942
2061
  * between 0 and 1.
943
2062
  */
944
2063
  rollover_fraction?: number;
2064
+ /**
2065
+ * List of filters that determine what kind of customer usage draws down a commit
2066
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2067
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2068
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2069
+ */
2070
+ specifiers?: Array<RecurringCommit.Specifier>;
945
2071
  /**
946
2072
  * A temporary ID that can be used to reference the recurring commit for commit
947
2073
  * specific overrides.
@@ -954,15 +2080,39 @@ export declare namespace ContractCreateParams {
954
2080
  */
955
2081
  interface AccessAmount {
956
2082
  credit_type_id: string;
957
- quantity: number;
958
2083
  unit_price: number;
2084
+ /**
2085
+ * This field is currently required. Upcoming recurring commit/credit configuration
2086
+ * options will allow it to be optional.
2087
+ */
2088
+ quantity?: number;
959
2089
  }
960
2090
  /**
961
- * The amount of time the created commits will be valid for.
2091
+ * Defines the length of the access schedule for each created commit/credit. The
2092
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2093
+ * length of a period is determined by the recurrence_frequency.
962
2094
  */
963
2095
  interface CommitDuration {
964
- unit: 'PERIODS';
965
2096
  value: number;
2097
+ unit?: 'PERIODS';
2098
+ }
2099
+ /**
2100
+ * Optional configuration for recurring commit/credit hierarchy access control
2101
+ */
2102
+ interface HierarchyConfiguration {
2103
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2104
+ }
2105
+ namespace HierarchyConfiguration {
2106
+ interface CommitHierarchyChildAccessAll {
2107
+ type: 'ALL';
2108
+ }
2109
+ interface CommitHierarchyChildAccessNone {
2110
+ type: 'NONE';
2111
+ }
2112
+ interface CommitHierarchyChildAccessContractIDs {
2113
+ contract_ids: Array<string>;
2114
+ type: 'CONTRACT_IDS';
2115
+ }
966
2116
  }
967
2117
  /**
968
2118
  * The amount the customer should be billed for the commit. Not required.
@@ -972,6 +2122,23 @@ export declare namespace ContractCreateParams {
972
2122
  quantity: number;
973
2123
  unit_price: number;
974
2124
  }
2125
+ interface Specifier {
2126
+ presentation_group_values?: {
2127
+ [key: string]: string;
2128
+ };
2129
+ pricing_group_values?: {
2130
+ [key: string]: string;
2131
+ };
2132
+ /**
2133
+ * If provided, the specifier will only apply to the product with the specified ID.
2134
+ */
2135
+ product_id?: string;
2136
+ /**
2137
+ * If provided, the specifier will only apply to products with all the specified
2138
+ * tags.
2139
+ */
2140
+ product_tags?: Array<string>;
2141
+ }
975
2142
  }
976
2143
  interface RecurringCredit {
977
2144
  /**
@@ -979,7 +2146,9 @@ export declare namespace ContractCreateParams {
979
2146
  */
980
2147
  access_amount: RecurringCredit.AccessAmount;
981
2148
  /**
982
- * The amount of time the created commits will be valid for.
2149
+ * Defines the length of the access schedule for each created commit/credit. The
2150
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2151
+ * length of a period is determined by the recurrence_frequency.
983
2152
  */
984
2153
  commit_duration: RecurringCredit.CommitDuration;
985
2154
  /**
@@ -1008,9 +2177,9 @@ export declare namespace ContractCreateParams {
1008
2177
  */
1009
2178
  ending_before?: string;
1010
2179
  /**
1011
- * The amount the customer should be billed for the commit. Not required.
2180
+ * Optional configuration for recurring commit/credit hierarchy access control
1012
2181
  */
1013
- invoice_amount?: RecurringCredit.InvoiceAmount;
2182
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1014
2183
  /**
1015
2184
  * displayed on invoices. will be passed through to the individual commits
1016
2185
  */
@@ -1019,16 +2188,36 @@ export declare namespace ContractCreateParams {
1019
2188
  * Will be passed down to the individual commits
1020
2189
  */
1021
2190
  netsuite_sales_order_id?: string;
2191
+ /**
2192
+ * Determines whether the first and last commit will be prorated. If not provided,
2193
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2194
+ */
2195
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1022
2196
  /**
1023
2197
  * Whether the created commits will use the commit rate or list rate
1024
2198
  */
1025
2199
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2200
+ /**
2201
+ * The frequency at which the recurring commits will be created. If not provided: -
2202
+ * The commits will be created on the usage invoice frequency. If provided: - The
2203
+ * period defined in the duration will correspond to this frequency. - Commits will
2204
+ * be created aligned with the recurring commit's starting_at rather than the usage
2205
+ * invoice dates.
2206
+ */
2207
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1026
2208
  /**
1027
2209
  * Will be passed down to the individual commits. This controls how much of an
1028
2210
  * individual unexpired commit will roll over upon contract transition. Must be
1029
2211
  * between 0 and 1.
1030
2212
  */
1031
2213
  rollover_fraction?: number;
2214
+ /**
2215
+ * List of filters that determine what kind of customer usage draws down a commit
2216
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2217
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2218
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2219
+ */
2220
+ specifiers?: Array<RecurringCredit.Specifier>;
1032
2221
  /**
1033
2222
  * A temporary ID that can be used to reference the recurring commit for commit
1034
2223
  * specific overrides.
@@ -1041,23 +2230,56 @@ export declare namespace ContractCreateParams {
1041
2230
  */
1042
2231
  interface AccessAmount {
1043
2232
  credit_type_id: string;
1044
- quantity: number;
1045
2233
  unit_price: number;
2234
+ /**
2235
+ * This field is currently required. Upcoming recurring commit/credit configuration
2236
+ * options will allow it to be optional.
2237
+ */
2238
+ quantity?: number;
1046
2239
  }
1047
2240
  /**
1048
- * The amount of time the created commits will be valid for.
2241
+ * Defines the length of the access schedule for each created commit/credit. The
2242
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2243
+ * length of a period is determined by the recurrence_frequency.
1049
2244
  */
1050
2245
  interface CommitDuration {
1051
- unit: 'PERIODS';
1052
2246
  value: number;
2247
+ unit?: 'PERIODS';
1053
2248
  }
1054
2249
  /**
1055
- * The amount the customer should be billed for the commit. Not required.
2250
+ * Optional configuration for recurring commit/credit hierarchy access control
1056
2251
  */
1057
- interface InvoiceAmount {
1058
- credit_type_id: string;
1059
- quantity: number;
1060
- unit_price: number;
2252
+ interface HierarchyConfiguration {
2253
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2254
+ }
2255
+ namespace HierarchyConfiguration {
2256
+ interface CommitHierarchyChildAccessAll {
2257
+ type: 'ALL';
2258
+ }
2259
+ interface CommitHierarchyChildAccessNone {
2260
+ type: 'NONE';
2261
+ }
2262
+ interface CommitHierarchyChildAccessContractIDs {
2263
+ contract_ids: Array<string>;
2264
+ type: 'CONTRACT_IDS';
2265
+ }
2266
+ }
2267
+ interface Specifier {
2268
+ presentation_group_values?: {
2269
+ [key: string]: string;
2270
+ };
2271
+ pricing_group_values?: {
2272
+ [key: string]: string;
2273
+ };
2274
+ /**
2275
+ * If provided, the specifier will only apply to the product with the specified ID.
2276
+ */
2277
+ product_id?: string;
2278
+ /**
2279
+ * If provided, the specifier will only apply to products with all the specified
2280
+ * tags.
2281
+ */
2282
+ product_tags?: Array<string>;
1061
2283
  }
1062
2284
  }
1063
2285
  interface ResellerRoyalty {
@@ -1186,6 +2408,142 @@ export declare namespace ContractCreateParams {
1186
2408
  }
1187
2409
  }
1188
2410
  }
2411
+ interface SpendThresholdConfiguration {
2412
+ commit: SpendThresholdConfiguration.Commit;
2413
+ /**
2414
+ * When set to false, the contract will not be evaluated against the
2415
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2416
+ * regardless of prior state.
2417
+ */
2418
+ is_enabled: boolean;
2419
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
2420
+ /**
2421
+ * Specify the threshold amount for the contract. Each time the contract's usage
2422
+ * hits this amount, a threshold charge will be initiated.
2423
+ */
2424
+ threshold_amount: number;
2425
+ }
2426
+ namespace SpendThresholdConfiguration {
2427
+ interface Commit {
2428
+ /**
2429
+ * The commit product that will be used to generate the line item for commit
2430
+ * payment.
2431
+ */
2432
+ product_id: string;
2433
+ description?: string;
2434
+ /**
2435
+ * Specify the name of the line item for the threshold charge. If left blank, it
2436
+ * will default to the commit product name.
2437
+ */
2438
+ name?: string;
2439
+ }
2440
+ interface PaymentGateConfig {
2441
+ /**
2442
+ * Gate access to the commit balance based on successful collection of payment.
2443
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2444
+ * facilitate payment using your own payment integration. Select NONE if you do not
2445
+ * wish to payment gate the commit balance.
2446
+ */
2447
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2448
+ /**
2449
+ * Only applicable if using PRECALCULATED as your tax type.
2450
+ */
2451
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2452
+ /**
2453
+ * Only applicable if using STRIPE as your payment gate type.
2454
+ */
2455
+ stripe_config?: PaymentGateConfig.StripeConfig;
2456
+ /**
2457
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2458
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2459
+ * will default to NONE.
2460
+ */
2461
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2462
+ }
2463
+ namespace PaymentGateConfig {
2464
+ /**
2465
+ * Only applicable if using PRECALCULATED as your tax type.
2466
+ */
2467
+ interface PrecalculatedTaxConfig {
2468
+ /**
2469
+ * Amount of tax to be applied. This should be in the same currency and
2470
+ * denomination as the commit's invoice schedule
2471
+ */
2472
+ tax_amount: number;
2473
+ /**
2474
+ * Name of the tax to be applied. This may be used in an invoice line item
2475
+ * description.
2476
+ */
2477
+ tax_name?: string;
2478
+ }
2479
+ /**
2480
+ * Only applicable if using STRIPE as your payment gate type.
2481
+ */
2482
+ interface StripeConfig {
2483
+ /**
2484
+ * If left blank, will default to INVOICE
2485
+ */
2486
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2487
+ /**
2488
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2489
+ * your payment type.
2490
+ */
2491
+ invoice_metadata?: {
2492
+ [key: string]: string;
2493
+ };
2494
+ }
2495
+ }
2496
+ }
2497
+ interface Subscription {
2498
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2499
+ /**
2500
+ * The initial quantity for the subscription. It must be non-negative value.
2501
+ */
2502
+ initial_quantity: number;
2503
+ proration: Subscription.Proration;
2504
+ subscription_rate: Subscription.SubscriptionRate;
2505
+ custom_fields?: {
2506
+ [key: string]: string;
2507
+ };
2508
+ description?: string;
2509
+ /**
2510
+ * Exclusive end time for the subscription. If not provided, subscription inherits
2511
+ * contract end date.
2512
+ */
2513
+ ending_before?: string;
2514
+ name?: string;
2515
+ /**
2516
+ * Inclusive start time for the subscription. If not provided, defaults to contract
2517
+ * start date
2518
+ */
2519
+ starting_at?: string;
2520
+ }
2521
+ namespace Subscription {
2522
+ interface Proration {
2523
+ /**
2524
+ * Indicates how mid-period quantity adjustments are invoiced. If BILL_IMMEDIATELY
2525
+ * is selected, the quantity increase will be billed on the scheduled date. If
2526
+ * BILL_ON_NEXT_COLLECTION_DATE is selected, the quantity increase will be billed
2527
+ * for in-arrears at the end of the period.
2528
+ */
2529
+ invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2530
+ /**
2531
+ * Indicates if the partial period will be prorated or charged a full amount.
2532
+ */
2533
+ is_prorated?: boolean;
2534
+ }
2535
+ interface SubscriptionRate {
2536
+ /**
2537
+ * Frequency to bill subscription with. Together with product_id, must match
2538
+ * existing rate on the rate card.
2539
+ */
2540
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2541
+ /**
2542
+ * Must be subscription type product
2543
+ */
2544
+ product_id: string;
2545
+ }
2546
+ }
1189
2547
  interface Transition {
1190
2548
  from_contract_id: string;
1191
2549
  /**
@@ -1204,7 +2562,7 @@ export declare namespace ContractCreateParams {
1204
2562
  }
1205
2563
  }
1206
2564
  interface UsageStatementSchedule {
1207
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
2565
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1208
2566
  /**
1209
2567
  * Required when using CUSTOM_DATE. This option lets you set a historical billing
1210
2568
  * anchor date, aligning future billing cycles with a chosen cadence. For example,
@@ -1315,7 +2673,9 @@ export interface ContractAmendParams {
1315
2673
  starting_at: string;
1316
2674
  commits?: Array<ContractAmendParams.Commit>;
1317
2675
  credits?: Array<ContractAmendParams.Credit>;
1318
- custom_fields?: Record<string, string>;
2676
+ custom_fields?: {
2677
+ [key: string]: string;
2678
+ };
1319
2679
  /**
1320
2680
  * This field's availability is dependent on your client's configuration.
1321
2681
  */
@@ -1358,20 +2718,28 @@ export declare namespace ContractAmendParams {
1358
2718
  */
1359
2719
  amount?: number;
1360
2720
  /**
1361
- * Which products the commit applies to. If both applicable_product_ids and
1362
- * applicable_product_tags are not provided, the commit applies to all products.
2721
+ * Which products the commit applies to. If applicable_product_ids,
2722
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2723
+ * all products.
1363
2724
  */
1364
2725
  applicable_product_ids?: Array<string>;
1365
2726
  /**
1366
- * Which tags the commit applies to. If both applicable_product_ids and
1367
- * applicable_product_tags are not provided, the commit applies to all products.
2727
+ * Which tags the commit applies to. If applicable_product_ids,
2728
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2729
+ * all products.
1368
2730
  */
1369
2731
  applicable_product_tags?: Array<string>;
1370
- custom_fields?: Record<string, string>;
2732
+ custom_fields?: {
2733
+ [key: string]: string;
2734
+ };
1371
2735
  /**
1372
2736
  * Used only in UI/API. It is not exposed to end customers.
1373
2737
  */
1374
2738
  description?: string;
2739
+ /**
2740
+ * Optional configuration for commit hierarchy access control
2741
+ */
2742
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
1375
2743
  /**
1376
2744
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
1377
2745
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -1387,6 +2755,10 @@ export declare namespace ContractAmendParams {
1387
2755
  * This field's availability is dependent on your client's configuration.
1388
2756
  */
1389
2757
  netsuite_sales_order_id?: string;
2758
+ /**
2759
+ * optionally payment gate this commit
2760
+ */
2761
+ payment_gate_config?: Commit.PaymentGateConfig;
1390
2762
  /**
1391
2763
  * If multiple commits are applicable, the one with the lower priority will apply
1392
2764
  * first.
@@ -1397,6 +2769,13 @@ export declare namespace ContractAmendParams {
1397
2769
  * Fraction of unused segments that will be rolled over. Must be between 0 and 1.
1398
2770
  */
1399
2771
  rollover_fraction?: number;
2772
+ /**
2773
+ * List of filters that determine what kind of customer usage draws down a commit
2774
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2775
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2776
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2777
+ */
2778
+ specifiers?: Array<Commit.Specifier>;
1400
2779
  /**
1401
2780
  * A temporary ID for the commit that can be used to reference the commit for
1402
2781
  * commit specific overrides.
@@ -1429,6 +2808,24 @@ export declare namespace ContractAmendParams {
1429
2808
  starting_at: string;
1430
2809
  }
1431
2810
  }
2811
+ /**
2812
+ * Optional configuration for commit hierarchy access control
2813
+ */
2814
+ interface HierarchyConfiguration {
2815
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2816
+ }
2817
+ namespace HierarchyConfiguration {
2818
+ interface CommitHierarchyChildAccessAll {
2819
+ type: 'ALL';
2820
+ }
2821
+ interface CommitHierarchyChildAccessNone {
2822
+ type: 'NONE';
2823
+ }
2824
+ interface CommitHierarchyChildAccessContractIDs {
2825
+ contract_ids: Array<string>;
2826
+ type: 'CONTRACT_IDS';
2827
+ }
2828
+ }
1432
2829
  /**
1433
2830
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
1434
2831
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -1512,6 +2909,82 @@ export declare namespace ContractAmendParams {
1512
2909
  unit_price?: number;
1513
2910
  }
1514
2911
  }
2912
+ /**
2913
+ * optionally payment gate this commit
2914
+ */
2915
+ interface PaymentGateConfig {
2916
+ /**
2917
+ * Gate access to the commit balance based on successful collection of payment.
2918
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2919
+ * facilitate payment using your own payment integration. Select NONE if you do not
2920
+ * wish to payment gate the commit balance.
2921
+ */
2922
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2923
+ /**
2924
+ * Only applicable if using PRECALCULATED as your tax type.
2925
+ */
2926
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2927
+ /**
2928
+ * Only applicable if using STRIPE as your payment gate type.
2929
+ */
2930
+ stripe_config?: PaymentGateConfig.StripeConfig;
2931
+ /**
2932
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2933
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2934
+ * will default to NONE.
2935
+ */
2936
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2937
+ }
2938
+ namespace PaymentGateConfig {
2939
+ /**
2940
+ * Only applicable if using PRECALCULATED as your tax type.
2941
+ */
2942
+ interface PrecalculatedTaxConfig {
2943
+ /**
2944
+ * Amount of tax to be applied. This should be in the same currency and
2945
+ * denomination as the commit's invoice schedule
2946
+ */
2947
+ tax_amount: number;
2948
+ /**
2949
+ * Name of the tax to be applied. This may be used in an invoice line item
2950
+ * description.
2951
+ */
2952
+ tax_name?: string;
2953
+ }
2954
+ /**
2955
+ * Only applicable if using STRIPE as your payment gate type.
2956
+ */
2957
+ interface StripeConfig {
2958
+ /**
2959
+ * If left blank, will default to INVOICE
2960
+ */
2961
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2962
+ /**
2963
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2964
+ * your payment type.
2965
+ */
2966
+ invoice_metadata?: {
2967
+ [key: string]: string;
2968
+ };
2969
+ }
2970
+ }
2971
+ interface Specifier {
2972
+ presentation_group_values?: {
2973
+ [key: string]: string;
2974
+ };
2975
+ pricing_group_values?: {
2976
+ [key: string]: string;
2977
+ };
2978
+ /**
2979
+ * If provided, the specifier will only apply to the product with the specified ID.
2980
+ */
2981
+ product_id?: string;
2982
+ /**
2983
+ * If provided, the specifier will only apply to products with all the specified
2984
+ * tags.
2985
+ */
2986
+ product_tags?: Array<string>;
2987
+ }
1515
2988
  }
1516
2989
  interface Credit {
1517
2990
  /**
@@ -1529,11 +3002,17 @@ export declare namespace ContractAmendParams {
1529
3002
  * applicable_product_tags are not provided, the credit applies to all products.
1530
3003
  */
1531
3004
  applicable_product_tags?: Array<string>;
1532
- custom_fields?: Record<string, string>;
3005
+ custom_fields?: {
3006
+ [key: string]: string;
3007
+ };
1533
3008
  /**
1534
3009
  * Used only in UI/API. It is not exposed to end customers.
1535
3010
  */
1536
3011
  description?: string;
3012
+ /**
3013
+ * Optional configuration for credit hierarchy access control
3014
+ */
3015
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
1537
3016
  /**
1538
3017
  * displayed on invoices
1539
3018
  */
@@ -1548,6 +3027,13 @@ export declare namespace ContractAmendParams {
1548
3027
  */
1549
3028
  priority?: number;
1550
3029
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
3030
+ /**
3031
+ * List of filters that determine what kind of customer usage draws down a commit
3032
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3033
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3034
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3035
+ */
3036
+ specifiers?: Array<Credit.Specifier>;
1551
3037
  }
1552
3038
  namespace Credit {
1553
3039
  /**
@@ -1573,6 +3059,41 @@ export declare namespace ContractAmendParams {
1573
3059
  starting_at: string;
1574
3060
  }
1575
3061
  }
3062
+ /**
3063
+ * Optional configuration for credit hierarchy access control
3064
+ */
3065
+ interface HierarchyConfiguration {
3066
+ child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3067
+ }
3068
+ namespace HierarchyConfiguration {
3069
+ interface CommitHierarchyChildAccessAll {
3070
+ type: 'ALL';
3071
+ }
3072
+ interface CommitHierarchyChildAccessNone {
3073
+ type: 'NONE';
3074
+ }
3075
+ interface CommitHierarchyChildAccessContractIDs {
3076
+ contract_ids: Array<string>;
3077
+ type: 'CONTRACT_IDS';
3078
+ }
3079
+ }
3080
+ interface Specifier {
3081
+ presentation_group_values?: {
3082
+ [key: string]: string;
3083
+ };
3084
+ pricing_group_values?: {
3085
+ [key: string]: string;
3086
+ };
3087
+ /**
3088
+ * If provided, the specifier will only apply to the product with the specified ID.
3089
+ */
3090
+ product_id?: string;
3091
+ /**
3092
+ * If provided, the specifier will only apply to products with all the specified
3093
+ * tags.
3094
+ */
3095
+ product_tags?: Array<string>;
3096
+ }
1576
3097
  }
1577
3098
  interface Discount {
1578
3099
  product_id: string;
@@ -1580,7 +3101,9 @@ export declare namespace ContractAmendParams {
1580
3101
  * Must provide either schedule_items or recurring_schedule.
1581
3102
  */
1582
3103
  schedule: Discount.Schedule;
1583
- custom_fields?: Record<string, string>;
3104
+ custom_fields?: {
3105
+ [key: string]: string;
3106
+ };
1584
3107
  /**
1585
3108
  * displayed on invoices
1586
3109
  */
@@ -1736,6 +3259,7 @@ export declare namespace ContractAmendParams {
1736
3259
  }
1737
3260
  namespace Override {
1738
3261
  interface OverrideSpecifier {
3262
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1739
3263
  /**
1740
3264
  * Can only be used for commit specific overrides. Must be used in conjunction with
1741
3265
  * one of product_id, product_tags, pricing_group_values, or
@@ -1747,12 +3271,16 @@ export declare namespace ContractAmendParams {
1747
3271
  * A map of group names to values. The override will only apply to line items with
1748
3272
  * the specified presentation group values.
1749
3273
  */
1750
- presentation_group_values?: Record<string, string>;
3274
+ presentation_group_values?: {
3275
+ [key: string]: string;
3276
+ };
1751
3277
  /**
1752
3278
  * A map of pricing group names to values. The override will only apply to products
1753
3279
  * with the specified pricing group values.
1754
3280
  */
1755
- pricing_group_values?: Record<string, string>;
3281
+ pricing_group_values?: {
3282
+ [key: string]: string;
3283
+ };
1756
3284
  /**
1757
3285
  * If provided, the override will only apply to the product with the specified ID.
1758
3286
  */
@@ -1787,7 +3315,9 @@ export declare namespace ContractAmendParams {
1787
3315
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1788
3316
  * processors.
1789
3317
  */
1790
- custom_rate?: Record<string, unknown>;
3318
+ custom_rate?: {
3319
+ [key: string]: unknown;
3320
+ };
1791
3321
  /**
1792
3322
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1793
3323
  * set to true.
@@ -1828,7 +3358,9 @@ export declare namespace ContractAmendParams {
1828
3358
  * amount and must be specified.
1829
3359
  */
1830
3360
  unit_price: number;
1831
- custom_fields?: Record<string, string>;
3361
+ custom_fields?: {
3362
+ [key: string]: string;
3363
+ };
1832
3364
  description?: string;
1833
3365
  /**
1834
3366
  * This field's availability is dependent on your client's configuration.
@@ -1998,15 +3530,21 @@ export declare namespace ContractCreateHistoricalInvoicesParams {
1998
3530
  */
1999
3531
  billable_status?: 'billable' | 'unbillable';
2000
3532
  breakdown_granularity?: 'HOUR' | 'DAY';
2001
- custom_fields?: Record<string, string>;
3533
+ custom_fields?: {
3534
+ [key: string]: string;
3535
+ };
2002
3536
  }
2003
3537
  namespace Invoice {
2004
3538
  interface UsageLineItem {
2005
3539
  exclusive_end_date: string;
2006
3540
  inclusive_start_date: string;
2007
3541
  product_id: string;
2008
- presentation_group_values?: Record<string, string>;
2009
- pricing_group_values?: Record<string, string>;
3542
+ presentation_group_values?: {
3543
+ [key: string]: string;
3544
+ };
3545
+ pricing_group_values?: {
3546
+ [key: string]: string;
3547
+ };
2010
3548
  quantity?: number;
2011
3549
  subtotals_with_quantity?: Array<UsageLineItem.SubtotalsWithQuantity>;
2012
3550
  }
@@ -2031,7 +3569,7 @@ export interface ContractListBalancesParams {
2031
3569
  */
2032
3570
  effective_before?: string;
2033
3571
  /**
2034
- * Include credits from archived contracts.
3572
+ * Include archived credits and credits from archived contracts.
2035
3573
  */
2036
3574
  include_archived?: boolean;
2037
3575
  /**
@@ -2048,6 +3586,10 @@ export interface ContractListBalancesParams {
2048
3586
  * slower.
2049
3587
  */
2050
3588
  include_ledgers?: boolean;
3589
+ /**
3590
+ * The maximum number of commits to return. Defaults to 25.
3591
+ */
3592
+ limit?: number;
2051
3593
  /**
2052
3594
  * The next page token from a previous response.
2053
3595
  */
@@ -2088,16 +3630,25 @@ export interface ContractRetrieveRateScheduleParams {
2088
3630
  }
2089
3631
  export declare namespace ContractRetrieveRateScheduleParams {
2090
3632
  interface Selector {
3633
+ /**
3634
+ * Subscription rates matching the billing frequency will be included in the
3635
+ * response.
3636
+ */
3637
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2091
3638
  /**
2092
3639
  * List of pricing group key value pairs, rates containing the matching key / value
2093
3640
  * pairs will be included in the response.
2094
3641
  */
2095
- partial_pricing_group_values?: Record<string, string>;
3642
+ partial_pricing_group_values?: {
3643
+ [key: string]: string;
3644
+ };
2096
3645
  /**
2097
3646
  * List of pricing group key value pairs, rates matching all of the key / value
2098
3647
  * pairs will be included in the response.
2099
3648
  */
2100
- pricing_group_values?: Record<string, string>;
3649
+ pricing_group_values?: {
3650
+ [key: string]: string;
3651
+ };
2101
3652
  /**
2102
3653
  * Rates matching the product id will be included in the response.
2103
3654
  */
@@ -2109,6 +3660,11 @@ export declare namespace ContractRetrieveRateScheduleParams {
2109
3660
  product_tags?: Array<string>;
2110
3661
  }
2111
3662
  }
3663
+ export interface ContractRetrieveSubscriptionQuantityHistoryParams {
3664
+ contract_id: string;
3665
+ customer_id: string;
3666
+ subscription_id: string;
3667
+ }
2112
3668
  export interface ContractScheduleProServicesInvoiceParams {
2113
3669
  contract_id: string;
2114
3670
  customer_id: string;
@@ -2197,9 +3753,9 @@ export interface ContractUpdateEndDateParams {
2197
3753
  ending_before?: string;
2198
3754
  }
2199
3755
  export declare namespace Contracts {
2200
- export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractAmendResponse as ContractAmendResponse, type ContractArchiveResponse as ContractArchiveResponse, type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse, type ContractListBalancesResponse as ContractListBalancesResponse, type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse, type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse, type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractAddManualBalanceEntryParams as ContractAddManualBalanceEntryParams, type ContractAmendParams as ContractAmendParams, type ContractArchiveParams as ContractArchiveParams, type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams, type ContractListBalancesParams as ContractListBalancesParams, type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
3756
+ export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractAmendResponse as ContractAmendResponse, type ContractArchiveResponse as ContractArchiveResponse, type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse, type ContractListBalancesResponse as ContractListBalancesResponse, type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse, type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse, type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse, type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractAddManualBalanceEntryParams as ContractAddManualBalanceEntryParams, type ContractAmendParams as ContractAmendParams, type ContractArchiveParams as ContractArchiveParams, type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams, type ContractListBalancesParams as ContractListBalancesParams, type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
2201
3757
  export { Products as Products, type ProductListItemState as ProductListItemState, type QuantityConversion as QuantityConversion, type QuantityRounding as QuantityRounding, type ProductCreateResponse as ProductCreateResponse, type ProductRetrieveResponse as ProductRetrieveResponse, type ProductUpdateResponse as ProductUpdateResponse, type ProductListResponse as ProductListResponse, type ProductArchiveResponse as ProductArchiveResponse, ProductListResponsesCursorPage as ProductListResponsesCursorPage, type ProductCreateParams as ProductCreateParams, type ProductRetrieveParams as ProductRetrieveParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, type ProductArchiveParams as ProductArchiveParams, };
2202
- export { RateCards as RateCards, type RateCardCreateResponse as RateCardCreateResponse, type RateCardRetrieveResponse as RateCardRetrieveResponse, type RateCardUpdateResponse as RateCardUpdateResponse, type RateCardListResponse as RateCardListResponse, type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse, RateCardListResponsesCursorPage as RateCardListResponsesCursorPage, type RateCardCreateParams as RateCardCreateParams, type RateCardRetrieveParams as RateCardRetrieveParams, type RateCardUpdateParams as RateCardUpdateParams, type RateCardListParams as RateCardListParams, type RateCardRetrieveRateScheduleParams as RateCardRetrieveRateScheduleParams, };
3758
+ export { RateCards as RateCards, type RateCardCreateResponse as RateCardCreateResponse, type RateCardRetrieveResponse as RateCardRetrieveResponse, type RateCardUpdateResponse as RateCardUpdateResponse, type RateCardListResponse as RateCardListResponse, type RateCardArchiveResponse as RateCardArchiveResponse, type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse, RateCardListResponsesCursorPage as RateCardListResponsesCursorPage, type RateCardCreateParams as RateCardCreateParams, type RateCardRetrieveParams as RateCardRetrieveParams, type RateCardUpdateParams as RateCardUpdateParams, type RateCardListParams as RateCardListParams, type RateCardArchiveParams as RateCardArchiveParams, type RateCardRetrieveRateScheduleParams as RateCardRetrieveRateScheduleParams, };
2203
3759
  export { NamedSchedules as NamedSchedules, type NamedScheduleRetrieveResponse as NamedScheduleRetrieveResponse, type NamedScheduleRetrieveParams as NamedScheduleRetrieveParams, type NamedScheduleUpdateParams as NamedScheduleUpdateParams, };
2204
3760
  }
2205
3761
  //# sourceMappingURL=contracts.d.ts.map