@metronome/sdk 2.2.0 → 3.4.1

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 (353) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE +1 -1
  3. package/README.md +26 -4
  4. package/client.d.mts +5 -3
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +5 -3
  7. package/client.d.ts.map +1 -1
  8. package/client.js +26 -10
  9. package/client.js.map +1 -1
  10. package/client.mjs +26 -10
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/tslib.js +17 -17
  19. package/internal/utils/query.d.mts +2 -0
  20. package/internal/utils/query.d.mts.map +1 -0
  21. package/internal/utils/query.d.ts +2 -0
  22. package/internal/utils/query.d.ts.map +1 -0
  23. package/internal/utils/query.js +10 -0
  24. package/internal/utils/query.js.map +1 -0
  25. package/internal/utils/query.mjs +6 -0
  26. package/internal/utils/query.mjs.map +1 -0
  27. package/internal/utils.d.mts +1 -0
  28. package/internal/utils.d.ts +1 -0
  29. package/internal/utils.js +1 -0
  30. package/internal/utils.js.map +1 -1
  31. package/internal/utils.mjs +1 -0
  32. package/package.json +12 -1
  33. package/resources/shared.d.mts +111 -30
  34. package/resources/shared.d.mts.map +1 -1
  35. package/resources/shared.d.ts +111 -30
  36. package/resources/shared.d.ts.map +1 -1
  37. package/resources/v1/alerts.d.mts +3 -0
  38. package/resources/v1/alerts.d.mts.map +1 -1
  39. package/resources/v1/alerts.d.ts +3 -0
  40. package/resources/v1/alerts.d.ts.map +1 -1
  41. package/resources/v1/alerts.js +3 -0
  42. package/resources/v1/alerts.js.map +1 -1
  43. package/resources/v1/alerts.mjs +3 -0
  44. package/resources/v1/alerts.mjs.map +1 -1
  45. package/resources/v1/audit-logs.d.mts +3 -0
  46. package/resources/v1/audit-logs.d.mts.map +1 -1
  47. package/resources/v1/audit-logs.d.ts +3 -0
  48. package/resources/v1/audit-logs.d.ts.map +1 -1
  49. package/resources/v1/audit-logs.js +3 -0
  50. package/resources/v1/audit-logs.js.map +1 -1
  51. package/resources/v1/audit-logs.mjs +3 -0
  52. package/resources/v1/audit-logs.mjs.map +1 -1
  53. package/resources/v1/billable-metrics.d.mts +3 -0
  54. package/resources/v1/billable-metrics.d.mts.map +1 -1
  55. package/resources/v1/billable-metrics.d.ts +3 -0
  56. package/resources/v1/billable-metrics.d.ts.map +1 -1
  57. package/resources/v1/billable-metrics.js +3 -0
  58. package/resources/v1/billable-metrics.js.map +1 -1
  59. package/resources/v1/billable-metrics.mjs +3 -0
  60. package/resources/v1/billable-metrics.mjs.map +1 -1
  61. package/resources/v1/contracts/contracts.d.mts +134 -14
  62. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  63. package/resources/v1/contracts/contracts.d.ts +134 -14
  64. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  65. package/resources/v1/contracts/contracts.js +69 -0
  66. package/resources/v1/contracts/contracts.js.map +1 -1
  67. package/resources/v1/contracts/contracts.mjs +69 -0
  68. package/resources/v1/contracts/contracts.mjs.map +1 -1
  69. package/resources/v1/contracts/index.d.mts +1 -1
  70. package/resources/v1/contracts/index.d.mts.map +1 -1
  71. package/resources/v1/contracts/index.d.ts +1 -1
  72. package/resources/v1/contracts/index.d.ts.map +1 -1
  73. package/resources/v1/contracts/index.js.map +1 -1
  74. package/resources/v1/contracts/index.mjs.map +1 -1
  75. package/resources/v1/contracts/named-schedules.d.mts +3 -0
  76. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  77. package/resources/v1/contracts/named-schedules.d.ts +3 -0
  78. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  79. package/resources/v1/contracts/named-schedules.js +3 -0
  80. package/resources/v1/contracts/named-schedules.js.map +1 -1
  81. package/resources/v1/contracts/named-schedules.mjs +3 -0
  82. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  83. package/resources/v1/contracts/products.d.mts +3 -0
  84. package/resources/v1/contracts/products.d.mts.map +1 -1
  85. package/resources/v1/contracts/products.d.ts +3 -0
  86. package/resources/v1/contracts/products.d.ts.map +1 -1
  87. package/resources/v1/contracts/products.js +3 -0
  88. package/resources/v1/contracts/products.js.map +1 -1
  89. package/resources/v1/contracts/products.mjs +3 -0
  90. package/resources/v1/contracts/products.mjs.map +1 -1
  91. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +3 -0
  92. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  93. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +3 -0
  94. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  95. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -0
  96. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  97. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -0
  98. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  99. package/resources/v1/contracts/rate-cards/product-orders.d.mts +3 -0
  100. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  101. package/resources/v1/contracts/rate-cards/product-orders.d.ts +3 -0
  102. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  103. package/resources/v1/contracts/rate-cards/product-orders.js +3 -0
  104. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  105. package/resources/v1/contracts/rate-cards/product-orders.mjs +3 -0
  106. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  107. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +4 -1
  108. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  109. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +4 -1
  110. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  111. package/resources/v1/contracts/rate-cards/rate-cards.js +3 -0
  112. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  113. package/resources/v1/contracts/rate-cards/rate-cards.mjs +3 -0
  114. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  115. package/resources/v1/contracts/rate-cards/rates.d.mts +6 -21
  116. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  117. package/resources/v1/contracts/rate-cards/rates.d.ts +6 -21
  118. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  119. package/resources/v1/contracts/rate-cards/rates.js +3 -0
  120. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  121. package/resources/v1/contracts/rate-cards/rates.mjs +3 -0
  122. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  123. package/resources/v1/credit-grants.d.mts +3 -0
  124. package/resources/v1/credit-grants.d.mts.map +1 -1
  125. package/resources/v1/credit-grants.d.ts +3 -0
  126. package/resources/v1/credit-grants.d.ts.map +1 -1
  127. package/resources/v1/credit-grants.js +3 -0
  128. package/resources/v1/credit-grants.js.map +1 -1
  129. package/resources/v1/credit-grants.mjs +3 -0
  130. package/resources/v1/credit-grants.mjs.map +1 -1
  131. package/resources/v1/custom-fields.d.mts +9 -6
  132. package/resources/v1/custom-fields.d.mts.map +1 -1
  133. package/resources/v1/custom-fields.d.ts +9 -6
  134. package/resources/v1/custom-fields.d.ts.map +1 -1
  135. package/resources/v1/custom-fields.js +3 -0
  136. package/resources/v1/custom-fields.js.map +1 -1
  137. package/resources/v1/custom-fields.mjs +3 -0
  138. package/resources/v1/custom-fields.mjs.map +1 -1
  139. package/resources/v1/customers/alerts.d.mts +3 -0
  140. package/resources/v1/customers/alerts.d.mts.map +1 -1
  141. package/resources/v1/customers/alerts.d.ts +3 -0
  142. package/resources/v1/customers/alerts.d.ts.map +1 -1
  143. package/resources/v1/customers/alerts.js +3 -0
  144. package/resources/v1/customers/alerts.js.map +1 -1
  145. package/resources/v1/customers/alerts.mjs +3 -0
  146. package/resources/v1/customers/alerts.mjs.map +1 -1
  147. package/resources/v1/customers/billing-config.d.mts +8 -5
  148. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  149. package/resources/v1/customers/billing-config.d.ts +8 -5
  150. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  151. package/resources/v1/customers/billing-config.js +3 -0
  152. package/resources/v1/customers/billing-config.js.map +1 -1
  153. package/resources/v1/customers/billing-config.mjs +3 -0
  154. package/resources/v1/customers/billing-config.mjs.map +1 -1
  155. package/resources/v1/customers/commits.d.mts +3 -0
  156. package/resources/v1/customers/commits.d.mts.map +1 -1
  157. package/resources/v1/customers/commits.d.ts +3 -0
  158. package/resources/v1/customers/commits.d.ts.map +1 -1
  159. package/resources/v1/customers/commits.js +3 -0
  160. package/resources/v1/customers/commits.js.map +1 -1
  161. package/resources/v1/customers/commits.mjs +3 -0
  162. package/resources/v1/customers/commits.mjs.map +1 -1
  163. package/resources/v1/customers/credits.d.mts +3 -0
  164. package/resources/v1/customers/credits.d.mts.map +1 -1
  165. package/resources/v1/customers/credits.d.ts +3 -0
  166. package/resources/v1/customers/credits.d.ts.map +1 -1
  167. package/resources/v1/customers/credits.js +3 -0
  168. package/resources/v1/customers/credits.js.map +1 -1
  169. package/resources/v1/customers/credits.mjs +3 -0
  170. package/resources/v1/customers/credits.mjs.map +1 -1
  171. package/resources/v1/customers/customers.d.mts +84 -8
  172. package/resources/v1/customers/customers.d.mts.map +1 -1
  173. package/resources/v1/customers/customers.d.ts +84 -8
  174. package/resources/v1/customers/customers.d.ts.map +1 -1
  175. package/resources/v1/customers/customers.js +53 -0
  176. package/resources/v1/customers/customers.js.map +1 -1
  177. package/resources/v1/customers/customers.mjs +53 -0
  178. package/resources/v1/customers/customers.mjs.map +1 -1
  179. package/resources/v1/customers/index.d.mts +1 -1
  180. package/resources/v1/customers/index.d.mts.map +1 -1
  181. package/resources/v1/customers/index.d.ts +1 -1
  182. package/resources/v1/customers/index.d.ts.map +1 -1
  183. package/resources/v1/customers/index.js.map +1 -1
  184. package/resources/v1/customers/index.mjs.map +1 -1
  185. package/resources/v1/customers/invoices.d.mts +38 -19
  186. package/resources/v1/customers/invoices.d.mts.map +1 -1
  187. package/resources/v1/customers/invoices.d.ts +38 -19
  188. package/resources/v1/customers/invoices.d.ts.map +1 -1
  189. package/resources/v1/customers/invoices.js +3 -0
  190. package/resources/v1/customers/invoices.js.map +1 -1
  191. package/resources/v1/customers/invoices.mjs +3 -0
  192. package/resources/v1/customers/invoices.mjs.map +1 -1
  193. package/resources/v1/customers/named-schedules.d.mts +3 -0
  194. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  195. package/resources/v1/customers/named-schedules.d.ts +3 -0
  196. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  197. package/resources/v1/customers/named-schedules.js +3 -0
  198. package/resources/v1/customers/named-schedules.js.map +1 -1
  199. package/resources/v1/customers/named-schedules.mjs +3 -0
  200. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  201. package/resources/v1/customers/plans.d.mts +8 -5
  202. package/resources/v1/customers/plans.d.mts.map +1 -1
  203. package/resources/v1/customers/plans.d.ts +8 -5
  204. package/resources/v1/customers/plans.d.ts.map +1 -1
  205. package/resources/v1/customers/plans.js +3 -0
  206. package/resources/v1/customers/plans.js.map +1 -1
  207. package/resources/v1/customers/plans.mjs +3 -0
  208. package/resources/v1/customers/plans.mjs.map +1 -1
  209. package/resources/v1/dashboards.d.mts +3 -0
  210. package/resources/v1/dashboards.d.mts.map +1 -1
  211. package/resources/v1/dashboards.d.ts +3 -0
  212. package/resources/v1/dashboards.d.ts.map +1 -1
  213. package/resources/v1/dashboards.js +3 -0
  214. package/resources/v1/dashboards.js.map +1 -1
  215. package/resources/v1/dashboards.mjs +3 -0
  216. package/resources/v1/dashboards.mjs.map +1 -1
  217. package/resources/v1/index.d.mts +3 -2
  218. package/resources/v1/index.d.mts.map +1 -1
  219. package/resources/v1/index.d.ts +3 -2
  220. package/resources/v1/index.d.ts.map +1 -1
  221. package/resources/v1/index.js +3 -1
  222. package/resources/v1/index.js.map +1 -1
  223. package/resources/v1/index.mjs +1 -0
  224. package/resources/v1/index.mjs.map +1 -1
  225. package/resources/v1/invoices.d.mts +3 -0
  226. package/resources/v1/invoices.d.mts.map +1 -1
  227. package/resources/v1/invoices.d.ts +3 -0
  228. package/resources/v1/invoices.d.ts.map +1 -1
  229. package/resources/v1/invoices.js +3 -0
  230. package/resources/v1/invoices.js.map +1 -1
  231. package/resources/v1/invoices.mjs +3 -0
  232. package/resources/v1/invoices.mjs.map +1 -1
  233. package/resources/v1/packages.d.mts +2352 -0
  234. package/resources/v1/packages.d.mts.map +1 -0
  235. package/resources/v1/packages.d.ts +2352 -0
  236. package/resources/v1/packages.d.ts.map +1 -0
  237. package/resources/v1/packages.js +160 -0
  238. package/resources/v1/packages.js.map +1 -0
  239. package/resources/v1/packages.mjs +156 -0
  240. package/resources/v1/packages.mjs.map +1 -0
  241. package/resources/v1/payments.d.mts +10 -0
  242. package/resources/v1/payments.d.mts.map +1 -1
  243. package/resources/v1/payments.d.ts +10 -0
  244. package/resources/v1/payments.d.ts.map +1 -1
  245. package/resources/v1/plans.d.mts +5 -2
  246. package/resources/v1/plans.d.mts.map +1 -1
  247. package/resources/v1/plans.d.ts +5 -2
  248. package/resources/v1/plans.d.ts.map +1 -1
  249. package/resources/v1/plans.js +3 -0
  250. package/resources/v1/plans.js.map +1 -1
  251. package/resources/v1/plans.mjs +3 -0
  252. package/resources/v1/plans.mjs.map +1 -1
  253. package/resources/v1/pricing-units.d.mts +3 -0
  254. package/resources/v1/pricing-units.d.mts.map +1 -1
  255. package/resources/v1/pricing-units.d.ts +3 -0
  256. package/resources/v1/pricing-units.d.ts.map +1 -1
  257. package/resources/v1/pricing-units.js +3 -0
  258. package/resources/v1/pricing-units.js.map +1 -1
  259. package/resources/v1/pricing-units.mjs +3 -0
  260. package/resources/v1/pricing-units.mjs.map +1 -1
  261. package/resources/v1/services.d.mts +3 -0
  262. package/resources/v1/services.d.mts.map +1 -1
  263. package/resources/v1/services.d.ts +3 -0
  264. package/resources/v1/services.d.ts.map +1 -1
  265. package/resources/v1/services.js +3 -0
  266. package/resources/v1/services.js.map +1 -1
  267. package/resources/v1/services.mjs +3 -0
  268. package/resources/v1/services.mjs.map +1 -1
  269. package/resources/v1/settings/billing-providers.d.mts +3 -0
  270. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  271. package/resources/v1/settings/billing-providers.d.ts +3 -0
  272. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  273. package/resources/v1/settings/billing-providers.js +3 -0
  274. package/resources/v1/settings/billing-providers.js.map +1 -1
  275. package/resources/v1/settings/billing-providers.mjs +3 -0
  276. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  277. package/resources/v1/settings/settings.d.mts +3 -0
  278. package/resources/v1/settings/settings.d.mts.map +1 -1
  279. package/resources/v1/settings/settings.d.ts +3 -0
  280. package/resources/v1/settings/settings.d.ts.map +1 -1
  281. package/resources/v1/settings/settings.js +3 -0
  282. package/resources/v1/settings/settings.js.map +1 -1
  283. package/resources/v1/settings/settings.mjs +3 -0
  284. package/resources/v1/settings/settings.mjs.map +1 -1
  285. package/resources/v1/usage.d.mts +87 -18
  286. package/resources/v1/usage.d.mts.map +1 -1
  287. package/resources/v1/usage.d.ts +87 -18
  288. package/resources/v1/usage.d.ts.map +1 -1
  289. package/resources/v1/usage.js +37 -11
  290. package/resources/v1/usage.js.map +1 -1
  291. package/resources/v1/usage.mjs +37 -11
  292. package/resources/v1/usage.mjs.map +1 -1
  293. package/resources/v1/v1.d.mts +8 -4
  294. package/resources/v1/v1.d.mts.map +1 -1
  295. package/resources/v1/v1.d.ts +8 -4
  296. package/resources/v1/v1.d.ts.map +1 -1
  297. package/resources/v1/v1.js +4 -0
  298. package/resources/v1/v1.js.map +1 -1
  299. package/resources/v1/v1.mjs +4 -0
  300. package/resources/v1/v1.mjs.map +1 -1
  301. package/resources/v2/contracts.d.mts +45 -7
  302. package/resources/v2/contracts.d.mts.map +1 -1
  303. package/resources/v2/contracts.d.ts +45 -7
  304. package/resources/v2/contracts.d.ts.map +1 -1
  305. package/resources/v2/contracts.js +1 -4
  306. package/resources/v2/contracts.js.map +1 -1
  307. package/resources/v2/contracts.mjs +1 -4
  308. package/resources/v2/contracts.mjs.map +1 -1
  309. package/src/client.ts +37 -15
  310. package/src/internal/parse.ts +6 -0
  311. package/src/internal/utils/query.ts +7 -0
  312. package/src/internal/utils.ts +1 -0
  313. package/src/resources/shared.ts +127 -32
  314. package/src/resources/v1/alerts.ts +3 -0
  315. package/src/resources/v1/audit-logs.ts +3 -0
  316. package/src/resources/v1/billable-metrics.ts +3 -0
  317. package/src/resources/v1/contracts/contracts.ts +151 -13
  318. package/src/resources/v1/contracts/index.ts +2 -0
  319. package/src/resources/v1/contracts/named-schedules.ts +3 -0
  320. package/src/resources/v1/contracts/products.ts +3 -0
  321. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +3 -0
  322. package/src/resources/v1/contracts/rate-cards/product-orders.ts +3 -0
  323. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +4 -1
  324. package/src/resources/v1/contracts/rate-cards/rates.ts +6 -24
  325. package/src/resources/v1/credit-grants.ts +3 -0
  326. package/src/resources/v1/custom-fields.ts +32 -5
  327. package/src/resources/v1/customers/alerts.ts +3 -0
  328. package/src/resources/v1/customers/billing-config.ts +8 -5
  329. package/src/resources/v1/customers/commits.ts +3 -0
  330. package/src/resources/v1/customers/credits.ts +3 -0
  331. package/src/resources/v1/customers/customers.ts +96 -7
  332. package/src/resources/v1/customers/index.ts +2 -0
  333. package/src/resources/v1/customers/invoices.ts +45 -19
  334. package/src/resources/v1/customers/named-schedules.ts +3 -0
  335. package/src/resources/v1/customers/plans.ts +8 -5
  336. package/src/resources/v1/dashboards.ts +3 -0
  337. package/src/resources/v1/index.ts +19 -0
  338. package/src/resources/v1/invoices.ts +3 -0
  339. package/src/resources/v1/packages.ts +3057 -0
  340. package/src/resources/v1/payments.ts +15 -0
  341. package/src/resources/v1/plans.ts +5 -2
  342. package/src/resources/v1/pricing-units.ts +3 -0
  343. package/src/resources/v1/services.ts +3 -0
  344. package/src/resources/v1/settings/billing-providers.ts +3 -0
  345. package/src/resources/v1/settings/settings.ts +3 -0
  346. package/src/resources/v1/usage.ts +86 -18
  347. package/src/resources/v1/v1.ts +42 -0
  348. package/src/resources/v2/contracts.ts +55 -7
  349. package/src/version.ts +1 -1
  350. package/version.d.mts +1 -1
  351. package/version.d.ts +1 -1
  352. package/version.js +1 -1
  353. package/version.mjs +1 -1
