@metronome/sdk 3.0.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 (347) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +5 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +26 -10
  8. package/client.js.map +1 -1
  9. package/client.mjs +26 -10
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/internal/tslib.js +17 -17
  18. package/internal/utils/query.d.mts +2 -0
  19. package/internal/utils/query.d.mts.map +1 -0
  20. package/internal/utils/query.d.ts +2 -0
  21. package/internal/utils/query.d.ts.map +1 -0
  22. package/internal/utils/query.js +10 -0
  23. package/internal/utils/query.js.map +1 -0
  24. package/internal/utils/query.mjs +6 -0
  25. package/internal/utils/query.mjs.map +1 -0
  26. package/internal/utils.d.mts +1 -0
  27. package/internal/utils.d.ts +1 -0
  28. package/internal/utils.js +1 -0
  29. package/internal/utils.js.map +1 -1
  30. package/internal/utils.mjs +1 -0
  31. package/package.json +12 -1
  32. package/resources/shared.d.mts +49 -24
  33. package/resources/shared.d.mts.map +1 -1
  34. package/resources/shared.d.ts +49 -24
  35. package/resources/shared.d.ts.map +1 -1
  36. package/resources/v1/alerts.d.mts +3 -0
  37. package/resources/v1/alerts.d.mts.map +1 -1
  38. package/resources/v1/alerts.d.ts +3 -0
  39. package/resources/v1/alerts.d.ts.map +1 -1
  40. package/resources/v1/alerts.js +3 -0
  41. package/resources/v1/alerts.js.map +1 -1
  42. package/resources/v1/alerts.mjs +3 -0
  43. package/resources/v1/alerts.mjs.map +1 -1
  44. package/resources/v1/audit-logs.d.mts +3 -0
  45. package/resources/v1/audit-logs.d.mts.map +1 -1
  46. package/resources/v1/audit-logs.d.ts +3 -0
  47. package/resources/v1/audit-logs.d.ts.map +1 -1
  48. package/resources/v1/audit-logs.js +3 -0
  49. package/resources/v1/audit-logs.js.map +1 -1
  50. package/resources/v1/audit-logs.mjs +3 -0
  51. package/resources/v1/audit-logs.mjs.map +1 -1
  52. package/resources/v1/billable-metrics.d.mts +3 -0
  53. package/resources/v1/billable-metrics.d.mts.map +1 -1
  54. package/resources/v1/billable-metrics.d.ts +3 -0
  55. package/resources/v1/billable-metrics.d.ts.map +1 -1
  56. package/resources/v1/billable-metrics.js +3 -0
  57. package/resources/v1/billable-metrics.js.map +1 -1
  58. package/resources/v1/billable-metrics.mjs +3 -0
  59. package/resources/v1/billable-metrics.mjs.map +1 -1
  60. package/resources/v1/contracts/contracts.d.mts +134 -14
  61. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  62. package/resources/v1/contracts/contracts.d.ts +134 -14
  63. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  64. package/resources/v1/contracts/contracts.js +69 -0
  65. package/resources/v1/contracts/contracts.js.map +1 -1
  66. package/resources/v1/contracts/contracts.mjs +69 -0
  67. package/resources/v1/contracts/contracts.mjs.map +1 -1
  68. package/resources/v1/contracts/index.d.mts +1 -1
  69. package/resources/v1/contracts/index.d.mts.map +1 -1
  70. package/resources/v1/contracts/index.d.ts +1 -1
  71. package/resources/v1/contracts/index.d.ts.map +1 -1
  72. package/resources/v1/contracts/index.js.map +1 -1
  73. package/resources/v1/contracts/index.mjs.map +1 -1
  74. package/resources/v1/contracts/named-schedules.d.mts +3 -0
  75. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  76. package/resources/v1/contracts/named-schedules.d.ts +3 -0
  77. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  78. package/resources/v1/contracts/named-schedules.js +3 -0
  79. package/resources/v1/contracts/named-schedules.js.map +1 -1
  80. package/resources/v1/contracts/named-schedules.mjs +3 -0
  81. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  82. package/resources/v1/contracts/products.d.mts +3 -0
  83. package/resources/v1/contracts/products.d.mts.map +1 -1
  84. package/resources/v1/contracts/products.d.ts +3 -0
  85. package/resources/v1/contracts/products.d.ts.map +1 -1
  86. package/resources/v1/contracts/products.js +3 -0
  87. package/resources/v1/contracts/products.js.map +1 -1
  88. package/resources/v1/contracts/products.mjs +3 -0
  89. package/resources/v1/contracts/products.mjs.map +1 -1
  90. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +3 -0
  91. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  92. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +3 -0
  93. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  94. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -0
  95. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  96. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -0
  97. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  98. package/resources/v1/contracts/rate-cards/product-orders.d.mts +3 -0
  99. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  100. package/resources/v1/contracts/rate-cards/product-orders.d.ts +3 -0
  101. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  102. package/resources/v1/contracts/rate-cards/product-orders.js +3 -0
  103. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  104. package/resources/v1/contracts/rate-cards/product-orders.mjs +3 -0
  105. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  106. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +3 -0
  107. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  108. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +3 -0
  109. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  110. package/resources/v1/contracts/rate-cards/rate-cards.js +3 -0
  111. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  112. package/resources/v1/contracts/rate-cards/rate-cards.mjs +3 -0
  113. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  114. package/resources/v1/contracts/rate-cards/rates.d.mts +6 -3
  115. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  116. package/resources/v1/contracts/rate-cards/rates.d.ts +6 -3
  117. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  118. package/resources/v1/contracts/rate-cards/rates.js +3 -0
  119. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  120. package/resources/v1/contracts/rate-cards/rates.mjs +3 -0
  121. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  122. package/resources/v1/credit-grants.d.mts +3 -0
  123. package/resources/v1/credit-grants.d.mts.map +1 -1
  124. package/resources/v1/credit-grants.d.ts +3 -0
  125. package/resources/v1/credit-grants.d.ts.map +1 -1
  126. package/resources/v1/credit-grants.js +3 -0
  127. package/resources/v1/credit-grants.js.map +1 -1
  128. package/resources/v1/credit-grants.mjs +3 -0
  129. package/resources/v1/credit-grants.mjs.map +1 -1
  130. package/resources/v1/custom-fields.d.mts +3 -0
  131. package/resources/v1/custom-fields.d.mts.map +1 -1
  132. package/resources/v1/custom-fields.d.ts +3 -0
  133. package/resources/v1/custom-fields.d.ts.map +1 -1
  134. package/resources/v1/custom-fields.js +3 -0
  135. package/resources/v1/custom-fields.js.map +1 -1
  136. package/resources/v1/custom-fields.mjs +3 -0
  137. package/resources/v1/custom-fields.mjs.map +1 -1
  138. package/resources/v1/customers/alerts.d.mts +3 -0
  139. package/resources/v1/customers/alerts.d.mts.map +1 -1
  140. package/resources/v1/customers/alerts.d.ts +3 -0
  141. package/resources/v1/customers/alerts.d.ts.map +1 -1
  142. package/resources/v1/customers/alerts.js +3 -0
  143. package/resources/v1/customers/alerts.js.map +1 -1
  144. package/resources/v1/customers/alerts.mjs +3 -0
  145. package/resources/v1/customers/alerts.mjs.map +1 -1
  146. package/resources/v1/customers/billing-config.d.mts +3 -0
  147. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  148. package/resources/v1/customers/billing-config.d.ts +3 -0
  149. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  150. package/resources/v1/customers/billing-config.js +3 -0
  151. package/resources/v1/customers/billing-config.js.map +1 -1
  152. package/resources/v1/customers/billing-config.mjs +3 -0
  153. package/resources/v1/customers/billing-config.mjs.map +1 -1
  154. package/resources/v1/customers/commits.d.mts +3 -0
  155. package/resources/v1/customers/commits.d.mts.map +1 -1
  156. package/resources/v1/customers/commits.d.ts +3 -0
  157. package/resources/v1/customers/commits.d.ts.map +1 -1
  158. package/resources/v1/customers/commits.js +3 -0
  159. package/resources/v1/customers/commits.js.map +1 -1
  160. package/resources/v1/customers/commits.mjs +3 -0
  161. package/resources/v1/customers/commits.mjs.map +1 -1
  162. package/resources/v1/customers/credits.d.mts +3 -0
  163. package/resources/v1/customers/credits.d.mts.map +1 -1
  164. package/resources/v1/customers/credits.d.ts +3 -0
  165. package/resources/v1/customers/credits.d.ts.map +1 -1
  166. package/resources/v1/customers/credits.js +3 -0
  167. package/resources/v1/customers/credits.js.map +1 -1
  168. package/resources/v1/customers/credits.mjs +3 -0
  169. package/resources/v1/customers/credits.mjs.map +1 -1
  170. package/resources/v1/customers/customers.d.mts +77 -1
  171. package/resources/v1/customers/customers.d.mts.map +1 -1
  172. package/resources/v1/customers/customers.d.ts +77 -1
  173. package/resources/v1/customers/customers.d.ts.map +1 -1
  174. package/resources/v1/customers/customers.js +53 -0
  175. package/resources/v1/customers/customers.js.map +1 -1
  176. package/resources/v1/customers/customers.mjs +53 -0
  177. package/resources/v1/customers/customers.mjs.map +1 -1
  178. package/resources/v1/customers/index.d.mts +1 -1
  179. package/resources/v1/customers/index.d.mts.map +1 -1
  180. package/resources/v1/customers/index.d.ts +1 -1
  181. package/resources/v1/customers/index.d.ts.map +1 -1
  182. package/resources/v1/customers/index.js.map +1 -1
  183. package/resources/v1/customers/index.mjs.map +1 -1
  184. package/resources/v1/customers/invoices.d.mts +20 -12
  185. package/resources/v1/customers/invoices.d.mts.map +1 -1
  186. package/resources/v1/customers/invoices.d.ts +20 -12
  187. package/resources/v1/customers/invoices.d.ts.map +1 -1
  188. package/resources/v1/customers/invoices.js +3 -0
  189. package/resources/v1/customers/invoices.js.map +1 -1
  190. package/resources/v1/customers/invoices.mjs +3 -0
  191. package/resources/v1/customers/invoices.mjs.map +1 -1
  192. package/resources/v1/customers/named-schedules.d.mts +3 -0
  193. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  194. package/resources/v1/customers/named-schedules.d.ts +3 -0
  195. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  196. package/resources/v1/customers/named-schedules.js +3 -0
  197. package/resources/v1/customers/named-schedules.js.map +1 -1
  198. package/resources/v1/customers/named-schedules.mjs +3 -0
  199. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  200. package/resources/v1/customers/plans.d.mts +3 -0
  201. package/resources/v1/customers/plans.d.mts.map +1 -1
  202. package/resources/v1/customers/plans.d.ts +3 -0
  203. package/resources/v1/customers/plans.d.ts.map +1 -1
  204. package/resources/v1/customers/plans.js +3 -0
  205. package/resources/v1/customers/plans.js.map +1 -1
  206. package/resources/v1/customers/plans.mjs +3 -0
  207. package/resources/v1/customers/plans.mjs.map +1 -1
  208. package/resources/v1/dashboards.d.mts +3 -0
  209. package/resources/v1/dashboards.d.mts.map +1 -1
  210. package/resources/v1/dashboards.d.ts +3 -0
  211. package/resources/v1/dashboards.d.ts.map +1 -1
  212. package/resources/v1/dashboards.js +3 -0
  213. package/resources/v1/dashboards.js.map +1 -1
  214. package/resources/v1/dashboards.mjs +3 -0
  215. package/resources/v1/dashboards.mjs.map +1 -1
  216. package/resources/v1/index.d.mts +3 -2
  217. package/resources/v1/index.d.mts.map +1 -1
  218. package/resources/v1/index.d.ts +3 -2
  219. package/resources/v1/index.d.ts.map +1 -1
  220. package/resources/v1/index.js +3 -1
  221. package/resources/v1/index.js.map +1 -1
  222. package/resources/v1/index.mjs +1 -0
  223. package/resources/v1/index.mjs.map +1 -1
  224. package/resources/v1/invoices.d.mts +3 -0
  225. package/resources/v1/invoices.d.mts.map +1 -1
  226. package/resources/v1/invoices.d.ts +3 -0
  227. package/resources/v1/invoices.d.ts.map +1 -1
  228. package/resources/v1/invoices.js +3 -0
  229. package/resources/v1/invoices.js.map +1 -1
  230. package/resources/v1/invoices.mjs +3 -0
  231. package/resources/v1/invoices.mjs.map +1 -1
  232. package/resources/v1/packages.d.mts +2352 -0
  233. package/resources/v1/packages.d.mts.map +1 -0
  234. package/resources/v1/packages.d.ts +2352 -0
  235. package/resources/v1/packages.d.ts.map +1 -0
  236. package/resources/v1/packages.js +160 -0
  237. package/resources/v1/packages.js.map +1 -0
  238. package/resources/v1/packages.mjs +156 -0
  239. package/resources/v1/packages.mjs.map +1 -0
  240. package/resources/v1/plans.d.mts +3 -0
  241. package/resources/v1/plans.d.mts.map +1 -1
  242. package/resources/v1/plans.d.ts +3 -0
  243. package/resources/v1/plans.d.ts.map +1 -1
  244. package/resources/v1/plans.js +3 -0
  245. package/resources/v1/plans.js.map +1 -1
  246. package/resources/v1/plans.mjs +3 -0
  247. package/resources/v1/plans.mjs.map +1 -1
  248. package/resources/v1/pricing-units.d.mts +3 -0
  249. package/resources/v1/pricing-units.d.mts.map +1 -1
  250. package/resources/v1/pricing-units.d.ts +3 -0
  251. package/resources/v1/pricing-units.d.ts.map +1 -1
  252. package/resources/v1/pricing-units.js +3 -0
  253. package/resources/v1/pricing-units.js.map +1 -1
  254. package/resources/v1/pricing-units.mjs +3 -0
  255. package/resources/v1/pricing-units.mjs.map +1 -1
  256. package/resources/v1/services.d.mts +3 -0
  257. package/resources/v1/services.d.mts.map +1 -1
  258. package/resources/v1/services.d.ts +3 -0
  259. package/resources/v1/services.d.ts.map +1 -1
  260. package/resources/v1/services.js +3 -0
  261. package/resources/v1/services.js.map +1 -1
  262. package/resources/v1/services.mjs +3 -0
  263. package/resources/v1/services.mjs.map +1 -1
  264. package/resources/v1/settings/billing-providers.d.mts +3 -0
  265. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  266. package/resources/v1/settings/billing-providers.d.ts +3 -0
  267. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  268. package/resources/v1/settings/billing-providers.js +3 -0
  269. package/resources/v1/settings/billing-providers.js.map +1 -1
  270. package/resources/v1/settings/billing-providers.mjs +3 -0
  271. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  272. package/resources/v1/settings/settings.d.mts +3 -0
  273. package/resources/v1/settings/settings.d.mts.map +1 -1
  274. package/resources/v1/settings/settings.d.ts +3 -0
  275. package/resources/v1/settings/settings.d.ts.map +1 -1
  276. package/resources/v1/settings/settings.js +3 -0
  277. package/resources/v1/settings/settings.js.map +1 -1
  278. package/resources/v1/settings/settings.mjs +3 -0
  279. package/resources/v1/settings/settings.mjs.map +1 -1
  280. package/resources/v1/usage.d.mts +81 -12
  281. package/resources/v1/usage.d.mts.map +1 -1
  282. package/resources/v1/usage.d.ts +81 -12
  283. package/resources/v1/usage.d.ts.map +1 -1
  284. package/resources/v1/usage.js +37 -11
  285. package/resources/v1/usage.js.map +1 -1
  286. package/resources/v1/usage.mjs +37 -11
  287. package/resources/v1/usage.mjs.map +1 -1
  288. package/resources/v1/v1.d.mts +8 -4
  289. package/resources/v1/v1.d.mts.map +1 -1
  290. package/resources/v1/v1.d.ts +8 -4
  291. package/resources/v1/v1.d.ts.map +1 -1
  292. package/resources/v1/v1.js +4 -0
  293. package/resources/v1/v1.js.map +1 -1
  294. package/resources/v1/v1.mjs +4 -0
  295. package/resources/v1/v1.mjs.map +1 -1
  296. package/resources/v2/contracts.d.mts +45 -7
  297. package/resources/v2/contracts.d.mts.map +1 -1
  298. package/resources/v2/contracts.d.ts +45 -7
  299. package/resources/v2/contracts.d.ts.map +1 -1
  300. package/resources/v2/contracts.js +1 -4
  301. package/resources/v2/contracts.js.map +1 -1
  302. package/resources/v2/contracts.mjs +1 -4
  303. package/resources/v2/contracts.mjs.map +1 -1
  304. package/src/client.ts +37 -15
  305. package/src/internal/parse.ts +6 -0
  306. package/src/internal/utils/query.ts +7 -0
  307. package/src/internal/utils.ts +1 -0
  308. package/src/resources/shared.ts +51 -25
  309. package/src/resources/v1/alerts.ts +3 -0
  310. package/src/resources/v1/audit-logs.ts +3 -0
  311. package/src/resources/v1/billable-metrics.ts +3 -0
  312. package/src/resources/v1/contracts/contracts.ts +151 -13
  313. package/src/resources/v1/contracts/index.ts +2 -0
  314. package/src/resources/v1/contracts/named-schedules.ts +3 -0
  315. package/src/resources/v1/contracts/products.ts +3 -0
  316. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +3 -0
  317. package/src/resources/v1/contracts/rate-cards/product-orders.ts +3 -0
  318. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +3 -0
  319. package/src/resources/v1/contracts/rate-cards/rates.ts +6 -3
  320. package/src/resources/v1/credit-grants.ts +3 -0
  321. package/src/resources/v1/custom-fields.ts +3 -0
  322. package/src/resources/v1/customers/alerts.ts +3 -0
  323. package/src/resources/v1/customers/billing-config.ts +3 -0
  324. package/src/resources/v1/customers/commits.ts +3 -0
  325. package/src/resources/v1/customers/credits.ts +3 -0
  326. package/src/resources/v1/customers/customers.ts +89 -0
  327. package/src/resources/v1/customers/index.ts +2 -0
  328. package/src/resources/v1/customers/invoices.ts +21 -12
  329. package/src/resources/v1/customers/named-schedules.ts +3 -0
  330. package/src/resources/v1/customers/plans.ts +3 -0
  331. package/src/resources/v1/dashboards.ts +3 -0
  332. package/src/resources/v1/index.ts +19 -0
  333. package/src/resources/v1/invoices.ts +3 -0
  334. package/src/resources/v1/packages.ts +3057 -0
  335. package/src/resources/v1/plans.ts +3 -0
  336. package/src/resources/v1/pricing-units.ts +3 -0
  337. package/src/resources/v1/services.ts +3 -0
  338. package/src/resources/v1/settings/billing-providers.ts +3 -0
  339. package/src/resources/v1/settings/settings.ts +3 -0
  340. package/src/resources/v1/usage.ts +80 -12
  341. package/src/resources/v1/v1.ts +42 -0
  342. package/src/resources/v2/contracts.ts +55 -7
  343. package/src/version.ts +1 -1
  344. package/version.d.mts +1 -1
  345. package/version.d.ts +1 -1
  346. package/version.js +1 -1
  347. package/version.mjs +1 -1