@@ -95,6 +95,8 @@ export interface Payment {
95
95
 
96
96
  payment_gateway?: Payment.PaymentGateway;
97
97
 
98
+ revenue_system_payments?: Array<Payment.RevenueSystemPayment>;
99
+
98
100
  status?: PaymentStatus;
99
101
 
100
102
  updated_at?: string;
@@ -126,6 +128,19 @@ export namespace Payment {
126
128
  }
127
129
  }
128
130
  }
131
+
132
+ export interface RevenueSystemPayment {
133
+ revenue_system_provider: string;
134
+
135
+ sync_status: string;
136
+
137
+ /**
138
+ * The error message from the revenue system, if available.
139
+ */
140
+ error_message?: string;
141
+
142
+ revenue_system_external_payment_id?: string;
143
+ }
129
144
  }
130
145
 
131
146
  export type PaymentStatus = 'pending' | 'requires_intervention' | 'paid' | 'canceled';
@@ -8,6 +8,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagin
8
8
  import { RequestOptions } from '../../internal/request-options';
9
9
  import { path } from '../../internal/utils/path';
10
10
 
11
+ /**
12
+ * [Plans](https://docs.metronome.com/pricing-and-packaging/create-plans/) determine the base pricing for a customer. Use these endpoints to add a plan to a customer, end a customer plan, retrieve plans, and retrieve plan details. Create plans in the [Metronome app](https://app.metronome.com/plans).
13
+ */
11
14
  export class Plans extends APIResource {
12
15
  /**
13
16
  * List all available plans. This is a Plans (deprecated) endpoint. New clients
@@ -306,14 +309,14 @@ export interface PlanGetDetailsParams {
306
309
 
307
310
  export interface PlanListChargesParams extends CursorPageParams {
308
311
  /**
309
- * Path param:
312
+ * Path param
310
313
  */
311
314
  plan_id: string;
312
315
  }
313
316
 
314
317
  export interface PlanListCustomersParams extends CursorPageParams {
315
318
  /**
316
- * Path param:
319
+ * Path param
317
320
  */
318
321
  plan_id: string;
319
322
 
@@ -4,6 +4,9 @@ import { APIResource } from '../../core/resource';
4
4
  import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
5
5
  import { RequestOptions } from '../../internal/request-options';
6
6
 
7
+ /**
8
+ * Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
9
+ */
7
10
  export class PricingUnits extends APIResource {
8
11
  /**
9
12
  * List all pricing units. All fiat currency types (for example, USD or GBP) will
@@ -4,6 +4,9 @@ import { APIResource } from '../../core/resource';
4
4
  import { APIPromise } from '../../core/api-promise';
5
5
  import { RequestOptions } from '../../internal/request-options';
6
6
 
7
+ /**
8
+ * [Security](https://docs.metronome.com/developer-resources/security/) endpoints allow you to retrieve security-related data.
9
+ */
7
10
  export class Services extends APIResource {
8
11
  /**
9
12
  * Gets Metronome's service registry with associated IP addresses for security
@@ -4,6 +4,9 @@ import { APIResource } from '../../../core/resource';
4
4
  import { APIPromise } from '../../../core/api-promise';
5
5
  import { RequestOptions } from '../../../internal/request-options';
6
6
 
7
+ /**
8
+ * Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
9
+ */
7
10
  export class BillingProviders extends APIResource {
8
11
  /**
9
12
  * Set up account-level configuration for a billing provider. Once configured,
@@ -12,6 +12,9 @@ import {
12
12
  import { APIPromise } from '../../../core/api-promise';
13
13
  import { RequestOptions } from '../../../internal/request-options';
14
14
 
15
+ /**
16
+ * Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
17
+ */
15
18
  export class Settings extends APIResource {
16
19
  billingProviders: BillingProvidersAPI.BillingProviders = new BillingProvidersAPI.BillingProviders(
17
20
  this._client,
@@ -13,6 +13,9 @@ import {
13
13
  import { buildHeaders } from '../../internal/headers';
14
14
  import { RequestOptions } from '../../internal/request-options';
15
15
 
16
+ /**
17
+ * [Usage events](https://docs.metronome.com/connecting-metronome/send-usage-data/) are the basis for billable metrics. Use these endpoints to send usage events to Metronome and retrieve aggregated event data.
18
+ */
16
19
  export class Usage extends APIResource {
17
20
  /**
18
21
  * Retrieve aggregated usage data across multiple customers and billable metrics in
@@ -192,13 +195,37 @@ export class Usage extends APIResource {
192
195
  * - Build detailed usage dashboards with dimensional filtering
193
196
  * - Identify high-usage segments for optimization opportunities
194
197
  *
198
+ * ### Request parameters
199
+ *
200
+ * Use [`group_key`](#body-group-key) and [`group_filters`](#body-group-filters) to
201
+ * group by one or more dimensions. This is required for compound group keys and
202
+ * recommended for all new integrations:
203
+ *
204
+ * ```json
205
+ * {
206
+ * "group_key": ["region", "team"],
207
+ * "group_filters": {
208
+ * "region": ["US-East", "US-West"]
209
+ * }
210
+ * }
211
+ * ```
212
+ *
213
+ * Important: For compound group keys, you must pass the complete set of keys that
214
+ * make up the compound key. Partial key combinations are not supported. For
215
+ * example, if your billable metric has a compound group key [region, team,
216
+ * environment], you must pass all three keys in group_key—you cannot pass just
217
+ * `[region]` or `[region, team]`.
218
+ *
195
219
  * ### Key response fields:
196
220
  *
197
221
  * An array of `PagedUsageAggregate` objects containing:
198
222
  *
199
223
  * - `starting_on` and `ending_before`: Time window boundaries
200
- * - `group_key`: The dimension being grouped by (e.g., "region")
201
- * - `group_value`: The specific value for this group (e.g., "US-East")
224
+ * - `group`: Object mapping group keys to their values
225
+ * - For simple groups, this will be a map with a single key-value pair (e.g.,
226
+ * `{"region": "US-East"}`)
227
+ * - For compound groups, this will be a map with multiple key-value pairs (e.g.,
228
+ * `{"region": "US-East", "team": "engineering"}`)
202
229
  * - `value`: Aggregated usage for this group and time window
203
230
  * - `next_page`: Pagination cursor for large datasets
204
231
  *
@@ -208,12 +235,13 @@ export class Usage extends APIResource {
208
235
  * `window_size`
209
236
  * - Time windows: Set `window_size` to hour, day, or none for different
210
237
  * granularities
211
- * - Group filtering: Use `group_by` to specify:
212
- * - key: The dimension to group by (must be set on the billable metric as a
213
- * group key)
214
- * - values: Optional array to filter to specific values only
238
+ * - Group filtering: Use `group_key` and `group_filters` to specify groups and
239
+ * group filters
240
+ * - Limits: When using compound group keys (2+ keys in `group_key`), the default
241
+ * and max limit is 100
215
242
  * - Pagination: Use limit and `next_page` for large result sets
216
- * - Null handling: `group_value` may be null for unmatched data
243
+ * - Null handling: Group values may be null for events missing the group key
244
+ * property
217
245
  *
218
246
  * @example
219
247
  * ```ts
@@ -225,10 +253,8 @@ export class Usage extends APIResource {
225
253
  * customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
226
254
  * window_size: 'day',
227
255
  * ending_before: '2021-01-03T00:00:00Z',
228
- * group_by: {
229
- * key: 'region',
230
- * values: ['US-East', 'US-West', 'EU-Central'],
231
- * },
256
+ * group_filters: { region: ['us-east1', 'us-west1'] },
257
+ * group_key: ['region'],
232
258
  * starting_on: '2021-01-01T00:00:00Z',
233
259
  * },
234
260
  * )) {
@@ -324,13 +350,27 @@ export interface UsageListResponse {
324
350
  export interface UsageListWithGroupsResponse {
325
351
  ending_before: string;
326
352
 
353
+ /**
354
+ * @deprecated Use `group` instead. The group key for single-key grouping.
355
+ */
327
356
  group_key: string | null;
328
357
 
358
+ /**
359
+ * @deprecated Use `group` instead. The group value for single-key grouping.
360
+ */
329
361
  group_value: string | null;
330
362
 
331
363
  starting_on: string;
332
364
 
333
365
  value: number | null;
366
+
367
+ /**
368
+ * Map of group key to their value for this usage aggregate. For simple group keys,
369
+ * this should be a single key e.g. `{"region": "US-East"}` For compound group
370
+ * keys, this should contain the values of each group key that forms the compound
371
+ * e.g. `{"region": "US-East", "team": "engineering"}`
372
+ */
373
+ group?: { [key: string]: string };
334
374
  }
335
375
 
336
376
  export type UsageSearchResponse = Array<UsageSearchResponse.UsageSearchResponseItem>;
@@ -451,12 +491,12 @@ export namespace UsageSearchResponse {
451
491
 
452
492
  export interface UsageListParams extends CursorPageWithoutLimitParams {
453
493
  /**
454
- * Body param:
494
+ * Body param
455
495
  */
456
496
  ending_before: string;
457
497
 
458
498
  /**
459
- * Body param:
499
+ * Body param
460
500
  */
461
501
  starting_on: string;
462
502
 
@@ -527,12 +567,12 @@ export namespace UsageIngestParams {
527
567
 
528
568
  export interface UsageListWithGroupsParams extends CursorPageParams {
529
569
  /**
530
- * Body param:
570
+ * Body param
531
571
  */
532
572
  billable_metric_id: string;
533
573
 
534
574
  /**
535
- * Body param:
575
+ * Body param
536
576
  */
537
577
  customer_id: string;
538
578
 
@@ -552,22 +592,50 @@ export interface UsageListWithGroupsParams extends CursorPageParams {
552
592
  current_period?: boolean;
553
593
 
554
594
  /**
555
- * Body param:
595
+ * Body param
556
596
  */
557
597
  ending_before?: string;
558
598
 
559
599
  /**
560
- * Body param:
600
+ * @deprecated Body param: Use group_key and group_filters instead. Use a single
601
+ * group key to group by. Compound group keys are not supported.
561
602
  */
562
603
  group_by?: UsageListWithGroupsParams.GroupBy;
563
604
 
564
605
  /**
565
- * Body param:
606
+ * Body param: Object mapping group keys to arrays of values to filter on. Only
607
+ * usage matching these filter values will be returned. Keys must be present in
608
+ * group_key. Omit a key or use an empty array to include all values for that
609
+ * dimension.
610
+ */
611
+ group_filters?: { [key: string]: Array<string> };
612
+
613
+ /**
614
+ * Body param: Group key to group usage by. Supports both simple (single key) and
615
+ * compound (multiple keys) group keys.
616
+ *
617
+ * For simple group keys, provide a single key e.g. `["region"]`. For compound
618
+ * group keys, provide multiple keys e.g. `["region", "team"]`.
619
+ *
620
+ * For streaming metrics, the keys must be defined as a simple or compound group
621
+ * key on the billable metric. For compound group keys, all keys must match an
622
+ * exact compound group key definition — partial matches are not allowed.
623
+ *
624
+ * Cannot be used together with `group_by`.
625
+ */
626
+ group_key?: Array<string>;
627
+
628
+ /**
629
+ * Body param
566
630
  */
567
631
  starting_on?: string;
568
632
  }
569
633
 
570
634
  export namespace UsageListWithGroupsParams {
635
+ /**
636
+ * @deprecated Use group_key and group_filters instead. Use a single group key to
637
+ * group by. Compound group keys are not supported.
638
+ */
571
639
  export interface GroupBy {
572
640
  /**
573
641
  * The name of the group_by key to use
@@ -69,6 +69,22 @@ import {
69
69
  InvoiceVoidResponse,
70
70
  Invoices,
71
71
  } from './invoices';
72
+ import * as PackagesAPI from './packages';
73
+ import {
74
+ PackageArchiveParams,
75
+ PackageArchiveResponse,
76
+ PackageCreateParams,
77
+ PackageCreateResponse,
78
+ PackageListContractsOnPackageParams,
79
+ PackageListContractsOnPackageResponse,
80
+ PackageListContractsOnPackageResponsesCursorPage,
81
+ PackageListParams,
82
+ PackageListResponse,
83
+ PackageListResponsesCursorPage,
84
+ PackageRetrieveParams,
85
+ PackageRetrieveResponse,
86
+ Packages,
87
+ } from './packages';
72
88
  import * as PaymentsAPI from './payments';
73
89
  import {
74
90
  Payment,
@@ -130,6 +146,8 @@ import {
130
146
  ContractCreateHistoricalInvoicesResponse,
131
147
  ContractCreateParams,
132
148
  ContractCreateResponse,
149
+ ContractGetNetBalanceParams,
150
+ ContractGetNetBalanceResponse,
133
151
  ContractListBalancesParams,
134
152
  ContractListBalancesResponse,
135
153
  ContractListBalancesResponsesBodyCursorPage,
@@ -151,6 +169,8 @@ import {
151
169
  import * as CustomersAPI from './customers/customers';
152
170
  import {
153
171
  Customer,
172
+ CustomerArchiveBillingConfigurationsParams,
173
+ CustomerArchiveBillingConfigurationsResponse,
154
174
  CustomerArchiveParams,
155
175
  CustomerArchiveResponse,
156
176
  CustomerCreateParams,
@@ -199,6 +219,7 @@ export class V1 extends APIResource {
199
219
  services: ServicesAPI.Services = new ServicesAPI.Services(this._client);
200
220
  invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
201
221
  contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
222
+ packages: PackagesAPI.Packages = new PackagesAPI.Packages(this._client);
202
223
  payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
203
224
  settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
204
225
  }
@@ -216,6 +237,7 @@ V1.BillableMetrics = BillableMetrics;
216
237
  V1.Services = Services;
217
238
  V1.Invoices = Invoices;
218
239
  V1.Contracts = Contracts;
240
+ V1.Packages = Packages;
219
241
  V1.Payments = Payments;
220
242
  V1.Settings = Settings;
221
243
 
@@ -277,6 +299,7 @@ export declare namespace V1 {
277
299
  type CustomerCreateResponse as CustomerCreateResponse,
278
300
  type CustomerRetrieveResponse as CustomerRetrieveResponse,
279
301
  type CustomerArchiveResponse as CustomerArchiveResponse,
302
+ type CustomerArchiveBillingConfigurationsResponse as CustomerArchiveBillingConfigurationsResponse,
280
303
  type CustomerListBillableMetricsResponse as CustomerListBillableMetricsResponse,
281
304
  type CustomerListCostsResponse as CustomerListCostsResponse,
282
305
  type CustomerPreviewEventsResponse as CustomerPreviewEventsResponse,
@@ -290,6 +313,7 @@ export declare namespace V1 {
290
313
  type CustomerRetrieveParams as CustomerRetrieveParams,
291
314
  type CustomerListParams as CustomerListParams,
292
315
  type CustomerArchiveParams as CustomerArchiveParams,
316
+ type CustomerArchiveBillingConfigurationsParams as CustomerArchiveBillingConfigurationsParams,
293
317
  type CustomerListBillableMetricsParams as CustomerListBillableMetricsParams,
294
318
  type CustomerListCostsParams as CustomerListCostsParams,
295
319
  type CustomerPreviewEventsParams as CustomerPreviewEventsParams,
@@ -368,6 +392,7 @@ export declare namespace V1 {
368
392
  type ContractAmendResponse as ContractAmendResponse,
369
393
  type ContractArchiveResponse as ContractArchiveResponse,
370
394
  type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
395
+ type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
371
396
  type ContractListBalancesResponse as ContractListBalancesResponse,
372
397
  type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
373
398
  type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
@@ -381,6 +406,7 @@ export declare namespace V1 {
381
406
  type ContractAmendParams as ContractAmendParams,
382
407
  type ContractArchiveParams as ContractArchiveParams,
383
408
  type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
409
+ type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
384
410
  type ContractListBalancesParams as ContractListBalancesParams,
385
411
  type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
386
412
  type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
@@ -389,6 +415,22 @@ export declare namespace V1 {
389
415
  type ContractUpdateEndDateParams as ContractUpdateEndDateParams,
390
416
  };
391
417
 
418
+ export {
419
+ Packages as Packages,
420
+ type PackageCreateResponse as PackageCreateResponse,
421
+ type PackageRetrieveResponse as PackageRetrieveResponse,
422
+ type PackageListResponse as PackageListResponse,
423
+ type PackageArchiveResponse as PackageArchiveResponse,
424
+ type PackageListContractsOnPackageResponse as PackageListContractsOnPackageResponse,
425
+ type PackageListResponsesCursorPage as PackageListResponsesCursorPage,
426
+ type PackageListContractsOnPackageResponsesCursorPage as PackageListContractsOnPackageResponsesCursorPage,
427
+ type PackageCreateParams as PackageCreateParams,
428
+ type PackageRetrieveParams as PackageRetrieveParams,
429
+ type PackageListParams as PackageListParams,
430
+ type PackageArchiveParams as PackageArchiveParams,
431
+ type PackageListContractsOnPackageParams as PackageListContractsOnPackageParams,
432
+ };
433
+
392
434
  export {
393
435
  Payments as Payments,
394
436
  type Payment as Payment,
@@ -76,10 +76,7 @@ export class Contracts extends APIResource {
76
76
  *
77
77
  * ### Key response fields:
78
78
  *
79
- * - The `id` of the edit
80
- * - Complete edit details. For example, if you edited the contract to add new
81
- * overrides and credits, you will receive the IDs of those overrides and credits
82
- * in the response.
79
+ * - The `id` of the contract that was edited
83
80
  *
84
81
  * ### Usage guidelines:
85
82
  *
@@ -556,7 +553,7 @@ export namespace ContractGetEditHistoryResponse {
556
553
  }
557
554
 
558
555
  export interface OverwriteRate {
559
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
556
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
560
557
 
561
558
  credit_type?: Shared.CreditTypeData;
562
559
 
@@ -1677,6 +1674,13 @@ export interface ContractEditParams {
1677
1674
 
1678
1675
  add_reseller_royalties?: Array<ContractEditParams.AddResellerRoyalty>;
1679
1676
 
1677
+ /**
1678
+ * Update the revenue system configuration on the contract. Currently only supports
1679
+ * adding a revenue system configuration to a contract that does not already have
1680
+ * one.
1681
+ */
1682
+ add_revenue_system_configuration_update?: ContractEditParams.AddRevenueSystemConfigurationUpdate;
1683
+
1680
1684
  add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
1681
1685
 
1682
1686
  add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
@@ -1736,6 +1740,12 @@ export interface ContractEditParams {
1736
1740
 
1737
1741
  update_credits?: Array<ContractEditParams.UpdateCredit>;
1738
1742
 
1743
+ /**
1744
+ * Number of days after issuance of invoice after which the invoice is due (e.g.
1745
+ * Net 30).
1746
+ */
1747
+ update_net_payment_terms_days?: number | null;
1748
+
1739
1749
  update_prepaid_balance_threshold_configuration?: ContractEditParams.UpdatePrepaidBalanceThresholdConfiguration;
1740
1750
 
1741
1751
  /**
@@ -2065,7 +2075,7 @@ export namespace ContractEditParams {
2065
2075
  * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2066
2076
  * will default to NONE.
2067
2077
  */
2068
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
2078
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2069
2079
  }
2070
2080
 
2071
2081
  export namespace PaymentGateConfig {
@@ -2169,6 +2179,11 @@ export namespace ContractEditParams {
2169
2179
 
2170
2180
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2171
2181
 
2182
+ /**
2183
+ * Fraction of unused segments that will be rolled over. Must be between 0 and 1.
2184
+ */
2185
+ rollover_fraction?: number;
2186
+
2172
2187
  /**
2173
2188
  * List of filters that determine what kind of customer usage draws down a commit
2174
2189
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -2461,7 +2476,7 @@ export namespace ContractEditParams {
2461
2476
  * Required for OVERWRITE type.
2462
2477
  */
2463
2478
  export interface OverwriteRate {
2464
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2479
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
2465
2480
 
2466
2481
  credit_type_id?: string;
2467
2482
 
@@ -2925,6 +2940,37 @@ export namespace ContractEditParams {
2925
2940
  }
2926
2941
  }
2927
2942
 
2943
+ /**
2944
+ * Update the revenue system configuration on the contract. Currently only supports
2945
+ * adding a revenue system configuration to a contract that does not already have
2946
+ * one.
2947
+ */
2948
+ export interface AddRevenueSystemConfigurationUpdate {
2949
+ revenue_system_configuration: AddRevenueSystemConfigurationUpdate.RevenueSystemConfiguration;
2950
+
2951
+ schedule: AddRevenueSystemConfigurationUpdate.Schedule;
2952
+ }
2953
+
2954
+ export namespace AddRevenueSystemConfigurationUpdate {
2955
+ export interface RevenueSystemConfiguration {
2956
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
2957
+
2958
+ /**
2959
+ * The revenue system provider type.
2960
+ */
2961
+ provider?: 'netsuite';
2962
+
2963
+ revenue_system_configuration_id?: string;
2964
+ }
2965
+
2966
+ export interface Schedule {
2967
+ /**
2968
+ * When the revenue system configuration update will take effect.
2969
+ */
2970
+ effective_at: 'START_OF_CURRENT_PERIOD';
2971
+ }
2972
+ }
2973
+
2928
2974
  export interface AddScheduledCharge {
2929
2975
  product_id: string;
2930
2976
 
@@ -3332,6 +3378,8 @@ export namespace ContractEditParams {
3332
3378
  * regenerated to reflect the rate type change.
3333
3379
  */
3334
3380
  rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
3381
+
3382
+ rollover_fraction?: number | null;
3335
3383
  }
3336
3384
 
3337
3385
  export namespace UpdateCredit {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.2.0'; // x-release-please-version
1
+ export const VERSION = '3.4.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "3.4.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "3.4.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.2.0'; // x-release-please-version
4
+ exports.VERSION = '3.4.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.2.0'; // x-release-please-version
1
+ export const VERSION = '3.4.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map