@@ -7,6 +7,9 @@ import { APIPromise } from '../../../core/api-promise';
7
7
  import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
 
10
+ /**
11
+ * Products are the items that customers purchase.
12
+ */
10
13
  export class Products extends APIResource {
11
14
  /**
12
15
  * Create a new product object. Products in Metronome represent your company's
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../../core/api-promise';
5
5
  import { buildHeaders } from '../../../../internal/headers';
6
6
  import { RequestOptions } from '../../../../internal/request-options';
7
7
 
8
+ /**
9
+ * Named schedules are used for storing custom data that can change over time. Named schedules are often used in custom pricing logic.
10
+ */
8
11
  export class NamedSchedules extends APIResource {
9
12
  /**
10
13
  * Get a named schedule for the given contract. This endpoint's availability is
@@ -5,6 +5,9 @@ import * as Shared from '../../../shared';
5
5
  import { APIPromise } from '../../../../core/api-promise';
6
6
  import { RequestOptions } from '../../../../internal/request-options';
7
7
 
8
+ /**
9
+ * Rate cards are used to define default pricing for products.
10
+ */
8
11
  export class ProductOrders extends APIResource {
9
12
  /**
10
13
  * The ordering of products on a rate card determines the order in which the
@@ -32,6 +32,9 @@ import { APIPromise } from '../../../../core/api-promise';
32
32
  import { CursorPage, type CursorPageParams, PagePromise } from '../../../../core/pagination';
33
33
  import { RequestOptions } from '../../../../internal/request-options';
34
34
 
35
+ /**
36
+ * Rate cards are used to define default pricing for products.
37
+ */
35
38
  export class RateCards extends APIResource {
36
39
  productOrders: ProductOrdersAPI.ProductOrders = new ProductOrdersAPI.ProductOrders(this._client);
37
40
  rates: RatesAPI.Rates = new RatesAPI.Rates(this._client);
@@ -6,6 +6,9 @@ import { APIPromise } from '../../../../core/api-promise';
6
6
  import { CursorPage, type CursorPageParams, PagePromise } from '../../../../core/pagination';
7
7
  import { RequestOptions } from '../../../../internal/request-options';
8
8
 
9
+ /**
10
+ * Rate cards are used to define default pricing for products.
11
+ */
9
12
  export class Rates extends APIResource {
10
13
  /**
11
14
  * Understand the rate schedule at a given timestamp, optionally filtering the list
@@ -153,7 +156,7 @@ export interface RateAddResponse {
153
156
 
154
157
  export namespace RateAddResponse {
155
158
  export interface Data {
156
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED';
159
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED' | 'TIERED_PERCENTAGE';
157
160
 
158
161
  /**
159
162
  * A distinct rate on the rate card. You can choose to use this rate rather than
@@ -271,7 +274,7 @@ export interface RateAddParams {
271
274
  */
272
275
  rate_card_id: string;
273
276
 
274
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
277
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
275
278
 
276
279
  /**
277
280
  * inclusive effective date
@@ -353,7 +356,7 @@ export namespace RateAddManyParams {
353
356
  */
354
357
  product_id: string;
355
358
 
356
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
359
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
357
360
 
358
361
  /**
359
362
  * inclusive effective date
@@ -13,6 +13,9 @@ import {
13
13
  } from '../../core/pagination';
14
14
  import { RequestOptions } from '../../internal/request-options';
15
15
 
16
+ /**
17
+ * [Credit grants](https://docs.metronome.com/invoicing/how-billing-works/manage-credits/) adjust a customer balance for prepayments, reimbursements, promotions, and so on. Use these endpoints to create, retrieve, update, and delete credit grants.
18
+ */
16
19
  export class CreditGrants extends APIResource {
17
20
  /**
18
21
  * Create a new credit grant. This is a Plans (deprecated) endpoint. New clients
@@ -10,6 +10,9 @@ import {
10
10
  import { buildHeaders } from '../../internal/headers';
11
11
  import { RequestOptions } from '../../internal/request-options';
12
12
 
13
+ /**
14
+ * [Custom fields](https://docs.metronome.com/integrations/custom-fields/) enable adding additional data to Metronome entities. Use these endpoints to create, retrieve, update, and delete custom fields.
15
+ */
13
16
  export class CustomFields extends APIResource {
14
17
  /**
15
18
  * Creates a new custom field key for a given entity (e.g. billable metric,
@@ -11,6 +11,9 @@ import {
11
11
  import { buildHeaders } from '../../../internal/headers';
12
12
  import { RequestOptions } from '../../../internal/request-options';
13
13
 
14
+ /**
15
+ * [Alerts](https://docs.metronome.com/connecting-metronome/alerts/) monitor customer spending, balances, and other billing factors. Use these endpoints to create, retrieve, and archive customer alerts. To view sample alert payloads by alert type, navigate [here.](https://docs.metronome.com/manage-product-access/create-manage-alerts/#webhook-notifications)
16
+ */
14
17
  export class Alerts extends APIResource {
15
18
  /**
16
19
  * Retrieve the real-time evaluation status for a specific threshold
@@ -6,6 +6,9 @@ import { buildHeaders } from '../../../internal/headers';
6
6
  import { RequestOptions } from '../../../internal/request-options';
7
7
  import { path } from '../../../internal/utils/path';
8
8
 
9
+ /**
10
+ * [Customers](https://docs.metronome.com/provisioning/create-customers/) in Metronome represent your users for all billing and reporting. Use these endpoints to create, retrieve, update, and archive customers and their billing configuration.
11
+ */
9
12
  export class BillingConfig extends APIResource {
10
13
  /**
11
14
  * Set the billing configuration for a given customer. This is a Plans (deprecated)
@@ -7,6 +7,9 @@ import { APIPromise } from '../../../core/api-promise';
7
7
  import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from '../../../core/pagination';
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
 
10
+ /**
11
+ * Credits and commits are used to manage customer balances.
12
+ */
10
13
  export class Commits extends APIResource {
11
14
  /**
12
15
  * Creates customer-level commits that establish spending commitments for customers
@@ -7,6 +7,9 @@ import { APIPromise } from '../../../core/api-promise';
7
7
  import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from '../../../core/pagination';
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
 
10
+ /**
11
+ * Credits and commits are used to manage customer balances.
12
+ */
10
13
  export class Credits extends APIResource {
11
14
  /**
12
15
  * Creates customer-level credits that provide spending allowances or free credit
@@ -217,6 +217,57 @@ export class Customers extends APIResource {
217
217
  return this._client.post('/v1/customers/archive', { body, ...options });
218
218
  }
219
219
 
220
+ /**
221
+ * Deprecate an existing billing configuration for a customer to handle churn or
222
+ * billing and collection preference changes. Archiving a billing configuration
223
+ * takes effect immediately. If there are active contracts using the configuration,
224
+ * Metronome will archive the configuration on the contract and immediately stop
225
+ * metering to downstream systems.
226
+ *
227
+ * ### Use this endpoint to:
228
+ *
229
+ * - Remove billing provider customer data and configurations when no longer needed
230
+ * - Clean up test or deprecated billing provider configurations
231
+ * - Free up uniqueness keys for reuse with new billing provider configurations
232
+ * - Disable threshold recharge configurations associated with archived billing
233
+ * providers
234
+ *
235
+ * ### Key response fields:
236
+ *
237
+ * A successful response returns:
238
+ *
239
+ * - `success`: Boolean indicating the operation completed successfully
240
+ * - `error`: Null on success, error message on failure
241
+ *
242
+ * ### Usage guidelines:
243
+ *
244
+ * - Archiving a contract configuration during a grace period will result in the
245
+ * invoice not being sent to the customer
246
+ * - Automatically disables both spend-based and credit-based threshold recharge
247
+ * configurations for contracts using the archived billing provider
248
+ * - You can archive multiple configurations for a single customer in a single
249
+ * request, but any validation failures for an individual configuration will
250
+ * prevent the entire operation from succeeding
251
+ *
252
+ * @example
253
+ * ```ts
254
+ * const response =
255
+ * await client.v1.customers.archiveBillingConfigurations({
256
+ * customer_billing_provider_configuration_ids: [
257
+ * '4db51251-61de-4bfe-b9ce-495e244f3491',
258
+ * '4db51251-61de-4bfe-b9ce-495e244f3491',
259
+ * ],
260
+ * customer_id: '20a060d1-aa80-41d4-8bb2-4f3091b93903',
261
+ * });
262
+ * ```
263
+ */
264
+ archiveBillingConfigurations(
265
+ body: CustomerArchiveBillingConfigurationsParams,
266
+ options?: RequestOptions,
267
+ ): APIPromise<CustomerArchiveBillingConfigurationsResponse> {
268
+ return this._client.post('/v1/archiveCustomerBillingProviderConfigurations', { body, ...options });
269
+ }
270
+
220
271
  /**
221
272
  * Get all billable metrics available for a specific customer. Supports pagination
222
273
  * and filtering by current plan status or archived metrics. Use this endpoint to
@@ -404,6 +455,12 @@ export class Customers extends APIResource {
404
455
  * configuration: { ... },
405
456
  * delivery_method: 'direct_to_billing_provider',
406
457
  * },
458
+ * {
459
+ * customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
460
+ * billing_provider: 'netsuite',
461
+ * configuration: { ... },
462
+ * delivery_method: 'direct_to_billing_provider',
463
+ * },
407
464
  * ],
408
465
  * });
409
466
  * ```
@@ -602,6 +659,24 @@ export interface CustomerArchiveResponse {
602
659
  data: Shared.ID;
603
660
  }
604
661
 
662
+ export interface CustomerArchiveBillingConfigurationsResponse {
663
+ data: CustomerArchiveBillingConfigurationsResponse.Data;
664
+ }
665
+
666
+ export namespace CustomerArchiveBillingConfigurationsResponse {
667
+ export interface Data {
668
+ /**
669
+ * Array of billing provider configuration IDs to archive
670
+ */
671
+ customer_billing_provider_configuration_ids: Array<string>;
672
+
673
+ /**
674
+ * The customer ID the billing provider configurations belong to
675
+ */
676
+ customer_id: string;
677
+ }
678
+ }
679
+
605
680
  export interface CustomerListBillableMetricsResponse {
606
681
  id: string;
607
682
 
@@ -1001,6 +1076,18 @@ export interface CustomerArchiveParams {
1001
1076
  id: string;
1002
1077
  }
1003
1078
 
1079
+ export interface CustomerArchiveBillingConfigurationsParams {
1080
+ /**
1081
+ * Array of billing provider configuration IDs to archive
1082
+ */
1083
+ customer_billing_provider_configuration_ids: Array<string>;
1084
+
1085
+ /**
1086
+ * The customer ID the billing provider configurations belong to
1087
+ */
1088
+ customer_id: string;
1089
+ }
1090
+
1004
1091
  export interface CustomerListBillableMetricsParams extends CursorPageParams {
1005
1092
  /**
1006
1093
  * Path param
@@ -1202,6 +1289,7 @@ export declare namespace Customers {
1202
1289
  type CustomerCreateResponse as CustomerCreateResponse,
1203
1290
  type CustomerRetrieveResponse as CustomerRetrieveResponse,
1204
1291
  type CustomerArchiveResponse as CustomerArchiveResponse,
1292
+ type CustomerArchiveBillingConfigurationsResponse as CustomerArchiveBillingConfigurationsResponse,
1205
1293
  type CustomerListBillableMetricsResponse as CustomerListBillableMetricsResponse,
1206
1294
  type CustomerListCostsResponse as CustomerListCostsResponse,
1207
1295
  type CustomerPreviewEventsResponse as CustomerPreviewEventsResponse,
@@ -1215,6 +1303,7 @@ export declare namespace Customers {
1215
1303
  type CustomerRetrieveParams as CustomerRetrieveParams,
1216
1304
  type CustomerListParams as CustomerListParams,
1217
1305
  type CustomerArchiveParams as CustomerArchiveParams,
1306
+ type CustomerArchiveBillingConfigurationsParams as CustomerArchiveBillingConfigurationsParams,
1218
1307
  type CustomerListBillableMetricsParams as CustomerListBillableMetricsParams,
1219
1308
  type CustomerListCostsParams as CustomerListCostsParams,
1220
1309
  type CustomerPreviewEventsParams as CustomerPreviewEventsParams,
@@ -39,6 +39,7 @@ export {
39
39
  type CustomerCreateResponse,
40
40
  type CustomerRetrieveResponse,
41
41
  type CustomerArchiveResponse,
42
+ type CustomerArchiveBillingConfigurationsResponse,
42
43
  type CustomerListBillableMetricsResponse,
43
44
  type CustomerListCostsResponse,
44
45
  type CustomerPreviewEventsResponse,
@@ -49,6 +50,7 @@ export {
49
50
  type CustomerRetrieveParams,
50
51
  type CustomerListParams,
51
52
  type CustomerArchiveParams,
53
+ type CustomerArchiveBillingConfigurationsParams,
52
54
  type CustomerListBillableMetricsParams,
53
55
  type CustomerListCostsParams,
54
56
  type CustomerPreviewEventsParams,
@@ -8,6 +8,9 @@ import { buildHeaders } from '../../../internal/headers';
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
  import { path } from '../../../internal/utils/path';
10
10
 
11
+ /**
12
+ * [Invoices](https://docs.metronome.com/invoicing/) reflect how much a customer spent during a period, which is the basis for billing. Metronome automatically generates invoices based upon your pricing, packaging, and usage events. Use these endpoints to retrieve invoices.
13
+ */
11
14
  export class Invoices extends APIResource {
12
15
  /**
13
16
  * Retrieve detailed information for a specific invoice by its unique identifier.
@@ -299,8 +302,8 @@ export interface Invoice {
299
302
  billable_status?: unknown;
300
303
 
301
304
  /**
302
- * Account hierarchy M3 - Required on invoices with type USAGE_CONSOLIDATED. List
303
- * of constituent invoices that were consolidated to create this invoice.
305
+ * Required on invoices with type USAGE_CONSOLIDATED. List of constituent invoices
306
+ * that were consolidated to create this invoice.
304
307
  */
305
308
  constituent_invoices?: Array<Invoice.ConstituentInvoice>;
306
309
 
@@ -348,8 +351,8 @@ export interface Invoice {
348
351
  netsuite_sales_order_id?: string;
349
352
 
350
353
  /**
351
- * Account hierarchy M3 - Required for account hierarchy usage invoices. An object
352
- * containing the contract and customer UUIDs that pay for this invoice.
354
+ * Required for account hierarchy usage invoices. An object containing the contract
355
+ * and customer UUIDs that pay for this invoice.
353
356
  */
354
357
  payer?: Invoice.Payer;
355
358
 
@@ -500,9 +503,9 @@ export namespace Invoice {
500
503
  netsuite_item_id?: string;
501
504
 
502
505
  /**
503
- * Account hierarchy M3 - Present on line items from invoices with type
504
- * USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line
505
- * item from which this line item was copied.
506
+ * Present on line items from invoices with type USAGE_CONSOLIDATED. Indicates the
507
+ * original customer, contract, invoice and line item from which this line item was
508
+ * copied.
506
509
  */
507
510
  origin?: LineItem.Origin;
508
511
 
@@ -583,6 +586,12 @@ export namespace Invoice {
583
586
  */
584
587
  subscription_custom_fields?: { [key: string]: string };
585
588
 
589
+ /**
590
+ * ID of the subscription that this line item is associated with. Only present on
591
+ * line items with product of `SUBSCRIPTION` type.
592
+ */
593
+ subscription_id?: string;
594
+
586
595
  /**
587
596
  * Populated if the line item has a tiered price.
588
597
  */
@@ -607,9 +616,9 @@ export namespace Invoice {
607
616
  }
608
617
 
609
618
  /**
610
- * Account hierarchy M3 - Present on line items from invoices with type
611
- * USAGE_CONSOLIDATED. Indicates the original customer, contract, invoice and line
612
- * item from which this line item was copied.
619
+ * Present on line items from invoices with type USAGE_CONSOLIDATED. Indicates the
620
+ * original customer, contract, invoice and line item from which this line item was
621
+ * copied.
613
622
  */
614
623
  export interface Origin {
615
624
  contract_id: string;
@@ -906,8 +915,8 @@ export namespace Invoice {
906
915
  }
907
916
 
908
917
  /**
909
- * Account hierarchy M3 - Required for account hierarchy usage invoices. An object
910
- * containing the contract and customer UUIDs that pay for this invoice.
918
+ * Required for account hierarchy usage invoices. An object containing the contract
919
+ * and customer UUIDs that pay for this invoice.
911
920
  */
912
921
  export interface Payer {
913
922
  contract_id: string;
@@ -5,6 +5,9 @@ import { APIPromise } from '../../../core/api-promise';
5
5
  import { buildHeaders } from '../../../internal/headers';
6
6
  import { RequestOptions } from '../../../internal/request-options';
7
7
 
8
+ /**
9
+ * Named schedules are used for storing custom data that can change over time. Named schedules are often used in custom pricing logic.
10
+ */
8
11
  export class NamedSchedules extends APIResource {
9
12
  /**
10
13
  * Get a named schedule for the given customer. This endpoint's availability is
@@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pa
7
7
  import { RequestOptions } from '../../../internal/request-options';
8
8
  import { path } from '../../../internal/utils/path';
9
9
 
10
+ /**
11
+ * [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).
12
+ */
10
13
  export class Plans extends APIResource {
11
14
  /**
12
15
  * List the given customer's plans in reverse-chronological order. This is a Plans
@@ -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
+ * [Customers](https://docs.metronome.com/provisioning/create-customers/) in Metronome represent your users for all billing and reporting. Use these endpoints to create, retrieve, update, and archive customers and their billing configuration.
9
+ */
7
10
  export class Dashboards extends APIResource {
8
11
  /**
9
12
  * Generate secure, embeddable dashboard URLs that allow you to seamlessly
@@ -33,6 +33,7 @@ export {
33
33
  type ContractAmendResponse,
34
34
  type ContractArchiveResponse,
35
35
  type ContractCreateHistoricalInvoicesResponse,
36
+ type ContractGetNetBalanceResponse,
36
37
  type ContractListBalancesResponse,
37
38
  type ContractRetrieveRateScheduleResponse,
38
39
  type ContractRetrieveSubscriptionQuantityHistoryResponse,
@@ -45,6 +46,7 @@ export {
45
46
  type ContractAmendParams,
46
47
  type ContractArchiveParams,
47
48
  type ContractCreateHistoricalInvoicesParams,
49
+ type ContractGetNetBalanceParams,
48
50
  type ContractListBalancesParams,
49
51
  type ContractRetrieveRateScheduleParams,
50
52
  type ContractRetrieveSubscriptionQuantityHistoryParams,
@@ -88,6 +90,7 @@ export {
88
90
  type CustomerCreateResponse,
89
91
  type CustomerRetrieveResponse,
90
92
  type CustomerArchiveResponse,
93
+ type CustomerArchiveBillingConfigurationsResponse,
91
94
  type CustomerListBillableMetricsResponse,
92
95
  type CustomerListCostsResponse,
93
96
  type CustomerPreviewEventsResponse,
@@ -98,6 +101,7 @@ export {
98
101
  type CustomerRetrieveParams,
99
102
  type CustomerListParams,
100
103
  type CustomerArchiveParams,
104
+ type CustomerArchiveBillingConfigurationsParams,
101
105
  type CustomerListBillableMetricsParams,
102
106
  type CustomerListCostsParams,
103
107
  type CustomerPreviewEventsParams,
@@ -122,6 +126,21 @@ export {
122
126
  type InvoiceRegenerateParams,
123
127
  type InvoiceVoidParams,
124
128
  } from './invoices';
129
+ export {
130
+ Packages,
131
+ type PackageCreateResponse,
132
+ type PackageRetrieveResponse,
133
+ type PackageListResponse,
134
+ type PackageArchiveResponse,
135
+ type PackageListContractsOnPackageResponse,
136
+ type PackageCreateParams,
137
+ type PackageRetrieveParams,
138
+ type PackageListParams,
139
+ type PackageArchiveParams,
140
+ type PackageListContractsOnPackageParams,
141
+ type PackageListResponsesCursorPage,
142
+ type PackageListContractsOnPackageResponsesCursorPage,
143
+ } from './packages';
125
144
  export {
126
145
  Payments,
127
146
  type Payment,
@@ -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
+ * [Invoices](https://docs.metronome.com/invoicing/) reflect how much a customer spent during a period, which is the basis for billing. Metronome automatically generates invoices based upon your pricing, packaging, and usage events. Use these endpoints to retrieve invoices.
9
+ */
7
10
  export class Invoices extends APIResource {
8
11
  /**
9
12
  * This endpoint regenerates a voided invoice and recalculates the invoice based on